Gracefuly handle old ViewerElements from legacy viewer (#2797)

* fix jittering in markdown in viewer beta

* Revert "fix jittering in markdown in viewer beta"

This reverts commit 70ade42e46.

* print correctly formatted url in banner for viewer beta

* warn when legacy viewerelements are used in new viewer

* Add shim for viewer_elements namespace, fixes https://github.com/ayaanzhaque/instruct-nerf2nerf/pull/88

* Fix typo

* suppress ruff error

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
This commit is contained in:
Justin KerrandBrent Yi authored and GitHub committed 2024-01-20 00:37:40 +00:00
1 parent 248e99e7f4
commit 616846b10e
4 files changed
+43 -1

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ GSplat
Nerfstudio uses [gsplat](https://github.com/nerfstudio-project/gsplat) as its gaussian rasterization backend, an in-house re-implementation which is designed to be more developer friendly. This can be installed with `pip install gsplat`. The associated CUDA code will be compiled the first time gsplat is executed. Some users with PyTorch 2.0 have experienced issues with this, which can be resolved by either installing gsplat from source, or upgrading torch to 2.1.
### Data
Gaussian spltting works much better if you initialize it from pre-existing geometry, such as SfM points from COLMAP. COLMAP datasets or datasets from `ns-process-data` will automatically save these points and initialize gaussians on them. Other datasets currently do not support initialization, and will initialize gaussians randomly. Initializing from other data inputs (i.e. depth from phone app scanners) may be supported in the future.
Gaussian splatting works much better if you initialize it from pre-existing geometry, such as SfM points from COLMAP. COLMAP datasets or datasets from `ns-process-data` will automatically save these points and initialize gaussians on them. Other datasets currently do not support initialization, and will initialize gaussians randomly. Initializing from other data inputs (i.e. depth from phone app scanners) may be supported in the future.
Because the method trains on *full images* instead of bundles of rays, there is a new datamanager in `full_images_datamanager.py` which undistorts input images, caches them, and provides single images at each train step.
+14
View File
@@ -0,0 +1,14 @@
# Copyright 2022 the Regents of the University of California, Nerfstudio Team and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@@ -0,0 +1,19 @@
# Copyright 2022 the Regents of the University of California, Nerfstudio Team and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Shim for viewer_elements.py, which has been moved.
Resolves issues like: https://github.com/ayaanzhaque/instruct-nerf2nerf/pull/88
"""
from ..viewer_elements import * # noqa
+9
View File
@@ -235,6 +235,15 @@ class Viewer:
nested_folder_install(folder_labels[1:], prev_labels + [folder_labels[0]], element)
with control_tab:
from nerfstudio.viewer_legacy.server.viewer_elements import ViewerElement as LegacyViewerElement
if len(parse_object(pipeline, LegacyViewerElement, "Custom Elements")) > 0:
from nerfstudio.utils.rich_utils import CONSOLE
CONSOLE.print(
"Legacy ViewerElements detected in model, please import nerfstudio.viewer.viewer_elements instead",
style="bold yellow",
)
self.viewer_elements = []
self.viewer_elements.extend(parse_object(pipeline, ViewerElement, "Custom Elements"))
for param_path, element in self.viewer_elements: