Skip to content

Commit

Permalink
fix formatting issues (#27)
Browse files Browse the repository at this point in the history
* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues

* fix formatting issues
  • Loading branch information
LOTEAT authored Jan 30, 2023
1 parent a6f2f6f commit f802056
Show file tree
Hide file tree
Showing 89 changed files with 1,898 additions and 1,450 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: build

on:
Expand All @@ -12,17 +12,17 @@ on:
- 'README.md'
- 'README_CN.md'
- 'docs/**'

pull_request: # 触发条件之一为该commit属于某个PR,忽略条件同上。
paths-ignore:
- 'README.md'
- 'README_CN.md'
- 'docs/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_test:
runs-on: ubuntu-18.04
Expand All @@ -40,7 +40,7 @@ jobs:
# pip install torch numpy mmcv -i https://pypi.tuna.tsinghua.edu.cn/simple
# pip install opencv-python>=3 yapf imageio scikit-image -i https://pypi.tuna.tsinghua.edu.cn/simple
coverage run --source xrnerf/models -m pytest -s test/models
coverage run --source xrnerf/models -m pytest -s test/models
coverage xml
coverage report -m
- name: Upload coverage to Codecov # 上传覆盖率报告
Expand All @@ -50,4 +50,4 @@ jobs:
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
rev: 3.8.3
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
- repo: https://github.com/LOTEAT/isort
rev: 5.10.1
hooks:
- id: isort
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Supported scene-NeRF methods:
- [X] [Mip-NeRF](https://jonbarron.info/mipnerf/) (ICCV'2021)
- [X] [KiloNeRF](https://arxiv.org/abs/2103.13744) (ICCV'2021)
- [X] [Instant NGP](https://nvlabs.github.io/instant-ngp/) (SIGGRAPH'2022)
- [X] [BungeeNeRF](https://city-super.github.io/citynerf/) (ECCV'2022)

Supported human-NeRF methods:

Expand Down Expand Up @@ -88,6 +89,7 @@ xrnerf
│ ├── nerf_llff_data
│ ├── nerf_synthetic
│ ├── multiscale
│ ├── multiscale_google
│ ├── ...
```

Expand Down
8 changes: 5 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- [X] [Mip-NeRF](https://jonbarron.info/mipnerf/) (ICCV'2021)
- [X] [KiloNeRF](https://arxiv.org/abs/2103.13744) (ICCV'2021)
- [X] [Instant NGP](https://nvlabs.github.io/instant-ngp/) (SIGGRAPH'2022)
- [X] [BungeeNeRF](https://city-super.github.io/citynerf/) (ECCV'2022)


支持的人体类神经渲染方法如下:
Expand Down Expand Up @@ -77,6 +78,7 @@ xrnerf
│ ├── nerf_llff_data
│ ├── nerf_synthetic
│ ├── multiscale
│ ├── multiscale_google
│ ├── ...
```

Expand Down Expand Up @@ -119,7 +121,7 @@ xrnerf

def __init__(self, cfg, mlp=None, mlp_fine=None, render=None):
super().__init__(cfg, mlp, mlp_fine, render)

def forward(self, data):
....

Expand All @@ -136,7 +138,7 @@ xrnerf
from .my_networks import MyNerfNetwork
```

3. 修改配置文件[config file](configs/nerf/nerf_blender_base01.py)
3. 修改配置文件[config file](configs/nerf/nerf_blender_base01.py)
原来

```python
Expand Down Expand Up @@ -165,7 +167,7 @@ xrnerf

XRnerf 使用 `mmcv.runner.IterBasedRunner` 来控制训练, 并用 `mmcv.runner.EpochBasedRunner` 来测试.

训练时, 配置文件的 `max_iters` 表示最多训练多少次.
训练时, 配置文件的 `max_iters` 表示最多训练多少次.
测试时, `max_iters` 被强制改为1, 表示进行一次完整的epoch.

### 训练命令
Expand Down
17 changes: 9 additions & 8 deletions configs/bungeenerf/bungeenerf_multiscale_google.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# runtime settings
num_gpus = 1
distributed = (num_gpus > 1) # 是否多卡,mmcv对dp多卡支持不好,故而要么单卡要么ddp多卡
stage = 0 # current stage for training
stage = 0 # current stage for training
work_dir = './work_dirs/bungeenerf/#DATANAME#/stage_%d/' % stage
timestamp = datetime.now().strftime('%d-%b-%H-%M')

Expand Down Expand Up @@ -81,10 +81,9 @@
bs_data=
'rays_o', # the data's shape indicates the real batch-size, this's also the num of rays
),

mlp=dict( # coarse model
type='BungeeNerfMLP',
cur_stage=stage, # resblock nums
cur_stage=stage, # resblock nums
netwidth=256, # channels per layer
netchunk=1024 * 64, # number of pts sent through network in parallel;
embedder=dict(
Expand All @@ -96,7 +95,6 @@
4, # this is 'multires_views' in origin codes, log2 of max freq for positional encoding (2D direction)
),
),

render=dict( # render model
type='BungeeNerfRender',
white_bkgd=
Expand Down Expand Up @@ -143,7 +141,9 @@
enable=use_viewdirs,
),
dict(type='BungeeGetBounds', enable=True),
dict(type='BungeeGetZvals', enable=True, lindisp=lindisp,
dict(type='BungeeGetZvals',
enable=True,
lindisp=lindisp,
N_samples=N_samples), # N_samples: number of coarse samples per ray
dict(type='PerturbZvals', enable=is_perturb),
dict(type='DeleteUseless', enable=True,
Expand All @@ -161,15 +161,16 @@
include_radius=True,
enable=True,
),
dict(type='FlattenRays',
include_radius=True,
dict(type='FlattenRays', include_radius=True,
enable=True), # 原来是(H, W, ..) 变成(H*W, ...) 记录下原来的尺寸
dict(
type='GetViewdirs',
enable=use_viewdirs,
),
dict(type='BungeeGetBounds', enable=True),
dict(type='BungeeGetZvals', enable=True, lindisp=lindisp,
dict(type='BungeeGetZvals',
enable=True,
lindisp=lindisp,
N_samples=N_samples), # 同上train_pipeline
dict(type='PerturbZvals', enable=False), # 测试集不扰动
dict(type='DeleteUseless', enable=True,
Expand Down
Loading

0 comments on commit f802056

Please sign in to comment.