-
Notifications
You must be signed in to change notification settings - Fork 18
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
Understanding Range Aware Masking? #28
Comments
I think the above is right code. |
Perhaps we should consider the impact of voxel_coords = (voxel_indices[:, 1:] * voxel_size) + point_cloud_range + (voxel_size * 0.5) # z, y, x
voxel_coords_distance = (voxel_coords[:,1]**2 + voxel_coords[:,2]**2)**0.5 |
For all code mentioned above, Like this finally? 😪@serend1p1ty @Xu2729 |
This looks logically correct, but it will actually cause a TypeError when running. You need to convert these variables to tensors before performing the operation. I solved it using the following code def forward():
# ...
voxel_size_ts = torch.tensor(self.voxel_size[::-1], device=voxel_indices.device)
point_cloud_range_ts = torch.tensor(list(self.point_cloud_range)[0:3][::-1], device=voxel_indices.device)
voxel_coords = (voxel_indices[:, 1:] * voxel_size_ts) + point_cloud_range_ts + (voxel_size_ts * 0.5)
voxel_coords_distance = (voxel_coords[:,1]**2 + voxel_coords[:,2]**2)**0.5
# ... I wanted to put I print the number of voxels in each range, and it looks correct. |
Thx for your kind reply ~! It's help a lot. @Xu2729
|
Kindly clarify me few questions about the Range aware masking.
voxel_coords_distance = (voxel_coords[:,2]**2 + voxel_coords[:,3]**2)**0.5
The text was updated successfully, but these errors were encountered: