Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resolution rendering logic in statemachine for viewer beta #2085

Merged
merged 32 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b95daad
Increase max_res of first proposal network
kerrj Jan 24, 2023
bf0f2e5
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 27, 2023
d2698e0
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jan 28, 2023
fdd3c72
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Feb 1, 2023
85491fa
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Feb 9, 2023
bae8e5c
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Feb 16, 2023
bb02ae0
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Feb 22, 2023
03efc6a
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Mar 14, 2023
6f89617
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Mar 18, 2023
03a4a45
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Mar 23, 2023
4a63d6b
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Mar 27, 2023
a886dc4
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 2, 2023
ea2378e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 4, 2023
1b1bb22
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 5, 2023
06825f4
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 14, 2023
4b040a1
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 16, 2023
0f56cc6
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 17, 2023
134ff3e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 21, 2023
4ac02b3
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 22, 2023
b421b2e
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 22, 2023
1ebfaed
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 24, 2023
9b86877
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Apr 24, 2023
a259f93
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 18, 2023
7e32c8c
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 19, 2023
9db295a
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 19, 2023
86135cf
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 22, 2023
04f7af5
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 25, 2023
09c24de
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj May 26, 2023
c06e2b5
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jun 11, 2023
4697122
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jun 15, 2023
d67e176
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio
kerrj Jun 16, 2023
9db9777
fix render statemachine logic for viewer beta
kerrj Jun 16, 2023
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
10 changes: 9 additions & 1 deletion nerfstudio/viewer_beta/render_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import contextlib
import threading
import time
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, Literal, Optional, Tuple, get_args

Expand Down Expand Up @@ -97,12 +98,16 @@ def action(self, action: RenderAction):
elif self.next_action == "rerender":
# never overwrite rerenders
pass
elif action.action == "static" and self.next_action.action == "move":
# don't overwrite a move action with a static: static is always self-fired
return
else:
# monimal use case, just set the next action
self.next_action = action

# handle interrupt logic
if self.state == "high" and self.next_action.action in ("move", "rerender"):
print("interrupting render", self.next_action.action)
self.interrupt_render_flag = True
self.render_trigger.set()

Expand Down Expand Up @@ -176,7 +181,10 @@ def run(self):
continue
self._send_output_to_viewer(outputs)
# if we rendered a static low res, we need to self-trigger a static high-res
if self.state == "low_static":
if self.next_action is None:
# if there hasn't been an action, wait for 1/target_fps seconds in case we get another move command
time.sleep(1 / self.target_fps)
if self.state in ["low_static", "low_move"]:
self.action(RenderAction("static", action.camera_state))

def check_interrupt(self, frame, event, arg):
Expand Down
4 changes: 2 additions & 2 deletions nerfstudio/viewer_beta/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def _(_: viser.CameraHandle) -> None:

def _interrupt_render(self, _) -> None:
"""Interrupt current render."""
if self.camera_message is not None:
self.render_statemachine.action(RenderAction("rerender", self.camera_message))
if self.camera_state is not None:
self.render_statemachine.action(RenderAction("rerender", self.camera_state))

def _crop_params_update(self, _) -> None:
"""Update crop parameters"""
Expand Down