- Go to https://master.garching.cluster.campar.in.tum.de/home.html
- Click submit job, choose "Config Editor"
- Copy and paste the contents of tum-cluster-config.yaml into the text box
- Click submit
- Wait for the job to start
- Once the job is running, click on the job name to open the job details
- Click "SSH Info" to get the ssh command to connect to the cluster
- Connect to the cluster with VSCode
- Once connected, install git and clone this repo:
git clone https://github.com/anilzeybek/tum-p3dcv.git - cd into the repo:
cd tum-p3dcv, and run the following command to download kitti data:./quicksetup.sh - Run the following command to convert the kitti data to the format expected by the nerfstudio (transforms.json):
python convertor.py - Last command will print the command to start the training with 3d-gs. Run it.
Ensure dataset is structured in the following manner:
tum-p3dcv/ ├── kitti-data/ │ ├── calibration/ │ │ ├── calib_cam_to_pose.txt │ │ ├── calib_cam_to_velo.txt │ │ ├── calib_sick_to_velo.txt │ │ ├── image_02.yaml │ │ ├── image_03.yaml │ │ └── perspective.txt │ ├── data_2d_raw/ │ │ └── 2013_05_28_drive_0009_sync/ │ ├── data_3d_semantics/ │ │ └── train/ │ └── data_poses/ │ └── 2013_05_28_drive_0009_sync/ ├── nerfstudio/ etc ├── ... etc
This guide explains how to set up and run our custom Nerfstudio inside a Docker container. It includes building the environment, mounting the necessary directories, and ensuring everything runs smoothly.
Ensure Docker is installed and running.
Run the following commands:
sudo apt update
sudo apt install -y docker.iodocker --versionExample output:
Docker version 20.10.14, build a224086
systemctl status dockerIf not running, start it:
sudo systemctl start dockerIf docker ps gives a permission error:
sudo usermod -aG docker $USER
newgrp dockerLog out and log back in to apply changes.
docker imagesIf you see nerfstudio listed, proceed to Step 3. If not, continue below.
docker pull nerfstudioIf you have a Dockerfile, navigate to its directory and run:
docker build -t nerfstudio .To simplify launching Docker, create a script:
Replace with your path:
cd /path/to/tum-p3dcvnano runDocker.sh#!/bin/bash
docker run --gpus all \
--shm-size=10gb \
-it \
-v /path/to/tum-p3dcv:/workspace \
--expose=7007 \
--hostname="docker-trainer" \
nerfstudio bashSave and exit (CTRL + X, then Y, then ENTER). Then run:
chmod +x runDocker.shLaunch the container using the script:
./runDocker.shYou should now be inside the Docker container.
Either run the quicksetup.sh for an automatic dowload of the dataset + an installation of the custom nerfstudio and skip to step 8, ...
or, ...
...simpy install the nerfstudio manually if you already have the dataset downloaded correctly. Continue with step 5:
Inside the container, remove the preinstalled version:
rm -rf /usr/local/lib/python3.10/dist-packages/nerfstudioapt update && apt install -y python3-pip unzip htop tmux gitNavigate to your repo inside the container:
cd /workspace/nerstudioInstall it in editable mode:
pip install -e .Since /workspace is mounted to your host directory, you can:
- Edit code in VSCode or any editor on the host.
- Pull updates from Git inside the container:
cd /workspace git pull
Example:
python3 launch_calibration.pyTo exit the running container safely:
exitFind the container ID:
docker ps -aRestart it:
docker start -ai <container_id>When running Nerfstudio inside a Docker container, the viewer is not accessible via localhost:7007. Instead, you need to find the correct Docker container IP address.
Run the following command inside your terminal (on the host machine):
ip a | grep inetThis will output a list of IP addresses. Look for an entry under scope global docker0, which typically looks like:
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
However, this might still not be the correct address to use. Instead, try replacing the last digit (1) with 2, making it:
This works in most cases but may vary for different users.
If 172.17.0.2 does not work, find the exact container IP by running inside the container:
ip a | grep inetLook for an entry under eth0, which typically shows something like:
inet 172.17.0.2/16 scope global eth0
Use that IP with port 7007 in your browser:
http://:7007/
If accessing from another device on your local network, use the host machine’s IP instead. Find it with:
ip a | grep inetLook for the IP associated with your Wi-Fi or Ethernet interface (e.g., wlo1 or eth0). Example:
inet 192.168.2.147/24 brd 192.168.2.255 scope global dynamic noprefixroute wlo1
Then access the viewer from another device using:
(Replace 192.168.2.147 with your actual host IP.)
- Select your calibration configuration in the config.json file
- Ensure you have your nerfstudio conda environment activated
- Simply run the launch_calibration.py file
- While training, you can check the training at the viser link printed in the terminal.
- The
algorithmparameter specifies which algorithm to use during training. - Acceptable values are:
splatfacto: Uses 3D Gaussian Splatting.nerfacto: Uses NeRF.
Please ensure that the value is set correctly in the config.json file. The default is splatfacto due to higher reconstruction accuracy.
(let's find out if one reconstruction algorithm is better than the other in terms of calibration accuracy!)
- The
rotation_noise_stdparameter is in radians, where 0.01 ≈ 0.57°. - The
translation_noise_stdis in meters, where 0.01 = 1 cm. - 0.01 and 0.01 represent realistic miscalibration errors.
- That level of error is unnoticable to the naked eye however, so set both values to 0.1 to see the noise working.
For now, we consider the LIDAR and left camera to be perfect and ground truth and only inject noise to the right camera. That noise is random, but consistent among all image pairs (i.e. the rotation and translation noise between two pairs of images - left and right - is consistent among all pairs of frames)
(there is potentially a bug where the error is indeed the same for all frames, but relative to world reference, instead of relative to its left image counterpart, which would explain the drift during the right hand turn of the car that we were observing yesterday. However, today, no drift is noticeable and the noise seems to be applied correctly relative to the left image)
The strength of the noise can be changed in the config file.