Skip to content

Commit

Permalink
ready to release
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrument committed Feb 7, 2024
1 parent 4cf79db commit df9bb5d
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ fabric.properties
data
public_data
exp
tmp
exp_old
eval

script.sh
get_exp.sh
eval
tmp.sh
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is the official implementation of **RNb-NeuS: Reflectance and Normal-based
[Jean Mélou](https://www.irit.fr/~Jean.Melou/),
[François Lauze](https://loutchoa.github.io/),
[Jean-Denis Durou](https://www.irit.fr/~Jean-Denis.Durou/),
[Lilian Calvet](https://www.youtube.com/watch?v=dQw4w9WgXcQ&pp=ygUKcmljayBhc2xleQ%3D%3D)
[Lilian Calvet](https://scholar.google.com/citations?user=6JewdrMAAAAJ&hl=en)

### [Project page](https://robinbruneau.github.io/publications/rnb_neus.html) | [Paper](https://arxiv.org/abs/2312.01215)

Expand All @@ -24,7 +24,52 @@ pip install -r requirements.txt

## Usage

Coming later...
#### Data Convention

Our data format is inspired from [IDR](https://github.com/lioryariv/idr/blob/main/DATA_CONVENTION.md) as follows:
```
CASE_NAME
|-- cameras_xxx.npz # camera parameters
|-- normal
|-- 000.png # normal map for each view
|-- 001.png
...
|-- albedo
|-- 000.png # albedo for each view (optional)
|-- 001.png
...
|-- mask
|-- 000.png # mask for each view
|-- 001.png
...
```

One can create folders with different data in it, for instance, a normal folder for each normal estimation method.
The name of the folder must be set in the used `.conf` file.

We provide the [DiLiGenT-MV](https://drive.google.com/file/d/1TEBM6Dd7IwjRqJX0p8JwT9hLmy_vA5nU/view?usp=drive_link) data as described above with normals and reflectance maps estimated with [SDM-UniPS](https://github.com/satoshi-ikehata/SDM-UniPS-CVPR2023/). Note that the reflectance maps were scaled over all views and uncertainty masks were generated from 100 normals estimations (see the article for further details).

### Run RNb-NeuS!

**Train with reflectance**

```shell
python exp_runner.py --mode train_rnb --conf ./confs/CONF_NAME.conf --case CASE_NAME
```

**Train without reflectance**

```shell
python exp_runner.py --mode train_rnb --conf ./confs/CONF_NAME.conf --case CASE_NAME --no_albedo
```

**Extract surface**

```shell
python exp_runner.py --mode validate_mesh --conf ./confs/CONF_NAME.conf --case CASE_NAME --is_continue
```

Additionaly, we provide the five meshes of the DiLiGenT-MV dataset with our method [here](https://drive.google.com/file/d/1CTQW1YLWOT2sSEWznFmSY_cUUtiTXLdM/view?usp=drive_link).

## Citation
If you find our code useful for your research, please cite
Expand All @@ -36,4 +81,4 @@ If you find our code useful for your research, please cite
archivePrefix={arXiv},
year={2023}
}
```
```
2 changes: 1 addition & 1 deletion confs/wmask_rnb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dataset {

normal_dir = normal
albedo_dir = albedo
mask_dir = mask_geodist
mask_dir = mask

render_cameras_name = cameras.npz
object_cameras_name = cameras.npz
Expand Down
2 changes: 1 addition & 1 deletion confs/wmask_rnb_noalbedo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dataset {
data_dir = ./data/CASE_NAME/

normal_dir = normal
mask_dir = mask_geodist
mask_dir = mask

render_cameras_name = cameras.npz
object_cameras_name = cameras.npz
Expand Down
89 changes: 89 additions & 0 deletions confs/womask_rnb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
general {
base_exp_dir = ./exp/CASE_NAME/womask_rnb
recording = [
./,
./models
]
}

dataset {
data_dir = ./data/CASE_NAME/

normal_dir = normal
albedo_dir = albedo

render_cameras_name = cameras.npz
object_cameras_name = cameras.npz
}

train {
learning_rate = 5e-4,
learning_rate_alpha = 0.05,
end_iter = 300000,
warm_up_iter = 200000,

batch_size = 512,
validate_resolution_level = 4,
warm_up_end = 5000,
anneal_end = 50000,
use_white_bkgd = False,

save_freq = 10000,
val_freq = 5000,
val_mesh_freq = 25000,
report_freq = 500,

igr_weight = 0.1,
mask_weight = 0,
}

model {
nerf {
D = 8,
d_in = 4,
d_in_view = 3,
W = 256,
multires = 10,
multires_view = 4,
output_ch = 4,
skips=[4],
use_viewdirs=True
}

sdf_network {
d_out = 257,
d_in = 3,
d_hidden = 256,
n_layers = 8,
skip_in = [4],
multires = 6,
bias = 0.5,
scale = 1.0,
geometric_init = True,
weight_norm = True
}

variance_network {
init_val = 0.3
}

rendering_network {
d_feature = 256,
mode = no_view_dir,
d_in = 6,
d_out = 3,
d_hidden = 256,
n_layers = 2,
weight_norm = True,
multires_view = 4,
squeeze_out = True
}

neus_renderer {
n_samples = 64,
n_importance = 64,
n_outside = 32,
up_sample_steps = 4, # 1 for simple coarse-to-fine sampling
perturb = 1.0
}
}
88 changes: 88 additions & 0 deletions confs/womask_rnb_noalbedo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
general {
base_exp_dir = ./exp/CASE_NAME/womask_rnb_noalbedo
recording = [
./,
./models
]
}

dataset {
data_dir = ./data/CASE_NAME/

normal_dir = normal

render_cameras_name = cameras.npz
object_cameras_name = cameras.npz
}

train {
learning_rate = 5e-4,
learning_rate_alpha = 0.05,
end_iter = 300000,
warm_up_iter = 200000,

batch_size = 512,
validate_resolution_level = 4,
warm_up_end = 5000,
anneal_end = 50000,
use_white_bkgd = False,

save_freq = 10000,
val_freq = 5000,
val_mesh_freq = 25000,
report_freq = 500,

igr_weight = 0.1,
mask_weight = 0,
}

model {
nerf {
D = 8,
d_in = 4,
d_in_view = 3,
W = 256,
multires = 10,
multires_view = 4,
output_ch = 4,
skips=[4],
use_viewdirs=True
}

sdf_network {
d_out = 257,
d_in = 3,
d_hidden = 256,
n_layers = 8,
skip_in = [4],
multires = 6,
bias = 0.5,
scale = 1.0,
geometric_init = True,
weight_norm = True
}

variance_network {
init_val = 0.3
}

rendering_network {
d_feature = 256,
mode = no_view_dir,
d_in = 6,
d_out = 3,
d_hidden = 256,
n_layers = 2,
weight_norm = True,
multires_view = 4,
squeeze_out = True
}

neus_renderer {
n_samples = 64,
n_importance = 64,
n_outside = 32,
up_sample_steps = 4, # 1 for simple coarse-to-fine sampling
perturb = 1.0
}
}

0 comments on commit df9bb5d

Please sign in to comment.