nv-tlabs / lift-splat-shoot

Lift, Splat, Shoot: Encoding Images from Arbitrary Camera Rigs by Implicitly Unprojecting to 3D (ECCV 2020)
Other
1.06k stars 221 forks source link

The bug about compute feature index #56

Open usergxx opened 3 months ago

usergxx commented 3 months ago

In the voxel_pooling function, the computation of geom_feats indices involves dividing the positions by dx and then performing rounding to compute the indices.

geom_feats = ((geom_feats - (self.bx - self.dx/2.)) / self.dx).long()

Directly using floor rounding can lead to errors, such as -0.9 rounding to 0, which may incorrectly satisfy the selection criteria and increase the number of invalid features. The intended height range should be [-10m, 10m), but with the current approach, the range becomes (-30m, 10m).

kept = (geom_feats[:, 0] >= 0) & (geom_feats[:, 0] < self.nx[0])\ & (geom_feats[:, 1] >= 0) & (geom_feats[:, 1] < self.nx[1])\ & (geom_feats[:, 2] >= 0) & (geom_feats[:, 2] < self.nx[2])