-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: main
Are you sure you want to change the base?
Conversation
hoanhle
commented
Aug 13, 2024
07aca40
to
99a38d1
Compare
99a38d1
to
86be60d
Compare
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() |
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.
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?
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 | ||
|
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.
get the device
from pipeline
.