diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index 5cbf79cc37..c0e23cf172 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.8" +version: "3.9" services: nerfstudio: @@ -25,4 +25,4 @@ services: devices: - driver: nvidia count: 1 - capabilities: [ gpu ] \ No newline at end of file + capabilities: [ gpu ] diff --git a/.github/workflows/core_code_checks.yml b/.github/workflows/core_code_checks.yml index 35ed0f1ca5..bbfead9a24 100644 --- a/.github/workflows/core_code_checks.yml +++ b/.github/workflows/core_code_checks.yml @@ -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') }} diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index d2637429ca..81bf553ef0 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b75984535a..5118abb949 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index f1b29ea7aa..fca4e13977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 && \ @@ -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 && \ @@ -94,7 +95,7 @@ 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 && \ @@ -102,6 +103,8 @@ RUN git clone --branch 3.8 https://github.com/colmap/colmap.git --single-branch -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 @@ -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 diff --git a/pixi.toml b/pixi.toml index ad2eee6aec..1be506ca1a 100644 --- a/pixi.toml +++ b/pixi.toml @@ -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] @@ -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] diff --git a/pyproject.toml b/pyproject.toml index 027ef13744..1ba670f563 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"} @@ -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", @@ -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", @@ -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", @@ -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