diff --git a/.vscode/launch.json b/.vscode/launch.json
index 8719fd8a1..6e4dc7c4a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -97,17 +97,10 @@
"name": "Python: NeuS on Replica",
"type": "python",
"request": "launch",
-<<<<<<< HEAD
- "program": "scripts/train.py",
- "console": "integratedTerminal",
- "justMyCode": false,
- "env": {"CUDA_VISIBLE_DEVICES":"0"},
-=======
"program": "nerfstudio/scripts/train.py",
"console": "integratedTerminal",
"justMyCode": false,
"env": { "CUDA_VISIBLE_DEVICES": "0" },
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
"args": [
"neus",
"--pipeline.model.sdf-field.inside-outside=True",
@@ -119,8 +112,6 @@
"--include_mono_prior=True"
]
},
-<<<<<<< HEAD
-=======
{
"name": "Python: NeuS-facto on Replica",
"type": "python",
@@ -158,6 +149,5 @@
"--auto-orient=True"
]
}
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
]
}
diff --git a/README.md b/README.md
index 2ce5b3b07..15f8dfa46 100644
--- a/README.md
+++ b/README.md
@@ -204,18 +204,6 @@ ns-export pointcloud --help
Using an existing dataset is great, but likely you want to use your own data! We support various methods for using your own data. Before it can be used in nerfstudio, the camera location and orientations must be determined and then converted into our format using `ns-process-data`. We rely on external tools for this, instructions and information can be found in the documentation.
-<<<<<<< HEAD
-| Data | Capture Device | Requirements | `ns-process-data` Speed |
-| ------------------------------------------------------------------------------------------------- | -------------- | ----------------------------------------------- | ----------------------- |
-| 📷 [Images](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#images-and-video) | Any | [COLMAP](https://colmap.github.io/install.html) | 🐢 |
-| 📹 [Video](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#images-and-video) | Any | [COLMAP](https://colmap.github.io/install.html) | 🐢 |
-| 🌎 [360 Data](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#360_data) | Any | [COLMAP](https://colmap.github.io/install.html) | 🐢 |
-| 📱 [Polycam](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#polycam-capture) | IOS with LiDAR | [Polycam App](https://poly.cam/) | 🐇 |
-| 📱 [KIRI Engine](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#kiri-capture) | IOS or Android | [KIRI Engine App](https://www.kiriengine.com/) | 🐇 |
-| 📱 [Record3D](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#record3d-capture) | IOS with LiDAR | [Record3D app](https://record3d.app/) | 🐇 |
-| 🖥 [Metashape](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#metashape) | Any | [Metashape](https://www.agisoft.com/) | 🐇 |
-| 🛠 [Custom](https://docs.nerf.studio/en/latest/quickstart/data_conventions.html) | Any | Camera Poses | 🐇 |
-=======
| Data | Capture Device | Requirements | `ns-process-data` Speed |
| ---------------------------------------------------------------------------------------------------- | -------------- | ----------------------------------------------------------------- | ----------------------- |
| 📷 [Images](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#images-and-video) | Any | [COLMAP](https://colmap.github.io/install.html) | 🐢 |
@@ -227,7 +215,6 @@ Using an existing dataset is great, but likely you want to use your own data! We
| 🖥 [Metashape](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#metashape) | Any | [Metashape](https://www.agisoft.com/) | 🐇 |
| 🖥 [RealityCapture](https://docs.nerf.studio/en/latest/quickstart/custom_dataset.html#realitycapture) | Any | [RealityCapture](https://www.capturingreality.com/realitycapture) | 🐇 |
| 🛠 [Custom](https://docs.nerf.studio/en/latest/quickstart/data_conventions.html) | Any | Camera Poses | 🐇 |
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
## 5. Advanced Options
diff --git a/colab/demo.ipynb b/colab/demo.ipynb
index 0bce8b064..541b9d741 100644
--- a/colab/demo.ipynb
+++ b/colab/demo.ipynb
@@ -7,11 +7,7 @@
"colab_type": "text"
},
"source": [
-<<<<<<< HEAD
- ""
-=======
"
"
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
]
},
{
diff --git a/docs/nerfology/model_components/visualize_samplers.ipynb b/docs/nerfology/model_components/visualize_samplers.ipynb
index 05ffbe926..a91c754e2 100644
--- a/docs/nerfology/model_components/visualize_samplers.ipynb
+++ b/docs/nerfology/model_components/visualize_samplers.ipynb
@@ -1,7442 +1,4 @@
{
-<<<<<<< HEAD
- "cells": [
- {
- "attachments": {},
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Ray Samplers\n",
- "\n",
- "## Overview\n",
- "\n",
- "Once we have a set of cameras, we want to cast camera rays associated with each pixel. \n",
- "\n",
- "Along these ray we will sample the _field_ and aggregate the samples to predict the pixels value (ie. color). The parameterization of the samples are described [here](./visualize_samples.ipynb) however we must decide where to place these samples along a ray. For this task we will use a [`Sampler`](../../reference/api/model_components/ray_sampler.rst).\n",
- "\n",
- "In the ideal world we would compute many dense samples along a ray. Unfortunatly each additional sample adds a computation cost to the system as it needs to be processed by the _field_ which is often a neural network. \n",
- "\n",
- "As a result it is common for NeRF methods to use on the order of 100 samples. Therefore we want to optimize where those samples are placed in the scene.\n",
- "\n",
- "For example, if the sene can be bounded by a box and the objects are all similar scales, uniform sampling along the ray may be a good option. On the other hand if the scene is unbounded (potential extending as far as the the eye can see) uniform sampling does not make sense as the samples would be very sparse for close objects. In this case a different sampling like _Uniform in Disparity_ may perform better.\n",
- "\n",
- "```{image} imgs/samplers_type-light.png\n",
- ":align: center\n",
- ":class: only-light\n",
- "```\n",
- "\n",
- "```{image} imgs/samplers_type-dark.png\n",
- ":align: center\n",
- ":class: only-dark\n",
- "```\n",
- "\n",
- "### Stratified Sampling\n",
- "\n",
- "Most samplers has the option to _stratify_ the samplers. When stratified, each sample is randomly perturbed. \n",
- "\n",
- "The magnitude of the pertubation is such that the sample ordering remains consistent and the overal distribution statistics are not changed. Using stratified samples during training generally improves the reconstructions as it help prevent overfitting. \n",
- "\n",
- "During inference stratified sampling should be disabled (nerfstudio samplers will do this) as it can cause noisy artifacts when the camera moves.\n",
- "\n",
- "```{image} imgs/samplers_stratified-light.png\n",
- ":align: center\n",
- ":class: only-light\n",
- "```\n",
- "\n",
- "```{image} imgs/samplers_stratified-dark.png\n",
- ":align: center\n",
- ":class: only-dark\n",
- "```\n",
- "\n",
- "### Hierarchical Sampling\n",
- "\n",
- "It is important to sample the scene where it has content otherwise the reconstruction quality will be reduced. \n",
- "\n",
- "One trick that is often employed in NeRF methods is to do multiple round of sampling. The first round can use a predefined sampler (ie. Uniform) to generate an image. Once the space is sampled, we have an idea which samples contributed to the final color. \n",
- "\n",
- "We can use this information to sample more around those regions using a `PDFSampler`. The PDF sampler is described more below."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Spaced Samplers\n",
- "\n",
- "These are the most basic samplers that spaces samples based on a predefined function. These samplers have all have a starting and ending distance (also known as a near/far plane). The plots below are histograms of points sampled from some predefined samplers. \n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {
- "tags": [
- "hide-input"
- ]
- },
- "outputs": [
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "3e6b9d9b42cb4dc89f40a570007d00ec",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Output()"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "
-<<<<<<< HEAD
-This obscene mesh of human is obviously not helpful in training a nerf so we can remove it by cropping the bottom 20% of the image. This can be done by using the `--crop-factor 0 0.2 0 0` argument.
-=======
The pixels representing the distorted hand and head are obviously not useful in training a nerf so we can remove it by cropping the bottom 20% of the image. This can be done by using the `--crop-factor 0 0.2 0 0` argument.
If cropping only needs to be done from the bottom, you can use the `--crop-bottom [num]` argument which would be the same as doing `--crop-factor 0.0 [num] 0.0 0.0`
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
diff --git a/nerfstudio/cameras/rays.py b/nerfstudio/cameras/rays.py
index 0eee58ba5..61746187c 100644
--- a/nerfstudio/cameras/rays.py
+++ b/nerfstudio/cameras/rays.py
@@ -57,11 +57,7 @@ class Frustums(TensorDataclass):
return pos
def get_start_positions(self) -> TensorType[..., 3]:
-<<<<<<< HEAD
- """Calulates "start" position of frustum.
-=======
"""Calculates "start" position of frustum.
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
Returns:
xyz positions.
diff --git a/nerfstudio/configs/base_config.py b/nerfstudio/configs/base_config.py
index 22c149441..2a76c325c 100644
--- a/nerfstudio/configs/base_config.py
+++ b/nerfstudio/configs/base_config.py
@@ -21,11 +21,7 @@ from __future__ import annotations
import warnings
from dataclasses import dataclass
from pathlib import Path
-<<<<<<< HEAD
-from typing import Any, List, Optional, Tuple, Type
-=======
from typing import Any, List, Literal, Optional, Tuple, Type
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
# model instances
from nerfstudio.utils import writer
@@ -148,10 +144,7 @@ class ViewerConfig(PrintableConfig):
actually used in training/evaluation. If -1, display all."""
quit_on_train_completion: bool = False
"""Whether to kill the training job when it has completed. Note this will stop rendering in the viewer."""
-<<<<<<< HEAD
-=======
image_format: Literal["jpeg", "png"] = "jpeg"
"""Image format viewer should use; jpeg is lossy compression, while png is lossless."""
jpeg_quality: int = 90
"""Quality tradeoff to use for jpeg compression."""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
diff --git a/nerfstudio/data/datamanagers/base_datamanager.py b/nerfstudio/data/datamanagers/base_datamanager.py
index 4d4f88dae..beb41cf39 100644
--- a/nerfstudio/data/datamanagers/base_datamanager.py
+++ b/nerfstudio/data/datamanagers/base_datamanager.py
@@ -414,10 +414,7 @@ class VanillaDataManager(DataManager, Generic[TDataset]): # pylint: disable=abs
else:
self.config.data = self.config.dataparser.data
self.dataparser = self.dataparser_config.setup()
-<<<<<<< HEAD
-=======
self.includes_time = self.dataparser.includes_time
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
self.train_dataparser_outputs = self.dataparser.get_dataparser_outputs(split="train")
self.train_dataset = self.create_train_dataset()
diff --git a/nerfstudio/data/dataparsers/nerfstudio_dataparser.py b/nerfstudio/data/dataparsers/nerfstudio_dataparser.py
index d88bf46e7..d1f19c7fc 100644
--- a/nerfstudio/data/dataparsers/nerfstudio_dataparser.py
+++ b/nerfstudio/data/dataparsers/nerfstudio_dataparser.py
@@ -45,11 +45,7 @@ class NerfstudioDataParserConfig(DataParserConfig):
_target: Type = field(default_factory=lambda: Nerfstudio)
"""target class to instantiate"""
-<<<<<<< HEAD
- data: Path = Path("data/nerfstudio")
-=======
data: Path = Path()
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
"""Directory or explicit json file path specifying location of data."""
scale_factor: float = 1.0
"""How much to scale the camera origins by."""
diff --git a/nerfstudio/engine/schedulers.py b/nerfstudio/engine/schedulers.py
index a67e2c697..68a459389 100644
--- a/nerfstudio/engine/schedulers.py
+++ b/nerfstudio/engine/schedulers.py
@@ -138,11 +138,7 @@ class ExponentialDecayScheduler(Scheduler):
@dataclass
class CosineDecaySchedulerConfig(SchedulerConfig):
-<<<<<<< HEAD
- """Basic scheduler config with self-defined exponential decay schedule"""
-=======
"""Config for cosine decay schedule"""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
_target: Type = field(default_factory=lambda: CosineDecayScheduler)
"""target class to instantiate"""
@@ -155,11 +151,7 @@ class CosineDecaySchedulerConfig(SchedulerConfig):
class CosineDecayScheduler(Scheduler):
-<<<<<<< HEAD
- """Starts with a flat lr schedule until it reaches N epochs then applies a given scheduler"""
-=======
"""Cosine decay scheduler with linear warmup"""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
config: CosineDecaySchedulerConfig
diff --git a/nerfstudio/fields/instant_ngp_field.py b/nerfstudio/fields/instant_ngp_field.py
index e8917423d..e205c73f0 100644
--- a/nerfstudio/fields/instant_ngp_field.py
+++ b/nerfstudio/fields/instant_ngp_field.py
@@ -29,13 +29,10 @@ from nerfstudio.data.scene_box import SceneBox
from nerfstudio.field_components.activations import trunc_exp
from nerfstudio.field_components.embedding import Embedding
from nerfstudio.field_components.field_heads import FieldHeadNames
-<<<<<<< HEAD
-=======
from nerfstudio.field_components.spatial_distortions import (
SceneContraction,
SpatialDistortion,
)
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
from nerfstudio.fields.base_field import Field, shift_directions_for_tcnn
try:
@@ -78,10 +75,7 @@ class TCNNInstantNGPField(Field):
num_levels: int = 16,
log2_hashmap_size: int = 19,
max_res: int = 2048,
-<<<<<<< HEAD
-=======
spatial_distortion: Optional[SpatialDistortion] = SceneContraction(),
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
) -> None:
super().__init__()
@@ -97,12 +91,8 @@ class TCNNInstantNGPField(Field):
# TODO: set this properly based on the aabb
base_res: int = 16
-<<<<<<< HEAD
- per_level_scale = np.exp((np.log(max_res) - np.log(base_res)) / (num_levels - 1))
-=======
features_per_level: int = 2
growth_factor = np.exp((np.log(max_res) - np.log(base_res)) / (num_levels - 1))
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
self.direction_encoding = tcnn.Encoding(
n_input_dims=3,
@@ -121,11 +111,7 @@ class TCNNInstantNGPField(Field):
"n_features_per_level": features_per_level,
"log2_hashmap_size": log2_hashmap_size,
"base_resolution": base_res,
-<<<<<<< HEAD
- "per_level_scale": per_level_scale,
-=======
"per_level_scale": growth_factor,
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
},
network_config={
"otype": "FullyFusedMLP",
@@ -176,10 +162,7 @@ class TCNNInstantNGPField(Field):
def get_outputs(
self, ray_samples: RaySamples, density_embedding: Optional[TensorType] = None
) -> Dict[FieldHeadNames, TensorType]:
-<<<<<<< HEAD
-=======
assert density_embedding is not None
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
directions = shift_directions_for_tcnn(ray_samples.frustums.directions)
directions_flat = directions.view(-1, 3)
d = self.direction_encoding(directions_flat)
diff --git a/nerfstudio/fields/nerfplayer_ngp_field.py b/nerfstudio/fields/nerfplayer_ngp_field.py
index 914a59820..bbf7b72e6 100644
--- a/nerfstudio/fields/nerfplayer_ngp_field.py
+++ b/nerfstudio/fields/nerfplayer_ngp_field.py
@@ -174,10 +174,7 @@ class NerfplayerNGPField(Field):
def get_outputs(
self, ray_samples: RaySamples, density_embedding: Optional[TensorType] = None
) -> Dict[FieldHeadNames, TensorType]:
-<<<<<<< HEAD
-=======
assert density_embedding is not None
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
directions = shift_directions_for_tcnn(ray_samples.frustums.directions)
directions_flat = directions.view(-1, 3)
diff --git a/nerfstudio/fields/sdf_field.py b/nerfstudio/fields/sdf_field.py
index 2a67ef30e..72244a759 100644
--- a/nerfstudio/fields/sdf_field.py
+++ b/nerfstudio/fields/sdf_field.py
@@ -18,11 +18,7 @@ a signed distance function (SDF) for surface representation is used to help with
"""
from dataclasses import dataclass, field
-<<<<<<< HEAD
-from typing import Dict, Optional, Type
-=======
from typing import Dict, Literal, Optional, Type
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
import numpy as np
import torch
@@ -30,10 +26,6 @@ import torch.nn.functional as F
from torch import nn
from torch.nn.parameter import Parameter
from torchtyping import TensorType
-<<<<<<< HEAD
-from typing_extensions import Literal
-=======
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
from nerfstudio.cameras.rays import RaySamples
from nerfstudio.field_components.embedding import Embedding
@@ -87,15 +79,6 @@ class SDFFieldConfig(FieldConfig):
appearance_embedding_dim: int = 32
"""Dimension of appearance embedding"""
use_appearance_embedding: bool = False
-<<<<<<< HEAD
- """Dimension of appearance embedding"""
- bias: float = 0.8
- """sphere size of geometric initializaion"""
- geometric_init: bool = True
- """Whether to use geometric initialization"""
- inside_outside: bool = True
- """whether to revert signed distance value, set to True for indoor scene"""
-=======
"""Whether to use appearance embedding"""
bias: float = 0.8
"""Sphere size of geometric initialization"""
@@ -103,7 +86,6 @@ class SDFFieldConfig(FieldConfig):
"""Whether to use geometric initialization"""
inside_outside: bool = True
"""Whether to revert signed distance value, set to True for indoor scene"""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
weight_norm: bool = True
"""Whether to use weight norm for linear layer"""
use_grid_feature: bool = False
@@ -274,13 +256,8 @@ class SDFField(Field):
"""forward the geonetwork"""
if self.use_grid_feature:
positions = self.spatial_distortion(inputs)
-<<<<<<< HEAD
-
- positions = (positions + 1.0) / 2.0
-=======
# map range [-2, 2] to [0, 1]
positions = (positions + 2.0) / 4.0
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
feature = self.encoding(positions)
else:
feature = torch.zeros_like(inputs[:, :1].repeat(1, self.encoding.n_output_dims))
diff --git a/nerfstudio/model_components/ray_samplers.py b/nerfstudio/model_components/ray_samplers.py
index 39a5c0047..b0464e4c9 100644
--- a/nerfstudio/model_components/ray_samplers.py
+++ b/nerfstudio/model_components/ray_samplers.py
@@ -645,10 +645,7 @@ class NeuSSampler(Sampler):
# Start with uniform sampling
if ray_samples is None:
ray_samples = self.uniform_sampler(ray_bundle, num_samples=self.num_samples)
-<<<<<<< HEAD
-=======
assert ray_samples is not None
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
total_iters = 0
sorted_index = None
@@ -657,10 +654,6 @@ class NeuSSampler(Sampler):
base_variance = self.base_variance
while total_iters < self.num_upsample_steps:
-<<<<<<< HEAD
-
-=======
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
with torch.no_grad():
new_sdf = sdf_fn(new_samples)
@@ -708,10 +701,7 @@ class NeuSSampler(Sampler):
"""
batch_size = ray_samples.shape[0]
prev_sdf, next_sdf = sdf[:, :-1], sdf[:, 1:]
-<<<<<<< HEAD
-=======
assert ray_samples.deltas is not None
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
deltas = ray_samples.deltas[:, :-1, 0]
mid_sdf = (prev_sdf + next_sdf) * 0.5
cos_val = (next_sdf - prev_sdf) / (deltas + 1e-5)
@@ -753,12 +743,9 @@ class NeuSSampler(Sampler):
ray_samples_2 : ray_samples to merge
"""
-<<<<<<< HEAD
-=======
assert ray_samples_1.spacing_starts is not None and ray_samples_2.spacing_starts is not None
assert ray_samples_1.spacing_ends is not None and ray_samples_2.spacing_ends is not None
assert ray_samples_1.spacing_to_euclidean_fn is not None
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
starts_1 = ray_samples_1.spacing_starts[..., 0]
starts_2 = ray_samples_2.spacing_starts[..., 0]
diff --git a/nerfstudio/models/base_surface_model.py b/nerfstudio/models/base_surface_model.py
index a6a1d8384..857f712ee 100644
--- a/nerfstudio/models/base_surface_model.py
+++ b/nerfstudio/models/base_surface_model.py
@@ -20,11 +20,7 @@ from __future__ import annotations
from abc import abstractmethod
from dataclasses import dataclass, field
-<<<<<<< HEAD
-from typing import Dict, List, Tuple, Type
-=======
from typing import Dict, List, Literal, Tuple, Type
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
import torch
import torch.nn.functional as F
@@ -32,10 +28,6 @@ from torch.nn import Parameter
from torchmetrics import PeakSignalNoiseRatio
from torchmetrics.functional import structural_similarity_index_measure
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
-<<<<<<< HEAD
-from typing_extensions import Literal
-=======
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
from nerfstudio.cameras.rays import RayBundle
from nerfstudio.field_components.encodings import NeRFEncoding
diff --git a/nerfstudio/models/instant_ngp.py b/nerfstudio/models/instant_ngp.py
index 079ae10e0..f9e89cec3 100644
--- a/nerfstudio/models/instant_ngp.py
+++ b/nerfstudio/models/instant_ngp.py
@@ -62,22 +62,14 @@ class InstantNGPModelConfig(ModelConfig):
"""Instant NGP doesn't use a collider."""
grid_resolution: int = 128
"""Resolution of the grid used for the field."""
-<<<<<<< HEAD
-=======
grid_levels: int = 4
"""Levels of the grid used for the field."""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
max_res: int = 2048
"""Maximum resolution of the hashmap for the base mlp."""
log2_hashmap_size: int = 19
"""Size of the hashmap for the base mlp"""
-<<<<<<< HEAD
- contraction_type: ContractionType = ContractionType.UN_BOUNDED_SPHERE
- """Contraction type used for spatial deformation of the field."""
-=======
alpha_thre: float = 0.01
"""Threshold for opacity skipping."""
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
cone_angle: float = 0.004
"""Should be set to 0.0 for blender scenes but 1./256 for real scenes."""
render_step_size: Optional[float] = None
@@ -121,10 +113,7 @@ class NGPModel(Model):
num_images=self.num_train_data,
log2_hashmap_size=self.config.log2_hashmap_size,
max_res=self.config.max_res,
-<<<<<<< HEAD
-=======
spatial_distortion=scene_contraction,
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
)
self.scene_aabb = Parameter(self.scene_box.aabb.flatten(), requires_grad=False)
diff --git a/nerfstudio/pipelines/base_pipeline.py b/nerfstudio/pipelines/base_pipeline.py
index 22a45dfd3..8c9d59257 100644
--- a/nerfstudio/pipelines/base_pipeline.py
+++ b/nerfstudio/pipelines/base_pipeline.py
@@ -95,11 +95,8 @@ class Pipeline(nn.Module):
datamanager: DataManager
_model: Model
-<<<<<<< HEAD
generative: bool
-=======
world_size: int
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
@property
def model(self):
@@ -112,9 +109,6 @@ class Pipeline(nn.Module):
return self.model.device
def load_state_dict(self, state_dict: Mapping[str, Any], strict: bool = True):
-<<<<<<< HEAD
- model_state = {key[len("_model.") :]: value for key, value in state_dict.items() if key.startswith("_model.")}
-=======
is_ddp_model_state = True
model_state = {}
for key, value in state_dict.items():
@@ -129,7 +123,6 @@ class Pipeline(nn.Module):
if is_ddp_model_state:
model_state = {key[len("module.") :]: value for key, value in model_state.items()}
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
pipeline_state = {key: value for key, value in state_dict.items() if not key.startswith("_model.")}
self.model.load_state_dict(model_state, strict=strict)
super().load_state_dict(pipeline_state, strict=False)
@@ -400,11 +393,7 @@ class VanillaPipeline(Pipeline):
state = {
(key[len("module.") :] if key.startswith("module.") else key): value for key, value in loaded_state.items()
}
-<<<<<<< HEAD
- self._model.update_to_step(step)
-=======
self.model.update_to_step(step)
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
self.load_state_dict(state, strict=True)
def get_training_callbacks(
diff --git a/nerfstudio/pipelines/dynamic_batch.py b/nerfstudio/pipelines/dynamic_batch.py
index cddfa7841..6cd2a2b55 100644
--- a/nerfstudio/pipelines/dynamic_batch.py
+++ b/nerfstudio/pipelines/dynamic_batch.py
@@ -17,17 +17,9 @@ A pipeline that dynamically chooses the number of rays to sample.
"""
from dataclasses import dataclass, field
-<<<<<<< HEAD
-from typing import Optional, Type
-
-import torch
-from torch.cuda.amp.grad_scaler import GradScaler
-from typing_extensions import Literal
-=======
from typing import Literal, Type
import torch
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
from nerfstudio.data.datamanagers.base_datamanager import VanillaDataManager
from nerfstudio.pipelines.base_pipeline import VanillaPipeline, VanillaPipelineConfig
diff --git a/nerfstudio/process_data/hloc_utils.py b/nerfstudio/process_data/hloc_utils.py
index 90354c3bc..eda02cae1 100644
--- a/nerfstudio/process_data/hloc_utils.py
+++ b/nerfstudio/process_data/hloc_utils.py
@@ -117,9 +117,6 @@ def run_hloc(
camera_model=camera_model.value
)
if refine_pixsfm:
-<<<<<<< HEAD
- sfm = PixSfM({"dense_features": {"max_edge": 1024}})
-=======
sfm = PixSfM(
conf={
"dense_features": {"use_cache": True},
@@ -127,7 +124,6 @@ def run_hloc(
"BA": {"strategy": "costmaps"},
}
)
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
refined, _ = sfm.reconstruction(
sfm_dir,
image_dir,
diff --git a/nerfstudio/process_data/process_data_utils.py b/nerfstudio/process_data/process_data_utils.py
index b47562ca5..74a981826 100644
--- a/nerfstudio/process_data/process_data_utils.py
+++ b/nerfstudio/process_data/process_data_utils.py
@@ -158,18 +158,12 @@ def convert_video_to_images(
spacing = num_frames // num_frames_target
if spacing > 1:
ffmpeg_cmd += f" -vf thumbnail={spacing},setpts=N/TB{crop_cmd} -r 1"
-<<<<<<< HEAD
- else:
- CONSOLE.print("[bold red]Can't satisfy requested number of frames. Extracting all frames.")
- ffmpeg_cmd += f" -pix_fmt bgr8 -vf {crop_cmd[1:]}"
-=======
CONSOLE.print("Number of frames to extract:", math.ceil(num_frames / spacing))
else:
CONSOLE.print("[bold red]Can't satisfy requested number of frames. Extracting all frames.")
ffmpeg_cmd += " -pix_fmt bgr8"
if crop_cmd != "":
ffmpeg_cmd += f" -vf {crop_cmd[1:]}"
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
ffmpeg_cmd += f" {out_filename}"
run_command(ffmpeg_cmd, verbose=verbose)
diff --git a/nerfstudio/viewer/app/package.json b/nerfstudio/viewer/app/package.json
index 4d159c41e..def16e3e9 100644
--- a/nerfstudio/viewer/app/package.json
+++ b/nerfstudio/viewer/app/package.json
@@ -1,11 +1,7 @@
{
"name": "viewer",
"homepage": ".",
-<<<<<<< HEAD
- "version": "23-03-9-0",
-=======
"version": "23-05-01-0",
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
"private": true,
"dependencies": {
"@emotion/react": "^11.10.4",
diff --git a/nerfstudio/viewer/app/src/index.scss b/nerfstudio/viewer/app/src/index.scss
index acdfbdcd2..83e09b372 100644
--- a/nerfstudio/viewer/app/src/index.scss
+++ b/nerfstudio/viewer/app/src/index.scss
@@ -359,10 +359,6 @@ $sidebar-width: 100% !default;
border: $custom-border;
}
-<<<<<<< HEAD
-.RenderWindow {
- z-index: 1;
-=======
#not-connected-overlay {
position: absolute;
background-color: #1d222a;
@@ -389,7 +385,6 @@ $sidebar-width: 100% !default;
color: #ff6969;
font-size: 18px;
z-index: 10;
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
}
.ViewerWindow-render-crop-container {
diff --git a/nerfstudio/viewer/app/src/modules/ConfigPanel/ConfigPanel.jsx b/nerfstudio/viewer/app/src/modules/ConfigPanel/ConfigPanel.jsx
index f7a2392e7..60460339d 100644
--- a/nerfstudio/viewer/app/src/modules/ConfigPanel/ConfigPanel.jsx
+++ b/nerfstudio/viewer/app/src/modules/ConfigPanel/ConfigPanel.jsx
@@ -149,338 +149,4 @@ export function RenderControls() {
);
-<<<<<<< HEAD
- const outputChoice = useSelector(
- (state) => state.renderingState.output_choice,
- );
- const colormapOptions = useSelector(
- (state) => state.renderingState.colormap_options,
- );
- const colormapChoice = useSelector(
- (state) => state.renderingState.colormap_choice,
- );
- const colormapInvert = useSelector(
- (state) => state.renderingState.colormap_invert,
- );
- const colormapNormalize = useSelector(
- (state) => state.renderingState.colormap_normalize,
- );
- const max_resolution = useSelector(
- (state) => state.renderingState.maxResolution,
- );
- const target_train_util = useSelector(
- (state) => state.renderingState.targetTrainUtil,
- );
- const render_time = useSelector((state) => state.renderingState.renderTime);
- const crop_enabled = useSelector(
- (state) => state.renderingState.crop_enabled,
- );
-
- const crop_bg_color = useSelector(
- (state) => state.renderingState.crop_bg_color,
- );
-
- const crop_scale = useSelector((state) => state.renderingState.crop_scale);
-
- const crop_center = useSelector((state) => state.renderingState.crop_center);
-
- const generative_prompt = useSelector((state) => state.renderingState.cur_prompt);
-
- const dispatch = useDispatch();
-
- const [display_render_time, set_display_render_time] = useState(false);
- const [display_generative_prompt, set_display_generative_prompt] = useState(false);
-
- const receive_generative_prompt = (e) => {
- const msg = msgpack.decode(new Uint8Array(e.data));
- if (msg.path === '/model/is_generative') {
- set_display_generative_prompt(msg.data === 'true');
- websocket.removeEventListener('message', receive_generative_prompt);
- }
- };
- websocket.addEventListener('message', receive_generative_prompt);
-
- const receive_temporal_dist = (e) => {
- const msg = msgpack.decode(new Uint8Array(e.data));
- if (msg.path === '/model/has_temporal_distortion') {
- set_display_render_time(msg.data === 'true');
- websocket.removeEventListener('message', receive_temporal_dist);
- }
- };
- websocket.addEventListener('message', receive_temporal_dist);
-
- const [, setControls] = useControls(
- () => ({
- // training speed
- SpeedButtonGroup: buttonGroup({
- label: `Train Speed`,
- hint: 'Select the training speed, affects viewer render quality, not final render quality',
- opts: {
- Fast: () =>
- setControls({ target_train_util: 0.9, max_resolution: 512 }),
- Balanced: () =>
- setControls({ target_train_util: 0.7, max_resolution: 1024 }),
- Slow: () =>
- setControls({ target_train_util: 0.1, max_resolution: 2048 }),
- },
- }),
- // output_options
- output_options: {
- label: 'Output Render',
- options: [...new Set(outputOptions)],
- value: outputChoice,
- hint: 'Select the output to render',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/output_choice',
- v,
- );
- },
- },
- // colormap_options
- colormap_options: {
- label: 'Colormap',
- options: colormapOptions,
- value: colormapChoice,
- hint: 'Select the colormap to use',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/colormap_choice',
- v,
- );
- },
- disabled: colormapOptions.length === 1,
- },
- colormap_invert: {
- label: '| Invert',
- value: colormapInvert,
- hint: 'Invert the colormap',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/colormap_invert',
- v,
- );
- },
- render: (get) => get('colormap_options') !== 'default',
- },
- colormap_normalize: {
- label: '| Normalize',
- value: colormapNormalize,
- hint: 'Whether to normalize output between 0 and 1',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/colormap_normalize',
- v,
- );
- },
- render: (get) => get('colormap_options') !== 'default',
- },
- colormap_range: {
- label: '| Range',
- value: [0, 1],
- step: 0.01,
- min: -2,
- max: 5,
- hint: 'Min and max values of the colormap',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/colormap_range',
- v,
- );
- },
- render: (get) => get('colormap_options') !== 'default',
- },
- // Dynamic Resolution
- target_train_util: {
- label: 'Train Util.',
- value: target_train_util,
- min: 0,
- max: 1,
- step: 0.05,
- hint: "Target training utilization, 0.0 is slow, 1.0 is fast, doesn't affect final render quality",
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/targetTrainUtil',
- v,
- );
- },
- },
- // resolution
- max_resolution: {
- label: 'Max Res.',
- value: max_resolution,
- min: 256,
- max: 2048,
- step: 1,
- hint: 'Maximum resolution to render in viewport',
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/maxResolution',
- v,
- );
- },
- },
- ' ': buttonGroup({
- '256px': () => setControls({ max_resolution: 256 }),
- '512px': () => setControls({ max_resolution: 512 }),
- '1024px': () => setControls({ max_resolution: 1024 }),
- '2048px': () => setControls({ max_resolution: 2048 }),
- }),
- // Enable Crop
- crop_enabled: {
- label: 'Crop Viewport',
- value: crop_enabled,
- hint: 'Crop the viewport to the selected box',
- onChange: (value) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/crop_enabled',
- value,
- );
- },
- },
- crop_bg_color: {
- label: '| Background Color',
- value: crop_bg_color,
- render: (get) => get('crop_enabled'),
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/crop_bg_color',
- v,
- );
- },
- },
- crop_scale: {
- label: '| Scale',
- value: crop_scale,
- min: 0,
- max: 10,
- step: 0.05,
- render: (get) => get('crop_enabled'),
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/crop_scale',
- v,
- );
- },
- },
- crop_center: {
- label: '| Center',
- value: crop_center,
- min: -10,
- max: 10,
- step: 0.05,
- render: (get) => get('crop_enabled'),
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/crop_center',
- v,
- );
- },
- },
- // Dreamfusion prompt editing
- ...(display_generative_prompt
- ? {
- generative_prompt: {
- label: 'Dreamfusion Prompt',
- // value: "test string",
- value: generative_prompt,
- hint: 'Prompt used to guide Dreamfusion training',
- onChange: (value) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/new_prompt',
- value,
- );
- },
- },
- }
- : {}),
- // Dynamic NeRF rendering time
- ...(display_render_time
- ? {
- render_time: {
- label: 'Render Timestep',
- value: render_time,
- min: 0,
- max: 1,
- step: 0.01,
- onChange: (v) => {
- dispatch_and_send(
- websocket,
- dispatch,
- 'renderingState/render_time',
- v,
- );
- },
- },
- }
- : {}),
- }),
- [
- outputOptions,
- outputChoice,
- colormapOptions,
- colormapChoice,
- max_resolution,
- crop_enabled,
- target_train_util,
- display_generative_prompt,
- generative_prompt,
- render_time,
- display_render_time,
- websocket, // need to re-render when websocket changes to use the new websocket
- ],
- );
-
- useEffect(() => {
- setControls({ max_resolution });
- setControls({ output_options: outputChoice });
- setControls({ colormap_options: colormapChoice });
- setControls({ crop_enabled });
- setControls({ crop_bg_color });
- setControls({ crop_scale });
- setControls({ crop_center });
- }, [
- setControls,
- outputOptions,
- outputChoice,
- colormapOptions,
- colormapChoice,
- max_resolution,
- target_train_util,
- render_time,
- crop_enabled,
- crop_bg_color,
- crop_scale,
- crop_center,
- display_generative_prompt,
- display_render_time,
- ]);
-
- return null;
-=======
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
}
diff --git a/nerfstudio/viewer/app/src/modules/SidePanel/StatusPanel/StatusPanel.jsx b/nerfstudio/viewer/app/src/modules/SidePanel/StatusPanel/StatusPanel.jsx
index d89cb8eeb..8c70863c8 100644
--- a/nerfstudio/viewer/app/src/modules/SidePanel/StatusPanel/StatusPanel.jsx
+++ b/nerfstudio/viewer/app/src/modules/SidePanel/StatusPanel/StatusPanel.jsx
@@ -27,10 +27,7 @@ export default function StatusPanel(props: StatusPanelProps) {
const isWebsocketConnected = useSelector(
(state) => state.websocketState.isConnected,
);
-<<<<<<< HEAD
-=======
const step = useSelector((state) => state.renderingState.step);
->>>>>>> b1ddb9e695b789fae47e0f760a5c7f59f25af0bb
const eval_res = useSelector((state) => state.renderingState.eval_res);
const camera_choice = useSelector(
(state) => state.renderingState.camera_choice,
@@ -77,15 +74,6 @@ export default function StatusPanel(props: StatusPanelProps) {
training_state: new_state,
});
};
-<<<<<<< HEAD
- const is_training_text = isTraining ? 'Pause Training' : 'Resume Training';
- const training_icon = isTraining ?