Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/01_dummy_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def training_step():
tic = time.time()
with viewer.lock:
num_train_rays_per_step = training_step()
num_train_steps_per_sec = 1.0 / (time.time() - tic)
num_train_steps_per_sec = 1.0 / (max(time.time() - tic, 1e-10))
num_train_rays_per_sec = num_train_rays_per_step * num_train_steps_per_sec
# Update the viewer state.
viewer.render_tab_state.num_train_rays_per_sec = num_train_rays_per_sec
Expand Down
4 changes: 2 additions & 2 deletions examples/04_gsplat_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ def train(self):

if not cfg.disable_viewer:
self.viewer.lock.release()
num_train_steps_per_sec = 1.0 / (time.time() - tic)
num_train_steps_per_sec = 1.0 / (max(time.time() - tic, 1e-10))
num_train_rays_per_sec = (
num_train_rays_per_step * num_train_steps_per_sec
)
Expand Down Expand Up @@ -822,7 +822,7 @@ def eval(self, step: int):
) # [1, H, W, 3]
colors = torch.clamp(colors, 0.0, 1.0)
torch.cuda.synchronize()
ellipse_time += time.time() - tic
ellipse_time += max(time.time() - tic, 1e-10)

# write images
canvas = torch.cat([pixels, colors], dim=2).squeeze(0).cpu().numpy()
Expand Down
2 changes: 1 addition & 1 deletion nerfview/_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def run(self):
else:
img, depth = rendered, None
self.viewer.render_tab_state.num_view_rays_per_sec = (W * H) / (
time.time() - tic
max(time.time() - tic, 1e-10)
)
except InterruptRenderException:
continue
Expand Down