diff --git a/.vscode/launch.json b/.vscode/launch.json index 8b92b869d..935d7ae8b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -77,8 +77,8 @@ "--viewer.enable", "--viewer.zmq-url=tcp://127.0.0.1:6001", "--viewer.websocket-port=8014", - "--trainer.steps_per_save=1000000", - "--trainer.steps_per_test=1000000", + "--steps_per_save=1000000", + "--steps_per_test=1000000", "--pipeline.model.density-field-params.base-scale=4", "--pipeline.model.density-field-params.num-cascades=1", "pipeline.datamanager.train-dataparser:friends-data-parser-config", diff --git a/Dockerfile b/Dockerfile index 9cfcb77b6..c2e3ab82b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Define base image. -FROM nvidia/cudagl:11.3.1-devel +FROM nvidia/cuda:11.7.1-devel-ubuntu22.04 # Set environment variables. ## Set non-interactive to prevent asking for user inputs blocking image creation. @@ -11,7 +11,7 @@ ENV TCNN_CUDA_ARCHITECTURES=86 ## CUDA Home, required to find CUDA in some packages. ENV CUDA_HOME="/usr/local/cuda" -# Install required apt packages. +# Install required apt packages and clear cache afterwards. RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ @@ -36,10 +36,11 @@ RUN apt-get update && \ libsuitesparse-dev \ nano \ protobuf-compiler \ - python3.8-dev \ + python3.10-dev \ python3-pip \ qtbase5-dev \ - wget + wget && \ + rm -rf /var/lib/apt/lists/* # Install GLOG (required by ceres). RUN git clone --branch v0.6.0 https://github.com/google/glog.git --single-branch && \ @@ -50,7 +51,7 @@ RUN git clone --branch v0.6.0 https://github.com/google/glog.git --single-branch make -j && \ make install && \ cd ../.. && \ - rm -r glog + rm -rf glog # Add glog path to LD_LIBRARY_PATH. ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib" @@ -64,18 +65,19 @@ RUN git clone --branch 2.1.0 https://ceres-solver.googlesource.com/ceres-solver. make -j && \ make install && \ cd ../.. && \ - rm -r ceres-solver + rm -rf ceres-solver # Install colmap. RUN git clone --branch 3.7 https://github.com/colmap/colmap.git --single-branch && \ cd colmap && \ mkdir build && \ cd build && \ - cmake .. && \ + cmake .. -DCUDA_ENABLED=ON \ + -DCUDA_NVCC_FLAGS="--std c++14" && \ make -j && \ make install && \ cd ../.. && \ - rm -r colmap + rm -rf colmap # Create non root user and setup environment. RUN useradd -m -d /home/user -u 1000 user @@ -89,11 +91,11 @@ ENV PATH="${PATH}:/home/user/.local/bin" SHELL ["/bin/bash", "-c"] # Upgrade pip and install packages. -RUN python3.8 -m pip install --upgrade pip setuptools pathtools promise +RUN python3.10 -m pip install --upgrade pip setuptools pathtools promise # Install pytorch and submodules. -RUN python3.8 -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113 +RUN python3.10 -m pip install torch==1.12.1+cu116 torchvision==0.13.1+cu116 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu116 # Install tynyCUDNN. -RUN python3.8 -m pip install git+https://github.com/NVlabs/tiny-cuda-nn.git#subdirectory=bindings/torch +RUN python3.10 -m pip install git+https://github.com/NVlabs/tiny-cuda-nn.git#subdirectory=bindings/torch # Copy nerfstudio folder and give ownership to user. ADD . /home/user/nerfstudio @@ -103,7 +105,7 @@ USER 1000:1000 # Install nerfstudio dependencies. RUN cd nerfstudio && \ - python3.8 -m pip install -e . && \ + python3.10 -m pip install -e . && \ cd .. # Change working directory diff --git a/README.md b/README.md index edef31622..c4f346993 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ The following will train a _nerfacto_ model, our recommended model for real worl ```bash # Download some test data: -ns-download-data nerfstudio --capture-name=poster +ns-download-data --dataset nerfstudio --capture-name=poster # Train model ns-train nerfacto --data data/nerfstudio/poster ``` @@ -151,7 +151,7 @@ Navigating to the link at the end of the terminal will load the webviewer. If yo It is possible to load a pretrained model by running ```bash -ns-train nerfacto --data data/nerfstudio/poster --trainer.load-dir {outputs/.../nerfstudio_models} +ns-train nerfacto --data data/nerfstudio/poster --load-dir {outputs/.../nerfstudio_models} ``` This will automatically start training. If you do not want it to train, add `--viewer.start-train False` to your training command. @@ -245,7 +245,7 @@ If you're interested in learning more on how to create your own pipelines, devel # Supported Features -We provide the following support structures to make life easier for getting started with NeRFs. For a full description, please refer to our [features page](#). +We provide the following support structures to make life easier for getting started with NeRFs. **If you are looking for a feature that is not currently supported, please do not hesitate to contact the Nerfstudio Team on [Discord](https://discord.gg/uMbNqcraFc)!** diff --git a/colab/demo.ipynb b/colab/demo.ipynb index 9609a6db4..e92f8b04d 100644 --- a/colab/demo.ipynb +++ b/colab/demo.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open" + "\"Open" ] }, { @@ -65,23 +65,22 @@ "cell_type": "code", "execution_count": null, "metadata": { - "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, "id": "RGr33zHaHak0", - "outputId": "2641dce6-cd57-4d31-d8b1-860bc1adf17f" + "outputId": "6ad38334-22d2-4675-bffb-0bae91b17577" }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n", "📦 Installing...\n", "📌 Adjusting configuration...\n", "🩹 Patching environment...\n", - "⏲ Done in 0:00:27\n", + "⏲ Done in 0:00:18\n", "🔁 Restarting kernel...\n" ] } @@ -98,7 +97,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "cellView": "form", "id": "9oyLHl8QfYwP" }, "outputs": [], @@ -111,9 +109,8 @@ "\n", "# Installing TinyCuda\n", "%cd /content/\n", - "# !gdown \"https://drive.google.com/u/1/uc?id=1wglEFPbI4BjWMFYaKk7gHCNsWCZphKjs\" \n", - "# !pip install tinycudann-1.6-cp38-cp38-linux_x86_64.whl\n", - "!pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch\n", + "!gdown \"https://drive.google.com/u/0/uc?id=1mB3IxcpmTVmQN-So0t2lxjxbHvqWr2zf\" \n", + "!pip install tinycudann-1.5-cp38-cp38-linux_x86_64.whl\n", "\n", "# Installing COLMAP\n", "%cd /content/\n", @@ -122,7 +119,8 @@ "# Install nerfstudio\n", "%cd /content/\n", "# !pip install nerfstudio\n", - "!pip install git+https://github.com/nerfstudio-project/nerfstudio.git" + "!pip install git+https://github.com/nerfstudio-project/nerfstudio.git\n", + "!conda remove --force qt-main" ] }, { @@ -294,8 +292,9 @@ "if os.path.exists(f\"data/nerfstudio/{scene}/transforms.json\"):\n", " !ns-train nerfacto --viewer.websocket-port 7007 nerfstudio-data --data data/nerfstudio/$scene --downscale-factor 4\n", "else:\n", - " display(HTML('

Error: Data processing did not complete

'))\n", - " display(HTML('

Please re-run `Downloading and Processing Data`, or view the FAQ for more info.

'))" + " import IPython\n", + " display(IPython.display.HTML('

Error: Data processing did not complete

'))\n", + " display(IPython.display.HTML('

Please re-run `Downloading and Processing Data`, or view the FAQ for more info.

'))" ] }, { diff --git a/docs/nerfology/model_components/visualize_cameras.ipynb b/docs/nerfology/model_components/visualize_cameras.ipynb index 0ae46b222..99bb095a0 100644 --- a/docs/nerfology/model_components/visualize_cameras.ipynb +++ b/docs/nerfology/model_components/visualize_cameras.ipynb @@ -56,13 +56,99 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 2, "metadata": { "tags": [ "hide-input" ] }, "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, { "data": { "application/vnd.plotly.v1+json": { @@ -13736,9 +13822,9 @@ } }, "text/html": [ - "