From 6d51af1a24d692d073a9e0cda06278b6a9d44818 Mon Sep 17 00:00:00 2001 From: Brent Yi Date: Wed, 16 Aug 2023 08:15:35 +0900 Subject: [PATCH 1/6] viser 0.1.0, fix type checker errors (#2343) * Pin to viser 0.1.0, fix type checker errors * gui_folder => add_gui_folder --- nerfstudio/viewer_beta/control_panel.py | 10 +++++----- nerfstudio/viewer_beta/viewer_elements.py | 10 +++++----- pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/nerfstudio/viewer_beta/control_panel.py b/nerfstudio/viewer_beta/control_panel.py index ea0492eb2..a56d4bb74 100644 --- a/nerfstudio/viewer_beta/control_panel.py +++ b/nerfstudio/viewer_beta/control_panel.py @@ -141,31 +141,31 @@ class ControlPanel: self.add_element(self._train_speed) self.add_element(self._train_util) - with self.viser_server.gui_folder("Render Options"): + with self.viser_server.add_gui_folder("Render Options"): self.add_element(self._max_res) self.add_element(self._output_render) self.add_element(self._colormap) # colormap options - with self.viser_server.gui_folder(" "): + with self.viser_server.add_gui_folder(" "): self.add_element(self._invert, additional_tags=("colormap",)) self.add_element(self._normalize, additional_tags=("colormap",)) self.add_element(self._min, additional_tags=("colormap",)) self.add_element(self._max, additional_tags=("colormap",)) # split options - with self.viser_server.gui_folder("Split Screen"): + with self.viser_server.add_gui_folder("Split Screen"): self.add_element(self._split) self.add_element(self._split_percentage, additional_tags=("split",)) self.add_element(self._split_output_render, additional_tags=("split",)) self.add_element(self._split_colormap, additional_tags=("split",)) - with self.viser_server.gui_folder(" "): + with self.viser_server.add_gui_folder(" "): self.add_element(self._split_invert, additional_tags=("split_colormap",)) self.add_element(self._split_normalize, additional_tags=("split_colormap",)) self.add_element(self._split_min, additional_tags=("split_colormap",)) self.add_element(self._split_max, additional_tags=("split_colormap",)) - with self.viser_server.gui_folder("Crop Viewport"): + with self.viser_server.add_gui_folder("Crop Viewport"): self.add_element(self._crop_viewport) # Crop options diff --git a/nerfstudio/viewer_beta/viewer_elements.py b/nerfstudio/viewer_beta/viewer_elements.py index 5c49ec8ae..f9fe0e071 100644 --- a/nerfstudio/viewer_beta/viewer_elements.py +++ b/nerfstudio/viewer_beta/viewer_elements.py @@ -26,7 +26,7 @@ from viser import ( GuiButtonGroupHandle, GuiButtonHandle, GuiDropdownHandle, - GuiHandle, + GuiInputHandle, ViserServer, ) @@ -49,14 +49,14 @@ class ViewerElement(Generic[TValue]): cb_hook: Callable = lambda element: None, ) -> None: self.name = name - self.gui_handle: Optional[Union[GuiHandle[TValue], GuiButtonHandle, GuiButtonGroupHandle]] = None + self.gui_handle: Optional[Union[GuiInputHandle[TValue], GuiButtonHandle, GuiButtonGroupHandle]] = None self.disabled = disabled self.cb_hook = cb_hook @abstractmethod def _create_gui_handle(self, viser_server: ViserServer) -> None: """ - Returns the GuiHandle object which actually controls the parameter in the gui. + Returns the GuiInputHandle object which actually controls the parameter in the gui. Args: viser_server: The server to install the gui element into. @@ -100,7 +100,7 @@ class ViewerButton(ViewerElement[bool]): super().__init__(name, disabled=disabled, cb_hook=cb_hook) def _create_gui_handle(self, viser_server: ViserServer) -> None: - self.gui_handle = viser_server.add_gui_button(name=self.name, disabled=self.disabled) + self.gui_handle = viser_server.add_gui_button(self.name, disabled=self.disabled) def install(self, viser_server: ViserServer) -> None: self._create_gui_handle(viser_server) @@ -119,7 +119,7 @@ class ViewerParameter(ViewerElement[TValue], Generic[TValue]): cb_hook: Callback to call on update """ - gui_handle: GuiHandle + gui_handle: GuiInputHandle def __init__( self, diff --git a/pyproject.toml b/pyproject.toml index 61e04bc1e..8b3bce86d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ dependencies = [ "torchvision>=0.14.1", "torchmetrics[image]>=1.0.1", "typing_extensions>=4.4.0", - "viser>=0.0.12", + "viser==0.1.0", "nuscenes-devkit>=1.1.1", "wandb>=0.13.3", "xatlas", From 9cd957f77609880db0f19f4aeee8efceb107307d Mon Sep 17 00:00:00 2001 From: Sasha Sax Date: Thu, 17 Aug 2023 11:04:51 -0700 Subject: [PATCH 2/6] Update pixel_samplers.py (#2327) * Update pixel_samplers.py Now uses the specified batch_size param in sample_method() * black --------- Co-authored-by: Matthew Tancik --- nerfstudio/data/pixel_samplers.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/nerfstudio/data/pixel_samplers.py b/nerfstudio/data/pixel_samplers.py index d58f7d5a5..30b33bf23 100644 --- a/nerfstudio/data/pixel_samplers.py +++ b/nerfstudio/data/pixel_samplers.py @@ -392,7 +392,7 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods # overrides base method def sample_method( # pylint: disable=no-self-use self, - batch_size: int, + batch_size: Optional[int], num_images: int, image_height: int, image_width: int, @@ -405,18 +405,25 @@ class PairPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods chosen_indices = random.sample(range(len(nonzero_indices)), k=self.rays_to_sample) indices = nonzero_indices[chosen_indices] else: - s = (self.rays_to_sample, 1) + rays_to_sample = self.rays_to_sample + if batch_size is not None: + assert ( + int(batch_size) % 2 == 0 + ), f"PairPixelSampler can only return batch sizes in multiples of two (got {batch_size})" + rays_to_sample = batch_size // 2 + + s = (rays_to_sample, 1) ns = torch.randint(0, num_images, s, dtype=torch.long, device=device) hs = torch.randint(self.radius, image_height - self.radius, s, dtype=torch.long, device=device) ws = torch.randint(self.radius, image_width - self.radius, s, dtype=torch.long, device=device) indices = torch.concat((ns, hs, ws), dim=1) - pair_indices = torch.hstack( - ( - torch.zeros(self.rays_to_sample, 1, device=device, dtype=torch.long), - torch.randint(-self.radius, self.radius, (self.rays_to_sample, 2), device=device, dtype=torch.long), + pair_indices = torch.hstack( + ( + torch.zeros(rays_to_sample, 1, device=device, dtype=torch.long), + torch.randint(-self.radius, self.radius, (rays_to_sample, 2), device=device, dtype=torch.long), + ) ) - ) - pair_indices += indices - indices = torch.hstack((indices, pair_indices)).view(self.rays_to_sample * 2, 3) + pair_indices += indices + indices = torch.hstack((indices, pair_indices)).view(rays_to_sample * 2, 3) return indices From 61548ceba1af598a552710d8c4a6feb22645b7e1 Mon Sep 17 00:00:00 2001 From: Matthew Tancik Date: Thu, 17 Aug 2023 11:59:04 -0700 Subject: [PATCH 3/6] v0.3.3 (#2349) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b3bce86d..7a3b599ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "nerfstudio" -version = "0.3.2" +version = "0.3.3" description = "All-in-one repository for state-of-the-art NeRFs" readme = "README.md" license = { text="Apache 2.0"} From 1b430590c85e0e1951f640b43c0ddd65093f632f Mon Sep 17 00:00:00 2001 From: Ethan Weber Date: Thu, 17 Aug 2023 20:40:53 -0700 Subject: [PATCH 4/6] Nerfstudio Feedback Form (#2351) * nerfstudio feedback form with a url placeholder * text change * updating feedback form url * adding another url --- README.md | 3 +++ docs/index.md | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fc7eba77..aa5825a23 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,8 @@ We are committed to providing learning resources to help you understand the basi Have feature requests? Want to add your brand-spankin'-new NeRF model? Have a new dataset? **We welcome [contributions](https://docs.nerf.studio/en/latest/reference/contributing.html)!** Please do not hesitate to reach out to the nerfstudio team with any questions via [Discord](https://discord.gg/uMbNqcraFc). +Have feedback? We'd love for you to fill out our [Nerfstudio Feedback Form](https://forms.gle/sqN5phJN7LfQVwnP9) if you want to let us know who you are, why you are interested in Nerfstudio, or provide any feedback! + We hope nerfstudio enables you to build faster :hammer: learn together :books: and contribute to our NeRF community :sparkling_heart:. ## Sponsors @@ -298,6 +300,7 @@ If you're interested in learning more on how to create your own pipelines, devel | 💖 **Community** | | [Discord](https://discord.gg/uMbNqcraFc) | Join our community to discuss more. We would love to hear from you! | | [Twitter](https://twitter.com/nerfstudioteam) | Follow us on Twitter @nerfstudioteam to see cool updates and announcements | +| [Feedback Form](TODO) | We welcome any feedback! This is our chance to learn what you all are using Nerfstudio for. | # Supported Features diff --git a/docs/index.md b/docs/index.md index 860abad54..9e294c3ac 100644 --- a/docs/index.md +++ b/docs/index.md @@ -67,9 +67,11 @@ Nerfstudio initially launched as an opensource project by Berkeley students in [ We are committed to providing learning resources to help you understand the basics of (if you're just getting started), and keep up-to-date with (if you're a seasoned veteran) all things NeRF. As researchers, we know just how hard it is to get onboarded with this next-gen technology. So we're here to help with tutorials, documentation, and more! -Finally, have feature requests? Want to add your brand-spankin'-new NeRF model? Have a new dataset? **We welcome [contributions](reference/contributing)!** +Have feature requests? Want to add your brand-spankin'-new NeRF model? Have a new dataset? **We welcome [contributions](reference/contributing)!** Please do not hesitate to reach out to the nerfstudio team with any questions via [Discord](https://discord.gg/uMbNqcraFc). +Have feedback? We'd love for you to fill out our [Nerfstudio Feedback Form](https://forms.gle/sqN5phJN7LfQVwnP9) if you want to let us know who you are, why you are interested in Nerfstudio, or provide any feedback! + We hope nerfstudio enables you to build faster 🔨 learn together 📚 and contribute to our NeRF community 💖. ## Contents @@ -159,6 +161,7 @@ This documentation is organized into 3 parts: | [Github](https://github.com/nerfstudio-project/nerfstudio) | Official Github Repo | | [Discord](https://discord.gg/RyVk6w5WWP) | Join Discord Community | | [Viewer](https://viewer.nerf.studio/) | Web-based Nerf Viewer | +| [Feedback Form](https://forms.gle/sqN5phJN7LfQVwnP9) | Provide Nerfstudio Feedback | ## Sponsors Sponsors of this work includes [Luma AI](https://lumalabs.ai/) and the [BAIR commons](https://bcommons.berkeley.edu/home). From cba8d22d3bed8b1458ec552195aef5c28c7cee97 Mon Sep 17 00:00:00 2001 From: James Gardner Date: Fri, 18 Aug 2023 17:01:50 +0100 Subject: [PATCH 5/6] Optimizers.scheduler_step() bug fix (#2352) optimizer bug fix --- nerfstudio/engine/optimizers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/engine/optimizers.py b/nerfstudio/engine/optimizers.py index 3e147dcdc..b80b77bcb 100644 --- a/nerfstudio/engine/optimizers.py +++ b/nerfstudio/engine/optimizers.py @@ -108,7 +108,7 @@ class Optimizers: Args: param_group_name: name of scheduler to step forward """ - if self.config.param_group_name.scheduler: # type: ignore + if "scheduler" in self.config[param_group_name]: self.schedulers[param_group_name].step() def zero_grad_all(self) -> None: From 9315cad5f5eefbc8f9c3f456315f81284977661b Mon Sep 17 00:00:00 2001 From: Ethan Weber Date: Sat, 19 Aug 2023 13:48:28 -0700 Subject: [PATCH 6/6] Switching Nerfstudio Dataset data to GDrive URLs (#2358) * switch urls to gdrive * added comment with explicit link to gdrive url --- nerfstudio/scripts/downloads/download_data.py | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/nerfstudio/scripts/downloads/download_data.py b/nerfstudio/scripts/downloads/download_data.py index 0bf9039d1..04ccadc86 100644 --- a/nerfstudio/scripts/downloads/download_data.py +++ b/nerfstudio/scripts/downloads/download_data.py @@ -121,16 +121,22 @@ nerfstudio_file_ids = { "redwoods2": grab_file_id("https://drive.google.com/file/d/1rg-4NoXT8p6vkmbWxMOY6PSG4j3rfcJ8/view?usp=sharing"), "storefront": grab_file_id("https://drive.google.com/file/d/16b792AguPZWDA_YC4igKCwXJqW0Tb21o/view?usp=sharing"), "vegetation": grab_file_id("https://drive.google.com/file/d/1wBhLQ2odycrtU39y2akVurXEAt9SsVI3/view?usp=sharing"), - "Egypt": "https://data.nerf.studio/nerfstudio/Egypt.zip", - "person": "https://data.nerf.studio/nerfstudio/person.zip", - "kitchen": "https://data.nerf.studio/nerfstudio/kitchen.zip", - "plane": "https://data.nerf.studio/nerfstudio/plane.zip", - "dozer": "https://data.nerf.studio/nerfstudio/dozer.zip", - "floating-tree": "https://data.nerf.studio/nerfstudio/floating-tree.zip", - "aspen": "https://data.nerf.studio/nerfstudio/aspen.zip", - "stump": "https://data.nerf.studio/nerfstudio/stump.zip", - "sculpture": "https://data.nerf.studio/nerfstudio/sculpture.zip", - "Giannini-Hall": "https://data.nerf.studio/nerfstudio/Giannini-Hall.zip", + "Egypt": grab_file_id("https://drive.google.com/file/d/1YktD85afw7uitC3nPamusk0vcBdAfjlF/view?view?usp=sharing"), + "person": grab_file_id("https://drive.google.com/file/d/1HsGMwkPu-R7oU7ySMdoo6Eppq8pKhHF3/view?view?usp=sharing"), + "kitchen": grab_file_id("https://drive.google.com/file/d/1IRmNyNZSNFidyj93Tt5DtaEU9h6eJdi1/view?view?usp=sharing"), + "plane": grab_file_id("https://drive.google.com/file/d/1tnv2NC2Iwz4XRYNtziUWvLJjObkZNo2D/view?view?usp=sharing"), + "dozer": grab_file_id("https://drive.google.com/file/d/1jQJPz5PhzTH--LOcCxvfzV_SDLEp1de3/view?view?usp=sharing"), + "floating-tree": grab_file_id( + "https://drive.google.com/file/d/1mVEHcO2ep13WPx92IPDvdQg66vLQwFSy/view?view?usp=sharing" + ), + "aspen": grab_file_id("https://drive.google.com/file/d/1X1PQcji_QpxGfMxbETKMeK8aOnWCkuSB/view?view?usp=sharing"), + "stump": grab_file_id("https://drive.google.com/file/d/1yZFAAEvtw2hs4MXrrkvhVAzEliLLXPB7/view?view?usp=sharing"), + "sculpture": grab_file_id( + "https://drive.google.com/file/d/1CUU_k0Et2gysuBn_R5qenDMfYXEhNsd1/view?view?usp=sharing" + ), + "Giannini-Hall": grab_file_id( + "https://drive.google.com/file/d/1UkjWXLN4qybq_a-j81FsTKghiXw39O8E/view?view?usp=sharing" + ), "all": None, "nerfstudio-dataset": nerfstudio_dataset, } @@ -184,7 +190,12 @@ def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str, @dataclass class NerfstudioDownload(DatasetDownload): - """Download the nerfstudio dataset.""" + """ + Download data in the Nerfstudio format. + If you are interested in the Nerfstudio Dataset subset from the SIGGRAPH 2023 paper, + you can obtain that by using --capture-name nerfstudio-dataset or by visiting Google Drive directly at: + https://drive.google.com/drive/folders/19TV6kdVGcmg3cGZ1bNIUnBBMD-iQjRbG?usp=drive_link. + """ capture_name: NerfstudioCaptureName = "bww_entrance"