-
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
AABB Conflict FIx #3422
base: main
Are you sure you want to change the base?
AABB Conflict FIx #3422
Conversation
would you want to rebase your PR? |
I can rebase no worries |
a952142
to
c9a8bf4
Compare
c9a8bf4
to
f86dbe6
Compare
3d14c25
to
8e400c4
Compare
8e400c4
to
715f96e
Compare
I am unsure at the moment of how to test this properly, so open to thoughts. Will look at other PR's and try to create something |
@@ -118,7 +118,7 @@ def populate_modules(self): | |||
self.config.render_step_size = ((self.scene_aabb[3:] - self.scene_aabb[:3]) ** 2).sum().sqrt().item() / 1000 | |||
# Occupancy Grid. | |||
self.occupancy_grid = nerfacc.OccGridEstimator( | |||
roi_aabb=self.scene_aabb, |
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'm pretty sure that this would uniformly shrink or grow the scene_aabb
from the origin, without considering the center.
A correct approach would be to first implement something like this in SceneBox
def get_scaled_scene_box(self, scale_factor: Union[float, torch.Tensor] = 1.5):
"""Returns a new box that has been scaled by the given factor while
maintaining its center.
Args:
scale_factor: How much to scale the bounding box by.
Returns:
SceneBox: A new SceneBox with the scaled bounding box.
"""
center = self.get_center()
scaled_aabb = (self.aabb - center) * scale_factor + center
return SceneBox(aabb=scaled_aabb)
and then , call this function where needed.
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 would be great if you could include this. I can review the PR once it's up. Also, I think it would be a good idea to disable scene contraction by default in instant-ngp
.
This PR relates to issue #3405. Credit to hoanle for finding the issue.
Background:
OccGridEstimator uses different levels of AABBs to determine where to sample the points from with varying levels of detail.
But those samples outside the original AABB are not used anyway if we disable the scene contraction:
Since the positions (if distortion is disabled) are taken from a normalized standpoint until the
self.aabb
parameter is passed in.Problem:
The problem is that if we begin with the
scene_aabb
, the outermost AABB, we will not use any of the other resolutions in our enlargement calculations. Therefore, we need to start from the innermost AABB depending on the number of levels.