Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nerfstudio #3399

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.8"
version: "3.9"

services:
nerfstudio:
Expand All @@ -25,4 +25,4 @@ services:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
capabilities: [ gpu ]
10 changes: 5 additions & 5 deletions .github/workflows/core_code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8.13
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.9.13
uses: actions/setup-python@v5
with:
python-version: '3.8.13'
- uses: actions/cache@v2
python-version: '3.9.13'
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: '3.10'
- name: Install dependencies
run: |
pip install uv
Expand All @@ -25,7 +25,7 @@ jobs:
run: |
sphinx-build docs _build -W --keep-going
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install build twine
Expand Down
43 changes: 20 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG CUDA_VERSION=11.8.0
ARG OS_VERSION=22.04
ARG CUDA_VERSION=12.4.0
ARG OS_VERSION=24.04
# Define base image.
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${OS_VERSION}
ARG CUDA_VERSION
Expand Down Expand Up @@ -67,9 +67,10 @@ RUN apt-get update && \
wget && \
rm -rf /var/lib/apt/lists/*

RUN pip3 install build wheel

# Install GLOG (required by ceres).
RUN git clone --branch v0.6.0 https://github.com/google/glog.git --single-branch && \
RUN git clone --branch v0.7.1 https://github.com/google/glog.git --single-branch && \
cd glog && \
mkdir build && \
cd build && \
Expand All @@ -82,7 +83,7 @@ RUN git clone --branch v0.6.0 https://github.com/google/glog.git --single-branch
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

# Install Ceres-solver (required by colmap).
RUN git clone --branch 2.1.0 https://ceres-solver.googlesource.com/ceres-solver.git --single-branch && \
RUN git clone --branch 2.2.0 https://ceres-solver.googlesource.com/ceres-solver.git --single-branch && \
cd ceres-solver && \
git checkout $(git describe --tags) && \
mkdir build && \
Expand All @@ -94,14 +95,16 @@ RUN git clone --branch 2.1.0 https://ceres-solver.googlesource.com/ceres-solver.
rm -rf ceres-solver

# Install colmap.
RUN git clone --branch 3.8 https://github.com/colmap/colmap.git --single-branch && \
RUN git clone --branch 3.10 https://github.com/colmap/colmap.git --single-branch && \
cd colmap && \
mkdir build && \
cd build && \
cmake .. -DCUDA_ENABLED=ON \
-DCMAKE_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES} && \
make -j `nproc` && \
make install && \
cd colmap/pycolmap && \
pip3 wheel . -w dist/ && pip3 install dist/pycolmap-*.whl
cd ../.. && \
rm -rf colmap

Expand All @@ -127,45 +130,39 @@ WORKDIR /home/${USERNAME}
ENV PATH="${PATH}:/home/${USERNAME}/.local/bin"

# Upgrade pip and install packages.
RUN python3.10 -m pip install --no-cache-dir --upgrade pip setuptools==69.5.1 pathtools promise pybind11 omegaconf
RUN python3.10 -m pip install --no-cache-dir --upgrade pip setuptools==74.0.0 pathtools promise pybind11 omegaconf

# Install pytorch and submodules
# echo "${CUDA_VERSION}" | sed 's/.$//' | tr -d '.' -- CUDA_VERSION -> delete last digit -> delete all '.'
RUN CUDA_VER=$(echo "${CUDA_VERSION}" | sed 's/.$//' | tr -d '.') && python3.10 -m pip install --no-cache-dir \
torch==2.1.2+cu${CUDA_VER} \
torchvision==0.16.2+cu${CUDA_VER} \
torch==2.4.0+cu${CUDA_VER} \
torchvision==0.19.0+cu${CUDA_VER} \
--extra-index-url https://download.pytorch.org/whl/cu${CUDA_VER}

# Install tiny-cuda-nn (we need to set the target architectures as environment variable first).
ENV TCNN_CUDA_ARCHITECTURES=${CUDA_ARCHITECTURES}
RUN python3.10 -m pip install --no-cache-dir git+https://github.com/NVlabs/tiny-cuda-nn.git#subdirectory=bindings/torch

# Install pycolmap, required by hloc.
RUN git clone --branch v0.4.0 --recursive https://github.com/colmap/pycolmap.git && \
cd pycolmap && \
python3.10 -m pip install --no-cache-dir . && \
cd ..

# Install hloc 1.4 as alternative feature detector and matcher option for nerfstudio.
RUN git clone --branch master --recursive https://github.com/cvg/Hierarchical-Localization.git && \
cd Hierarchical-Localization && \
git checkout v1.4 && \
python3.10 -m pip install --no-cache-dir -e . && \
pip3 wheel --no-deps --use-feature=fast-deps . -w dist/ && pip3 install dist/hloc-*.whl && \
cd ..

# Install pyceres from source
RUN git clone --branch v1.0 --recursive https://github.com/cvg/pyceres.git && \
RUN git clone --branch v2.3 --recursive https://github.com/cvg/pyceres.git && \
cd pyceres && \
python3.10 -m pip install --no-cache-dir -e . && \
cd ..

# Install pixel perfect sfm.
RUN git clone --recursive https://github.com/cvg/pixel-perfect-sfm.git && \
cd pixel-perfect-sfm && \
git reset --hard 40f7c1339328b2a0c7cf71f76623fb848e0c0357 && \
git clean -df && \
python3.10 -m pip install --no-cache-dir -e . && \
cd ..
# it is still upgrading: https://github.com/cvg/pixel-perfect-sfm/pull/138
# RUN git clone --recursive https://github.com/cvg/pixel-perfect-sfm.git && \
# cd pixel-perfect-sfm && \
# git reset --hard 40f7c1339328b2a0c7cf71f76623fb848e0c0357 && \
# git clean -df && \
# python3.10 -m pip install --no-cache-dir -e . && \
# cd ..

# Copy nerfstudio folder and give ownership to user.
COPY --chown=${USER_UID}:${USER_GID} . /home/${USERNAME}/nerfstudio
Expand Down
16 changes: 8 additions & 8 deletions pixi.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "nerfstudio"
description = "All-in-one repository for state-of-the-art NeRFs"
channels = ["nvidia/label/cuda-11.8.0", "nvidia", "conda-forge", "pytorch"]
channels = ["nvidia/label/cuda-12.4.0", "nvidia", "conda-forge", "pytorch"]
platforms = ["linux-64"]

[system-requirements]
Expand All @@ -21,14 +21,14 @@ train-example-nerf = {cmd="ns-train nerfacto --data data/nerfstudio/dozer/", dep


[dependencies]
python = ">=3.8,<3.11"
python = ">=3.8,<3.12"
pip = ">=24.0,<25"
cuda = {version = "*", channel="nvidia/label/cuda-11.8.0"}
pytorch-cuda = {version = "11.8.*", channel="pytorch"}
pytorch = {version = ">=2.2.0,<2.3", channel="pytorch"}
torchvision = {version = ">=0.17.0,<0.18", channel="pytorch"}
pyarrow = ">=15.0.2,<15.1"
colmap = ">=3.9.1,<3.10"
cuda = {version = "*", channel="nvidia/label/cuda-12.4.0"}
pytorch-cuda = {version = "12.4.*", channel="pytorch"}
pytorch = {version = ">=2.2.0,<2.5", channel="pytorch"}
torchvision = {version = ">=0.17.0,<0.20", channel="pytorch"}
pyarrow = ">=15.0.2,<18.0.0"
colmap = ">=3.9.1,<3.11"


[pypi-dependencies]
Expand Down
48 changes: 24 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=74.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "nerfstudio"
version = "1.1.4"
version = "1.1.5"
description = "All-in-one repository for state-of-the-art NeRFs"
readme = "README.md"
license = { text="Apache 2.0"}
Expand All @@ -31,15 +31,15 @@ dependencies = [
"mediapy>=1.1.0",
"msgpack>=1.0.4",
"msgpack_numpy>=0.4.8",
"nerfacc==0.5.2",
"nerfacc==0.5.3",
"open3d>=0.16.0",
"opencv-python-headless==4.10.0.84",
"Pillow>=10.3.0",
"plotly>=5.7.0",
"protobuf<=3.20.3,!=3.20.0",
"protobuf>=3.20.3",
# TODO(1480) enable when pycolmap windows wheels are available
# "pycolmap==0.3.0",
"pymeshlab>=2022.2.post2; platform_machine != 'arm64' and platform_machine != 'aarch64'",
"pymeshlab>=2022.2.post2; platform_machine != 'arm64'",
"pyngrok>=5.1.0",
"python-socketio>=5.7.1",
"pyquaternion>=0.9.9",
Expand All @@ -50,7 +50,7 @@ dependencies = [
"requests",
"rich>=12.5.1",
"scikit-image>=0.19.3",
"splines==0.3.0",
"splines==0.3.2",
"tensorboard>=2.13.0",
"torch>=1.13.1",
"torchvision>=0.14.1",
Expand All @@ -61,8 +61,8 @@ dependencies = [
"wandb>=0.13.3",
"xatlas",
"trimesh>=3.20.2",
"timm==0.6.7",
"gsplat==1.0.0",
"timm==1.0.9",
"gsplat==1.3.0",
"pytorch-msssim",
"pathos",
"packaging",
Expand All @@ -78,33 +78,33 @@ dependencies = [

# Generative related dependencies
gen = [
"diffusers==0.16.1",
"transformers==4.29.2",
"accelerate==0.19.0",
"bitsandbytes==0.39.0",
"sentencepiece==0.1.99",
"diffusers==0.30.2",
"transformers==4.44.2",
"accelerate==0.33.0",
"bitsandbytes==0.43.3",
"sentencepiece==0.2.0",
]


# Development packages
dev = [
"pre-commit==3.3.2",
"pytest==7.1.2",
"pytest-xdist==2.5.0",
"typeguard==2.13.3",
"pre-commit==3.8.0",
"pytest==8.3.2",
"pytest-xdist==3.6.1",
"typeguard==4.3.0",
"ruff>=0.6.1",
"sshconf==0.2.5",
"pycolmap>=0.3.0", # NOTE: pycolmap==0.3.0 is not available on newer python versions
"diffusers==0.16.1",
"sshconf==0.2.7",
"pycolmap>=3.10.0", # NOTE: pycolmap==0.3.0 is not available on newer python versions
"diffusers==0.30.2",
"opencv-stubs==0.0.7",
"transformers==4.29.2",
"pyright==1.1.331",
"transformers==4.44.2",
"pyright==1.1.378",
# NOTE: Disabling projectaria-tools because it doesn't have prebuilt windows wheels
# Syntax comes from here: https://pip.pypa.io/en/stable/reference/requirement-specifiers/
"projectaria-tools>=1.3.1; sys_platform != 'win32'",
# pin torch to <=2.1 to fix https://github.com/pytorch/pytorch/issues/118736
"torch>=1.13.1,<2.2",
"awscli==1.33.18"
"torch>=1.13.1,<2.5",
"awscli==1.34.10"
]

# Documentation related packages
Expand Down
Loading