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..d4c29ce9c 100644 --- a/README.md +++ b/README.md @@ -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. @@ -162,9 +162,9 @@ Once you have a NeRF model you can either render out a video or export a point c ### Render Video -First we must create a path for the camera to follow. This can be done in the viewer under the "RENDER" tab. Orient your 3D view to the location where you wish the video to start, then press "ADD CAMERA". This will set the first camera key frame. Continue to new viewpoints adding additional cameras to create the camera path. We provide other parameters to further refine your camera path. Once satisfied, press "RENDER" which will display a modal that contains the command needed to render the video. Kill the training job (or create a new terminal if you have lots of compute) and the command to generate the video. +First we must create a path for the camera to follow. This can be done in the viewer under the "RENDER" tab. Orient your 3D view to the location where you wish the video to start, then press "ADD CAMERA". This will set the first camera key frame. Continue to new viewpoints adding additional cameras to create the camera path. We provide other parameters to further refine your camera path. Once satisfied, press "RENDER" which will display a modal that contains the command needed to render the video. Kill the training job (or create a new terminal if you have lots of compute) and run the command to generate the video. -Other video export options are available, learn more by running, +Other video export options are available, learn more by running ```bash ns-render --help @@ -174,7 +174,7 @@ ns-render --help While NeRF models are not designed to generate point clouds, it is still possible. Navigate to the "EXPORT" tab in the 3D viewer and select "POINT CLOUD". If the crop option is selected, everything in the yellow square will be exported into a point cloud. Modify the settings as desired then run the command at the bottom of the panel in your command line. -Alternatively you can use the CLI without the viewer. Learn about the export options by running, +Alternatively you can use the CLI without the viewer. Learn about the export options by running ```bash ns-export pointcloud --help @@ -198,7 +198,7 @@ Using an existing dataset is great, but likely you want to use your own data! We ### Training models other than nerfacto -We provide other models than nerfacto, for example if you want to train the original nerf model, use the following command, +We provide other models than nerfacto, for example if you want to train the original nerf model, use the following command ```bash ns-train vanilla-nerf --data DATA_PATH @@ -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 148da3b88..e92f8b04d 100644 --- a/colab/demo.ipynb +++ b/colab/demo.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open" + "\"Open" ] }, { @@ -63,9 +63,8 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { - "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, @@ -98,7 +97,6 @@ "cell_type": "code", "execution_count": null, "metadata": { - "cellView": "form", "id": "9oyLHl8QfYwP" }, "outputs": [], @@ -121,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" ] }, { @@ -293,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/developer_guides/pipelines/datamanagers.md b/docs/developer_guides/pipelines/datamanagers.md index eb361c209..bbe3413d9 100644 --- a/docs/developer_guides/pipelines/datamanagers.md +++ b/docs/developer_guides/pipelines/datamanagers.md @@ -34,7 +34,7 @@ class DataManager(nn.Module): """Returns the next eval image. Returns: - The image index from the eval datset, the CameraRayBundle, and the RayGT dictionary. + The image index from the eval dataset, the CameraRayBundle, and the RayGT dictionary. """ ``` diff --git a/docs/developer_guides/pipelines/dataparsers.md b/docs/developer_guides/pipelines/dataparsers.md index 458abdeb5..40ef7f4fd 100644 --- a/docs/developer_guides/pipelines/dataparsers.md +++ b/docs/developer_guides/pipelines/dataparsers.md @@ -103,7 +103,7 @@ dataparser_outputs = dataparser.get_dataparser_outputs(split="train") input_dataset = InputDataset(dataparser_outputs) ``` -You can also pull out information from the DataParserOutputs for other DataMangager componenets, such as the RayGenerator. The RayGenerator generates RayBundle objects from camera and pixel indices. +You can also pull out information from the DataParserOutputs for other DataMangager components, such as the RayGenerator. The RayGenerator generates RayBundle objects from camera and pixel indices. ```python ray_generator = RayGenerator(dataparser_outputs.cameras) diff --git a/docs/developer_guides/pipelines/fields.md b/docs/developer_guides/pipelines/fields.md index f4c9c6d2e..5533db49b 100644 --- a/docs/developer_guides/pipelines/fields.md +++ b/docs/developer_guides/pipelines/fields.md @@ -56,7 +56,7 @@ class Field(nn.Module): The forward function is the main function you'll use, which takes in RaySamples returns quantities for each sample. You'll notice that the get_density function is called for every field, followed by the get_outputs function. -The get_outputs function is what you need to implement to return custom data. For example, check out of SemanticNerfField where we rely on different FieldHeads to produce correct dimensional outputs for typical quantiites. Our implemented FieldHeads have the following FieldHeadNames names. +The get_outputs function is what you need to implement to return custom data. For example, check out of SemanticNerfField where we rely on different FieldHeads to produce correct dimensional outputs for typical quantities. Our implemented FieldHeads have the following FieldHeadNames names. ```python class FieldHeadNames(Enum): diff --git a/docs/index.md b/docs/index.md index ae2270986..53d45784d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -52,6 +52,7 @@ quickstart/custom_dataset quickstart/viewer_quickstart quickstart/export_geometry quickstart/data_conventions +quickstart/blender_addon Contributing ``` diff --git a/docs/nerfology/model_components/index.md b/docs/nerfology/model_components/index.md index e3619d89e..513826edd 100644 --- a/docs/nerfology/model_components/index.md +++ b/docs/nerfology/model_components/index.md @@ -1,6 +1,6 @@ # Model components -It can be difficult getting started with NeRFs. The reserach field is still quite new and most of the key nuggets are burried in academic papers. For this reason, we have consoladated many of the key concepts into a series of guides. +It can be difficult getting started with NeRFs. The research field is still quite new and most of the key nuggets are buried in academic papers. For this reason, we have consolidated many of the key concepts into a series of guides. ```{toctree} :maxdepth: 1 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": [ - "