Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active April 24, 2024 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/9899e77229ddae7ba8068aca083fe0f8 to your computer and use it in GitHub Desktop.
Save shawngraham/9899e77229ddae7ba8068aca083fe0f8 to your computer and use it in GitHub Desktop.
installing nerfstudio on a mac
# https://github.com/nerfstudio-project/nerfstudio/issues/2438
conda create --name nerfstudio -y python=3.8
conda activate nerfstudio
python -m pip install --upgrade pip
pip uninstall torch torchvision functorch tinycudann
pip install torch==2.0.1 torchvision==0.15.2
git clone https://github.com/nerfstudio-project/nerfstudio.git
cd nerfstudio
pip install --upgrade pip setuptools
pip install -e .
@shawngraham
Copy link
Author

PYTORCH_ENABLE_MPS_FALLBACK=1 ns-train nerfacto --data data/nerfstudio/poster --machine.device-type mps --mixed-precision False

@shawngraham
Copy link
Author

bah.

@shawngraham
Copy link
Author

ok, I got it running; it's eating nearly 13 gb of ram on 'poster', I dropped the 'mixed-precision' flag, and I don't have the viewer running. It's slow as hell, but... it's working?

@shawngraham
Copy link
Author

ok, turning on the viewer kills everything. Alright. However - with colmap installed ($ brew install colmap), I can feed my folder of images like so: ns-process-data images --data data/nerfstudio/test --output-dir data/nerfstudio/testoutput and then use the version of nerfstudio running in the browser https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/main/colab/demo.ipynb to nerfify things. Just zip the processed folder (which contains transforms.json), and then use the 'use polycam' button to upload things. Then make sure it unzips properly so that the contents of the unzipped folder are in data/nerfstudio/custom data.

@shawngraham
Copy link
Author

(ie, nerfstudio runs on my M1 mini, but excruciatingly slowly.)

@shawngraham
Copy link
Author

ns-process-data video --data data/nerfstudio/testfilm.mp4 --output-dir data/nerfstudio/videooutput

longer videos, with slow movement around the object, seem to get best results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment