- 
                Notifications
    
You must be signed in to change notification settings  - Fork 12
 
Description
I have noticed a currently unused attribute in IntCoords, that I was unsure what to do about, so instead of proposing a fix in a pull request, I'm raising an issue. Outside the file warpconvnet/geometry/coords/integer.py there are no references to voxel_origin, and the only use of it within the file would lead to an error:
WarpConvNet/warpconvnet/geometry/coords/integer.py
Lines 83 to 87 in 672653d
| def unique(self) -> "IntCoords": | |
| unique_indices, batch_offsets = voxel_downsample_random_indices( | |
| self.batched_tensor, self.offsets, self.voxel_size, self.voxel_origin | |
| ) | |
| return self.__class__(self.batched_tensor[unique_indices], batch_offsets) | 
as the function voxel_downsample_random_indices takes only three arguments
WarpConvNet/warpconvnet/geometry/coords/ops/voxel.py
Lines 113 to 117 in 672653d
| def voxel_downsample_random_indices( | |
| batched_points: Float[Tensor, "N 3"], # noqa: F821 | |
| offsets: Int[Tensor, "B + 1"], # noqa: F821 | |
| voxel_size: Optional[float] = None, | |
| ) -> Tuple[Int[Tensor, "M"], Int[Tensor, "B + 1"]]: # noqa: F821 | 
Also, all info besides the coordinates (stride, voxel_origin, voxel_size) is lost on the return statement:
| return self.__class__(self.batched_tensor[unique_indices], batch_offsets) | 
Same loss of information seems to happen in the sort method, where self.class is used to create a new instance of IntCoords with only the coordinates and offsets.
As it is now, this is fairly confusing as the attribute does nothing, for example when voxels are turned back into points by Voxels.to_point, there is no additional offset to the voxel origin, which I would expect if I provided such an argument.
| batched_points = RealCoords(self.coordinate_tensor * voxel_size, self.offsets) | 
I think it may be useful to control the voxelization with voxel_origin, but of course the same control can be achieved with less book-keeping by just translating the whole point cloud to your desired voxel origin.