mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 15:15:43 +08:00
add number of gaussians in logger; allow testing in nerfacto
This commit is contained in:
1 parent
35be6fd421
commit
75d2d14b75
5 files changed
+29
-12
No files matched your search
@@ -25,6 +25,7 @@ import torch
|
||||
from nerfstudio.cameras.cameras import Cameras
|
||||
from nerfstudio.model_components.renderers import \
|
||||
background_color_override_context
|
||||
from nerfstudio.models.gaussian_splatting import GaussianSplattingModel
|
||||
from nerfstudio.utils import colormaps, writer
|
||||
from nerfstudio.utils.writer import GLOBAL_BUFFER, EventName, TimeWriter
|
||||
from nerfstudio.viewer.server import viewer_utils
|
||||
@@ -129,7 +130,9 @@ class RenderStateMachine(threading.Thread):
|
||||
|
||||
with self.viewer.train_lock if self.viewer.train_lock is not None else contextlib.nullcontext():
|
||||
#TODO jake-austin: Make this check whether the model inherits from a camera based model or a ray based model
|
||||
if True:
|
||||
#TODO Zhuoyang: First made some dummy judgements, need to be fixed later
|
||||
isGaussianSplattingModel = isinstance(self.viewer.get_model(), GaussianSplattingModel)
|
||||
if isGaussianSplattingModel:
|
||||
pass
|
||||
else:
|
||||
camera_ray_bundle = camera.generate_rays(camera_indices=0, aabb_box=self.viewer.get_model().render_aabb)
|
||||
@@ -147,13 +150,13 @@ class RenderStateMachine(threading.Thread):
|
||||
device=self.viewer.get_model().device,
|
||||
)
|
||||
with background_color_override_context(background_color), torch.no_grad():
|
||||
if True:
|
||||
if isGaussianSplattingModel:
|
||||
outputs = self.viewer.get_model().get_outputs_for_camera_ray_bundle(camera)
|
||||
else:
|
||||
outputs = self.viewer.get_model().get_outputs_for_camera_ray_bundle(camera_ray_bundle)
|
||||
else:
|
||||
with torch.no_grad():
|
||||
if True:
|
||||
if isGaussianSplattingModel:
|
||||
outputs = self.viewer.get_model().get_outputs_for_camera_ray_bundle(camera)
|
||||
else:
|
||||
outputs = self.viewer.get_model().get_outputs_for_camera_ray_bundle(camera_ray_bundle)
|
||||
|
||||
Reference in new issue
Block a user