From 08b2dd71d0ff2369e32beb4667dd1aa35b8775d5 Mon Sep 17 00:00:00 2001 From: Aaryan Chandna Date: Sun, 15 Jun 2025 19:52:50 -0700 Subject: [PATCH 01/11] all colab changes --- colab/demo.ipynb | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/colab/demo.ipynb b/colab/demo.ipynb index d9f5ed9826..bbb3557ab3 100644 --- a/colab/demo.ipynb +++ b/colab/demo.ipynb @@ -61,6 +61,25 @@ " * Feel free to create an issue on our [GitHub repo](https://github.com/nerfstudio-project/nerfstudio).\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Sequence of installations required for notebook to run with Python 3.10\n", + "!pip install colab-xterm\n", + "%reload_ext colabxterm\n", + "!apt-get update -y\n", + "!apt-get install python3.10 python3.10-distutils\n", + "!update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10\n", + "!update-alternatives --config python3\n", + "!apt-get install python3-pip\n", + "!python3 -m pip install --upgrade pip --user\n", + "!sudo apt remove python3-blinker\n", + "!pip install --force-reinstall \"numpy<2.0.0\"" + ] + }, { "cell_type": "code", "execution_count": null, @@ -253,13 +272,11 @@ "# @title # Render Video { vertical-output: true }\n", "# @markdown

Export the camera path from within the viewer, then run this cell.

\n", "# @markdown
The rendered video should be at renders/output.mp4!
\n", - "\n", + "from IPython.core.display import HTML, display\n", "\n", "base_dir = \"/content/outputs/unnamed/nerfacto/\"\n", "training_run_dir = base_dir + os.listdir(base_dir)[0]\n", "\n", - "from IPython.core.display import HTML, display\n", - "\n", "display(HTML(\"

Upload the camera path JSON.

\"))\n", "%cd $training_run_dir\n", "uploaded = files.upload()\n", From 0034ce1811ad849f02f2e97774a6aaf8c5cad4f9 Mon Sep 17 00:00:00 2001 From: basebala Date: Tue, 7 Jul 2026 22:46:11 -0700 Subject: [PATCH 02/11] Remove forced reinstall of numpy Removed forced reinstall of numpy version less than 2.0.0. --- colab/demo.ipynb | 1 - 1 file changed, 1 deletion(-) diff --git a/colab/demo.ipynb b/colab/demo.ipynb index bbb3557ab3..1a4602ab15 100644 --- a/colab/demo.ipynb +++ b/colab/demo.ipynb @@ -77,7 +77,6 @@ "!apt-get install python3-pip\n", "!python3 -m pip install --upgrade pip --user\n", "!sudo apt remove python3-blinker\n", - "!pip install --force-reinstall \"numpy<2.0.0\"" ] }, { From 438ff525c7ea8393b083ce78289e466feda77cd9 Mon Sep 17 00:00:00 2001 From: basebala Date: Tue, 7 Jul 2026 22:54:07 -0700 Subject: [PATCH 03/11] Fix pip install command for numpy version --- colab/demo.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/colab/demo.ipynb b/colab/demo.ipynb index 1a4602ab15..bbb3557ab3 100644 --- a/colab/demo.ipynb +++ b/colab/demo.ipynb @@ -77,6 +77,7 @@ "!apt-get install python3-pip\n", "!python3 -m pip install --upgrade pip --user\n", "!sudo apt remove python3-blinker\n", + "!pip install --force-reinstall \"numpy<2.0.0\"" ] }, { From 61b83576b4723f4111c4cf8874823b0b0c3eee57 Mon Sep 17 00:00:00 2001 From: basebala Date: Tue, 7 Jul 2026 22:55:13 -0700 Subject: [PATCH 04/11] Change error from array to float in test cases --- tests/process_data/test_process_images.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/process_data/test_process_images.py b/tests/process_data/test_process_images.py index b27346c68a..86f188d976 100644 --- a/tests/process_data/test_process_images.py +++ b/tests/process_data/test_process_images.py @@ -59,7 +59,7 @@ def test_process_images_skip_colmap(tmp_path: Path): id=1, xyz=np.array([0, 0, 0]), rgb=np.array([0, 0, 0]), - error=np.array([0]), + error=0.0, image_ids=np.array([1]), point2D_idxs=np.array([0]), ), @@ -144,7 +144,7 @@ def test_process_images_recursively_skip_colmap(tmp_path: Path): id=1, xyz=np.array([0, 0, 0]), rgb=np.array([0, 0, 0]), - error=np.array([0]), + error=0.0, image_ids=np.array([1]), point2D_idxs=np.array([0]), ), From 32be3d32447fb2fd23c59e35f91660e78d0e3f3d Mon Sep 17 00:00:00 2001 From: basebala Date: Wed, 8 Jul 2026 10:08:28 -0700 Subject: [PATCH 05/11] Upgrade pip and install 'wheel' in Dockerfile Added installation of 'wheel' package and upgraded 'setuptools' in Dockerfile. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6cd4e058f0..f98b635530 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,10 +81,11 @@ RUN git clone https://github.com/colmap/colmap.git && \ # Upgrade pip and install dependencies. # pip install torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cu118 && \ -RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' && \ +RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' 'wheel' && \ pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 'numpy<2.0.0' --extra-index-url https://download.pytorch.org/whl/cu118 && \ git clone --branch master --recursive https://github.com/cvg/Hierarchical-Localization.git /opt/hloc && \ cd /opt/hloc && git checkout v1.4 && python3.10 -m pip install --no-cache-dir . && cd ~ && \ + pip install --no-cache-dir --upgrade 'setuptools<70.0.0' 'wheel' && \ TCNN_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}" pip install --no-cache-dir "git+https://github.com/NVlabs/tiny-cuda-nn.git@b3473c81396fe927293bdfd5a6be32df8769927c#subdirectory=bindings/torch" && \ pip install --no-cache-dir pycolmap==0.6.1 pyceres==2.1 omegaconf==2.3.0 From 5e863070eaa61383eadb5d9d9779b2ed27cfacc8 Mon Sep 17 00:00:00 2001 From: basebala Date: Wed, 8 Jul 2026 16:38:06 -0700 Subject: [PATCH 06/11] Upgrade pip and install additional dependencies Updated pip installation commands to include 'packaging' and fixed formatting issues. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f98b635530..4b9bc6faf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,7 +81,7 @@ RUN git clone https://github.com/colmap/colmap.git && \ # Upgrade pip and install dependencies. # pip install torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cu118 && \ -RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' 'wheel' && \ +RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' 'wheel' 'packaging' && \ pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 'numpy<2.0.0' --extra-index-url https://download.pytorch.org/whl/cu118 && \ git clone --branch master --recursive https://github.com/cvg/Hierarchical-Localization.git /opt/hloc && \ cd /opt/hloc && git checkout v1.4 && python3.10 -m pip install --no-cache-dir . && cd ~ && \ From 7d6af608ed2db10b8b8216fdfd73d4fdb24ebc1e Mon Sep 17 00:00:00 2001 From: basebala Date: Wed, 8 Jul 2026 19:17:21 -0700 Subject: [PATCH 07/11] Refactor pip installation commands in Dockerfile Updated pip installation commands and dependencies in Dockerfile. --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b9bc6faf0..0b6451a80c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,12 +81,12 @@ RUN git clone https://github.com/colmap/colmap.git && \ # Upgrade pip and install dependencies. # pip install torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cu118 && \ -RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' 'wheel' 'packaging' && \ +RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ + pip install --no-cache-dir 'setuptools<70.0.0' && \ pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 'numpy<2.0.0' --extra-index-url https://download.pytorch.org/whl/cu118 && \ git clone --branch master --recursive https://github.com/cvg/Hierarchical-Localization.git /opt/hloc && \ cd /opt/hloc && git checkout v1.4 && python3.10 -m pip install --no-cache-dir . && cd ~ && \ - pip install --no-cache-dir --upgrade 'setuptools<70.0.0' 'wheel' && \ - TCNN_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}" pip install --no-cache-dir "git+https://github.com/NVlabs/tiny-cuda-nn.git@b3473c81396fe927293bdfd5a6be32df8769927c#subdirectory=bindings/torch" && \ + TCNN_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}" pip install --no-cache-dir --no-build-isolation "git+https://github.com/NVlabs/tiny-cuda-nn.git@b3473c81396fe927293bdfd5a6be32df8769927c#subdirectory=bindings/torch" && \ pip install --no-cache-dir pycolmap==0.6.1 pyceres==2.1 omegaconf==2.3.0 # Install gsplat and nerfstudio. @@ -98,6 +98,7 @@ RUN pip install --no-cache-dir --upgrade pip 'setuptools<70.0.0' 'wheel' 'packag COPY --from=source /tmp/nerfstudio/ /tmp/nerfstudio RUN export TORCH_CUDA_ARCH_LIST="$(echo "$CUDA_ARCHITECTURES" | tr ';' '\n' | awk '$0 > 70 {print substr($0,1,1)"."substr($0,2)}' | tr '\n' ' ' | sed 's/ $//')" && \ export MAX_JOBS=4 && \ + pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ GSPLAT_VERSION="$(sed -n 's/.*gsplat==\s*\([^," '"'"']*\).*/\1/p' /tmp/nerfstudio/pyproject.toml)" && \ pip install --no-cache-dir git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ pip install --no-cache-dir /tmp/nerfstudio 'numpy<2.0.0' && \ From 800e679b56a4030866ac5458c4b25bd0d01f9788 Mon Sep 17 00:00:00 2001 From: basebala Date: Wed, 8 Jul 2026 21:45:52 -0700 Subject: [PATCH 08/11] Add setuptools upgrade and additional pip installs Updated Dockerfile to install additional Python packages and upgrade setuptools. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 0b6451a80c..41e9f9064a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,6 +99,7 @@ COPY --from=source /tmp/nerfstudio/ /tmp/nerfstudio RUN export TORCH_CUDA_ARCH_LIST="$(echo "$CUDA_ARCHITECTURES" | tr ';' '\n' | awk '$0 > 70 {print substr($0,1,1)"."substr($0,2)}' | tr '\n' ' ' | sed 's/ $//')" && \ export MAX_JOBS=4 && \ pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ + pip install --upgrade setuptools && \ GSPLAT_VERSION="$(sed -n 's/.*gsplat==\s*\([^," '"'"']*\).*/\1/p' /tmp/nerfstudio/pyproject.toml)" && \ pip install --no-cache-dir git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ pip install --no-cache-dir /tmp/nerfstudio 'numpy<2.0.0' && \ From c947dbcacfd2f9931f6178a96a35504b3e7c5f98 Mon Sep 17 00:00:00 2001 From: basebala Date: Thu, 9 Jul 2026 09:53:43 -0700 Subject: [PATCH 09/11] Update pip install commands in Dockerfile Force reinstall torch and torchvision with specific versions. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 41e9f9064a..9794c9511a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,8 +98,8 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ COPY --from=source /tmp/nerfstudio/ /tmp/nerfstudio RUN export TORCH_CUDA_ARCH_LIST="$(echo "$CUDA_ARCHITECTURES" | tr ';' '\n' | awk '$0 > 70 {print substr($0,1,1)"."substr($0,2)}' | tr '\n' ' ' | sed 's/ $//')" && \ export MAX_JOBS=4 && \ - pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ pip install --upgrade setuptools && \ + pip install --no-cache-dir --force-reinstall torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ GSPLAT_VERSION="$(sed -n 's/.*gsplat==\s*\([^," '"'"']*\).*/\1/p' /tmp/nerfstudio/pyproject.toml)" && \ pip install --no-cache-dir git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ pip install --no-cache-dir /tmp/nerfstudio 'numpy<2.0.0' && \ From acc0ea18d7196fb1da2b875ab5f809ea5ab52b73 Mon Sep 17 00:00:00 2001 From: basebala Date: Thu, 9 Jul 2026 12:18:18 -0700 Subject: [PATCH 10/11] Update pip install command for gsplat --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9794c9511a..1e2b9e9289 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,7 +101,7 @@ RUN export TORCH_CUDA_ARCH_LIST="$(echo "$CUDA_ARCHITECTURES" | tr ';' '\n' | aw pip install --upgrade setuptools && \ pip install --no-cache-dir --force-reinstall torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ GSPLAT_VERSION="$(sed -n 's/.*gsplat==\s*\([^," '"'"']*\).*/\1/p' /tmp/nerfstudio/pyproject.toml)" && \ - pip install --no-cache-dir git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ + pip install --no-cache-dir --no-build-isolation git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ pip install --no-cache-dir /tmp/nerfstudio 'numpy<2.0.0' && \ rm -rf /tmp/nerfstudio From 1cdceb2901cc7c778b0b60e9b09a2aed7ee16a1b Mon Sep 17 00:00:00 2001 From: basebala Date: Thu, 9 Jul 2026 12:25:34 -0700 Subject: [PATCH 11/11] Optimize Dockerfile by removing duplicate pip install Removed redundant pip install command for torch and torchvision. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1e2b9e9289..be9e45cd18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,8 +98,8 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \ COPY --from=source /tmp/nerfstudio/ /tmp/nerfstudio RUN export TORCH_CUDA_ARCH_LIST="$(echo "$CUDA_ARCHITECTURES" | tr ';' '\n' | awk '$0 > 70 {print substr($0,1,1)"."substr($0,2)}' | tr '\n' ' ' | sed 's/ $//')" && \ export MAX_JOBS=4 && \ + pip install --no-cache-dir torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ pip install --upgrade setuptools && \ - pip install --no-cache-dir --force-reinstall torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 && \ GSPLAT_VERSION="$(sed -n 's/.*gsplat==\s*\([^," '"'"']*\).*/\1/p' /tmp/nerfstudio/pyproject.toml)" && \ pip install --no-cache-dir --no-build-isolation git+https://github.com/nerfstudio-project/gsplat.git@v${GSPLAT_VERSION} && \ pip install --no-cache-dir /tmp/nerfstudio 'numpy<2.0.0' && \