Skip to content

Commit a889107

Browse files
committed
feat: silvr 2.0
1 parent faa40dd commit a889107

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3847
-204
lines changed

.docker/.env

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
UID=1000
2-
GID=1000
2+
GID=1000
3+
USERNAME=docker_dev # Set your username for the container
4+
5+
HOST_DATA_DIR=~/data # folder on the host machine which you can attach to the container
6+
7+
DOCKER_HOME_DIR=/home/${USERNAME} # Home directory inside the container
8+
DOCKER_WORK_DIR=${DOCKER_HOME_DIR}/silvr # Path to the main codebase inside the docker container
9+
DOCKER_DATA_DIR=${DOCKER_HOME_DIR}/data # folder inside the docker container of the attached folder HOST_DATA_DIR

.docker/Dockerfile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,23 @@ RUN python -m pip install --no-cache-dir git+https://github.com/NVlabs/tiny-cuda
3333

3434
ARG GID
3535
ARG UID
36-
ENV UNAME=docker_dev
37-
RUN addgroup --gid $GID $UNAME
38-
RUN adduser --disabled-password --gecos '' --uid $UID --gid $GID $UNAME
36+
ARG USERNAME
37+
RUN addgroup --gid $GID $USERNAME
38+
RUN adduser --disabled-password --gecos '' --uid $UID --gid $GID $USERNAME
3939

40-
ARG SILVR_DIR=/home/docker_dev/silvr
41-
WORKDIR ${SILVR_DIR}
40+
ARG DOCKER_HOME_DIR
41+
ARG DOCKER_WORK_DIR
42+
WORKDIR ${DOCKER_WORK_DIR}
4243

43-
COPY ./requirements.txt ${SILVR_DIR}/requirements.txt
44+
COPY ./requirements.txt ${DOCKER_WORK_DIR}/requirements.txt
4445
RUN pip install -r requirements.txt
45-
COPY ./silvr/ ${SILVR_DIR}/silvr
46-
COPY ./pyproject.toml ${SILVR_DIR}/pyproject.toml
47-
COPY ./scripts/ ${SILVR_DIR}/scripts
48-
COPY ./config/ ${SILVR_DIR}/config
46+
COPY ./silvr/ ${DOCKER_WORK_DIR}/silvr
47+
COPY ./pyproject.toml ${DOCKER_WORK_DIR}/pyproject.toml
4948
RUN pip install -e .
5049
# Make the outputs of the container match the host
5150

52-
RUN chown -R ${UID}:${GID} ${SILVR_DIR}/*
53-
USER ${UNAME}
51+
RUN chown -R ${UID}:${GID} ${DOCKER_HOME_DIR}/*
52+
USER ${USERNAME}
5453
RUN echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@docker-\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '" >> ~/.bashrc
5554

5655
CMD ["/bin/bash"]

.docker/docker_compose.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ services:
77
args:
88
- UID=${UID}
99
- GID=${GID}
10+
- USERNAME=${USERNAME}
11+
- DOCKER_HOME_DIR=${DOCKER_HOME_DIR}
12+
- DOCKER_WORK_DIR=${DOCKER_WORK_DIR}
1013
environment:
1114
- NVIDIA_VISIBLE_DEVICES=all
1215
- NVIDIA_DRIVER_CAPABILITIES=all
1316
runtime: nvidia
1417
network_mode: "host"
1518
tty: true
16-
# volumes:
17-
# - /home/yifu/data:/home/docker_dev/data # mount the data folder
18-
# - /home/yifu/workspace/silvr_public:/home/docker_dev/silvr # mount silvr folder to access the outputs and update the code
19-
# - /home/yifu/.netrc:/home/docker_dev/.netrc # for wandb authentication
20-
19+
volumes:
20+
- ${HOST_DATA_DIR}:${DOCKER_DATA_DIR}
2121

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Build a docker image to install dependencies and run SiLVR.
1616
```
1717
docker compose -f .docker/docker_compose.yaml run --build silvr
1818
```
19+
Note: You can use your own `CUDA_ARCHITECTURES` in the Dockerfile to make the `tinycudann` build quicker.
1920
### Manual Installation
2021
You can also install SiLVR to your system manually.
2122
```
@@ -33,6 +34,18 @@ pip install -e .
3334

3435

3536
## Running
37+
### T-RO 25 Results
38+
```
39+
# download data
40+
python scripts/data_downloader.py
41+
42+
# Sequence 1: ROQ
43+
python scripts/main.py --config config/2024-03-13-roq-01-unc.yaml
44+
45+
# Sequence 2: Bodleian
46+
python scripts/main.py --config config/2024-bodleian-01+02-tro-unc.yaml
47+
```
48+
### ICRA 24 Results
3649
Download sample data from [Hugging face](https://huggingface.co/datasets/ori-drs/silvr_data/tree/main), setup the [config file](./scripts/config_train.yaml), and then run the training script.
3750
```bash
3851
python scripts/data_downloader.py
@@ -54,10 +67,10 @@ pre-commit install
5467
## Citation
5568
If you found this software package useful, please consider citing our paper as
5669
```bibtex
57-
@inproceedings{tao2024silvr,
58-
title = {SiLVR: Scalable Lidar-Visual Reconstruction with Neural Radiance Fields for Robotic Inspection},
59-
author = {Tao, Yifu and Bhalgat, Yash and Fu, Lanke Frank Tarimo and Mattamala, Matias and Chebrolu, Nived and Fallon, Maurice},
60-
booktitle = {IEEE International Conference on Robotics and Automation (ICRA)},
61-
year = {2024},
70+
@article{tao2025silvr,
71+
title={SiLVR: Scalable Lidar-Visual Radiance Field Reconstruction with Uncertainty Quantification},
72+
author={Tao, Yifu and Fallon, Maurice},
73+
journal={IEEE Transactions on Robotics},
74+
year={2025},
6275
}
6376
```

config/2024-03-13-roq-01-unc.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
base:
2+
method: "bayes-lidar-normal-nerfacto"
3+
data: "/home/docker_dev/silvr/data/2024-03-13-roq-01-tro/transforms_colmap_scaled_lidar.json" # This will be skipped if run_submap is true
4+
vis: "wandb"
5+
max_train_images: 200
6+
max_eval_images: 30
7+
cam_optimiser_mode: "off"
8+
cam_opt_lf: 0.0006
9+
max_num_iterations: 30001
10+
steps_per_eval_image: 2000
11+
steps_per_eval_all_images: 70000
12+
output_dir: "/home/docker_dev/silvr/outputs"
13+
14+
lidar_nerf:
15+
lidar_depth_loss_type: "DS_NERF_NEW"
16+
is_euclidean_depth: false
17+
depth_loss_mult: 10
18+
normal_loss_mult: 0.001
19+
depth_sigma: 0.001
20+
should_decay_sigma: true
21+
starting_depth_sigma: 0.01
22+
sigma_decay_rate: 0.99985
23+
save_pcd: false
24+
25+
post_process:
26+
save_folder_name: "post_process"
27+
compute_nvs_metrics: false
28+
compute_uncertainty: true
29+
unc_iterations: 1000
30+
unc_grid_lod: 8
31+
render_uncertainty: true
32+
render_max_uncertainty_point_legacy: 1
33+
render_downscale: 1
34+
render_cam_path_with_submap: false
35+
camera_path_file: ""
36+
camera_path_model_folder_path: ""
37+
export_cloud: true
38+
export_cloud_suffix: ""
39+
cloud_max_uncertainty_ray: 1
40+
export_num_points: 1000000
41+
evaluate_cloud: false
42+
ground_truth_3d_map_path: "/home/docker_dev/silvr/data/2024-03-13-roq-01/gt_5cm_lidar_frame.pcd"
43+
T_gt_nerf_path: ""
44+
45+
only_post_process:
46+
turn_on: false # if turned on, training will be skipped
47+
output_folders:
48+
# - "/home/yifu/workspace/silvr/outputs/hbac_maths_19/bayes-lidar-normal-nerfacto/2024-07-14_132335"
49+
50+
submap:
51+
run_submap: true
52+
data_main_folder: "/home/docker_dev/silvr/data/2024-03-13-roq-01-tro"
53+
submap_folder: "/home/docker_dev/silvr/data/2024-03-13-roq-01-tro/submaps_visibility"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
base:
2+
method: "bayes-lidar-normal-nerfacto"
3+
data: "/home/docker_dev/silvr/data/2024-bodleian-01+02-tro/transforms_colmap_scaled_lidar_no_cam2_bod_1.json" # This will be skipped if run_submap is true
4+
vis: "wandb"
5+
max_train_images: 500
6+
max_eval_images: 30
7+
cam_optimiser_mode: "off"
8+
cam_opt_lf: 0.0006
9+
max_num_iterations: 30001
10+
steps_per_eval_image: 2000
11+
steps_per_eval_all_images: 70000
12+
output_dir: "/home/docker_dev/silvr/outputs"
13+
14+
lidar_nerf:
15+
lidar_depth_loss_type: "DS_NERF_NEW"
16+
is_euclidean_depth: false
17+
depth_loss_mult: 10
18+
normal_loss_mult: 0.001
19+
depth_sigma: 0.001
20+
should_decay_sigma: true
21+
starting_depth_sigma: 0.01
22+
sigma_decay_rate: 0.99985
23+
save_pcd: false
24+
25+
post_process:
26+
save_folder_name: "post_process"
27+
compute_nvs_metrics: false
28+
compute_uncertainty: true
29+
unc_iterations: 1000
30+
unc_grid_lod: 8
31+
render_uncertainty: true
32+
render_max_uncertainty_point_legacy: 1
33+
render_downscale: 1
34+
render_cam_path_with_submap: false
35+
camera_path_file: ""
36+
camera_path_model_folder_path: ""
37+
export_cloud: true
38+
export_cloud_suffix: ""
39+
cloud_max_uncertainty_ray: 1
40+
export_num_points: 1000000
41+
evaluate_cloud: false
42+
ground_truth_3d_map_path: ""
43+
T_gt_nerf_path: ""
44+
45+
only_post_process:
46+
turn_on: false # if turned on, training will be skipped
47+
output_folders:
48+
# - "/home/yifu/workspace/silvr/outputs/hbac_maths_19/bayes-lidar-normal-nerfacto/2024-07-14_132335"
49+
50+
submap:
51+
run_submap: true
52+
data_main_folder: "/home/docker_dev/silvr/data/2024-bodleian-01+02-tro"
53+
submap_folder: "/home/docker_dev/silvr/data/2024-bodleian-01+02-tro/submaps_visibility"

config/bodleian.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
base:
2+
method: "bayes-lidar-normal-nerfacto"
3+
data: "/home/yifu/data/nerfstudio/hbac_maths_19/submap_2_cut.json"
4+
vis: "wandb"
5+
max_train_images: 200
6+
max_eval_images: 30
7+
cam_optimiser_mode: "off"
8+
cam_opt_lf: 0.0006
9+
max_num_iterations: 1001
10+
steps_per_eval_image: 2000
11+
steps_per_eval_all_images: 70000
12+
output_dir: "/home/docker_dev/silvr/outputs"
13+
14+
lidar_nerf:
15+
lidar_depth_loss_type: "DS_NERF_NEW"
16+
depth_loss_mult: 10
17+
normal_loss_mult: 0.001
18+
is_euclidean_depth: false
19+
depth_sigma: 0.001
20+
should_decay_sigma: true
21+
starting_depth_sigma: 0.01
22+
sigma_decay_rate: 0.99985
23+
save_pcd: false
24+
25+
post_process:
26+
save_folder_name: "post_process"
27+
compute_nvs_metrics: true
28+
compute_uncertainty: false
29+
unc_iterations: 10000
30+
unc_grid_lod: 8
31+
render_uncertainty: false
32+
render_max_uncertainty_point_legacy: 1
33+
render_downscale: 1
34+
render_cam_path_with_submap: false
35+
camera_path_file: ""
36+
camera_path_model_folder_path: ""
37+
export_cloud: true
38+
export_cloud_suffix: ""
39+
# cloud_max_uncertainty_point_legacy: 1
40+
cloud_max_uncertainty_ray: 1
41+
export_num_points: 1000000
42+
evaluate_cloud: true
43+
grond_truth_3d_map_path: "/home/docker_dev/oxford_spires_dataset/2024-03-13-observatory-quarter-01/outputs/recon_benchmark/gt_cloud_merged.pcd"
44+
T_gt_nerf_path: "/home/docker_dev/data/hbac_maths_19/T_gt_nerf.txt"
45+
46+
only_post_process:
47+
turn_on: false # if turned on, training will be skipped
48+
output_folders:
49+
# - "/home/yifu/workspace/silvr/outputs/hbac_maths_19/bayes-lidar-normal-nerfacto/2024-07-14_132335"
50+
- "/home/yifu/workspace/silvr/outputs/hbac_maths_19/bayes-lidar-normal-nerfacto/2024-07-14_134014"
51+
- "/home/yifu/workspace/silvr/outputs/hbac_maths_19/bayes-lidar-normal-nerfacto/2024-07-14_135719"
52+
53+
submap:
54+
run_submap: true
55+
data_main_folder: "/home/yifu/data/nerfstudio/hbac_maths_19"
56+
submap_folder: "/home/yifu/data/nerfstudio/hbac_maths_19/submaps"

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ dependencies = {file = ["requirements.txt"]}
1818
# ndp = "silvr.test:main"
1919

2020
[project.entry-points.'nerfstudio.method_configs']
21-
lidar_nerfacto = 'silvr.silvr_config:Lidar_nerfacto'
2221
lidar_depth_nerfacto = 'silvr.silvr_config:Lidar_depth_nerfacto'
22+
lidar_normal_nerfacto = 'silvr.silvr_config:Lidar_normal_nerfacto'
23+
bayes_nerfacto = 'silvr.silvr_config:Bayes_nerfacto'
24+
bayes_lidar_normal_nerfacto = 'silvr.silvr_config:Bayes_Lidar_normal_nerfacto'
25+
bayes_lidar_normal_nerfacto_big = 'silvr.silvr_config:Bayes_Lidar_normal_nerfacto_big'
2326

2427
[project.optional-dependencies]
2528
style = [

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ gsplat==0.1.12
44
pre-commit==3.0.0
55
ruff==0.11.4
66
tyro==0.6.6
7+
pytest==8.3.3
78
wandb==0.13.3
89
huggingface_hub==0.30.2
10+
hf_xet==1.2.0

0 commit comments

Comments
 (0)