cloud-based nerfstudio using AWS EC2 and S3 Mountpoint

Below are notes on how I set up Nerfstudio on an EC2 g5.xlarge instance, for a project where I reconstruct a mall using pictures I took in 2018. I turned these images into Gaussian splats, then used the Luma AI plugin for Unreal Engine 5 to stitch the splats together into a walkable first-person experience.

Screenshot of the mall project

https://docs.nerf.studio/quickstart/installation.html

Set up AWS resources

EC2 Instance

conda activate nerfstudio

change default CUDA version

install nerfstudio

https://docs.nerf.studio/quickstart/installation.html

s3 mountpoint

remount when restarting instance after stopping

mount-s3 factoria-2018-dataset ./s3mount-factoria-2018-dataset

install COLMAP and ffmpeg

creating the splat!!!

Process image data

 ns-process-data images --data ./s3mount-factoria-2018-dataset/area-4/ --output-dir ~/area-4-processed

Generate the splat

ns-train splatfacto --data ~/area-4-processed --output-dir ~/area-4-outputs
ns-render camera-path --load-config /home/ubuntu/area-4-outputs-ingp/area-4-processed/instant-ngp/2024-04-14_080837/config.yml --camera-path-filename /home/ubuntu/area-4-processed/camera_paths/2024-04-14-09-59-00.json --output-path renders/area-4-processed/2024-04-14-09-59-00.mp4

do the command in background even after terminal exits

https://phoenixnap.com/kb/linux-run-command-background

nohup [command] &

Check the background processes' status in the current shell session with the jobs command:

jobs

The output saves in the nohup.out log file. Verify the log with cat:

cat nohup.out

To bring a background process back to the foreground, use fg followed by the job ID or process ID.

For instance, if Vim had job ID 1, bring it back to the foreground using the job ID with:

fg 1%

To use the process ID, execute:

fg 2781