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

draft: add a way to visualize scene box, seed points, and modify if wanted #3363

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hoanhle
Copy link
Contributor

@hoanhle hoanhle commented Aug 13, 2024

image

@hoanhle hoanhle force-pushed the feature/visualize_roi branch from 07aca40 to 99a38d1 Compare August 13, 2024 16:59
@hoanhle hoanhle force-pushed the feature/visualize_roi branch from 99a38d1 to 86be60d Compare August 14, 2024 10:00
Comment on lines +421 to +433
def update_scene_box(self):
min_coords = np.minimum(self.transform_controls[0].position, self.transform_controls[1].position)
max_coords = np.maximum(self.transform_controls[0].position, self.transform_controls[1].position)

new_aabb = torch.tensor(
[min_coords / VISER_NERFSTUDIO_SCALE_RATIO, max_coords / VISER_NERFSTUDIO_SCALE_RATIO],
device=self.pipeline.model.device,
requires_grad=False,
)

self.pipeline.model.scene_box = SceneBox(aabb=new_aabb)
self.pipeline.model.render_aabb = SceneBox(aabb=new_aabb)
self.pipeline.model.populate_modules()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using device=self.pipeline.model.device for new_aabb seems to cause issues where tensors end up on different devices later in the process. I'm not entirely sure what the best solution is to address this.

@brentyi @tancik, since you both work with this part of the codebase frequently, do you have any suggestions?

Comment on lines 83 to 91
self.num_train_data = num_train_data
self.kwargs = kwargs
self.collider = None

self.populate_modules() # populate the modules
self.device = device
self.seed_points = seed_points
self.callbacks = None
# to keep track of which device the nn.Module is on
self.device_indicator_param = nn.Parameter(torch.empty(0))

@property
def device(self):
"""Returns the device that the model is on."""
return self.device_indicator_param.device
self.populate_modules() # populate the modules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get the device from pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants