-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support rectangle selection in viewer #3014
Conversation
Question: does it make sense to move toward deprecating the (I'm not super familiar with the viewer elements workflow) |
CONSOLE.log("`register_click_cb` is deprecated, use `register_pointer_cb` instead.") | ||
self.register_pointer_cb("click", cb) | ||
|
||
def register_pointer_cb( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be good to throw an error if the user tries to register two click callbacks before unregistering one? just for transparency that only one at a time works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Viser should raise warnings if a callback is unregistered, see commit here: nerfstudio-project/viser@2beac59
... do you think we should throw an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be a bit cleaner if there was a warning from ViewerControl too for traceability yea, if that's easy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, addressed in ec21904 via catching warnings; now it prints like the img below:
So it should at least fwd you to the correct nerfstudio function.
Technically you can already access the viser API through Making the viewer_elements abstraction thinner somehow would be nice, but we do need some sort of abstraction if we want the viewer to have the nice auto-populating behavior that it does right now (recursively scrape the pipeline for viewer elements). The main annoyance with accessing the ViserServer is how to treat the "static" (predefined in model file) gui elements vs the "dynamic" (added during runtime) elements. Which panel do they go on, what order, etc. And how do we keep the same API for both? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exciting stuff, lgtm :)
* Support rectangle selection in viewer * Update doc for click screen_pos * Raise callback override warning from nerfstudio * Bump viser version, rect-select only in >0.1.26
Related to rect-select viser PR, linked here: nerfstudio-project/viser#157.
This adds
ViewerRectSelect
, a rectangular selection in 2D parameterized by its min/max bounds. This PR also addsscreen_pos
property toViewerClick
, the screen position associated with the click.There's many exciting applications for this -- especially in splatfacto, where we can select groups of gaussians. One example is #3001, for floater removal (@anniezhang2288 :) )
The example video shows both interaction types, clicking and rectangular selection. More specifically, for the rectangular selection, the video shows:
dragbox.mp4