MCPcopy Create free account
hub / github.com/Robotics-STAR-Lab/H2-Mapping / updownsampling_voxel

Method updownsampling_voxel

mapping/src/mapping.py:348–353  ·  view source on GitHub ↗
(self, points, indices, counts)

Source from the content-addressed store, hash-verified

346 return margin_vox
347
348 def updownsampling_voxel(self, points, indices, counts):
349 summed_elements = torch.zeros(counts.shape[0], points.shape[-1]).cuda()
350 summed_elements = torch.scatter_add(summed_elements, dim=0,
351 index=indices.unsqueeze(1).repeat(1, points.shape[-1]), src=points)
352 updownsample_points = summed_elements / counts.unsqueeze(-1).repeat(1, points.shape[-1])
353 return updownsample_points
354
355 def create_voxels(self, frame):
356 points_raw = frame.get_points().cuda()

Callers 1

create_voxelsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected