in datasets/depth_dataset.py [0:0]
def toVox(self, coords, feats, labels):
if "Lidar" in self.cfg:
voxel_output = self.voxel_generator.generate(coords)
if isinstance(voxel_output, dict):
voxels, coordinates, num_points = \
voxel_output['voxels'], voxel_output['coordinates'], voxel_output['num_points_per_voxel']
else:
voxels, coordinates, num_points = voxel_output
data_dict = {}
data_dict['voxels'] = voxels
data_dict['voxel_coords'] = coordinates
data_dict['voxel_num_points'] = num_points
return data_dict
else:
precoords = np.copy(coords)
prefeats = np.copy(feats)
if (self.split == "TRAIN") and (self.prevoxel_transform is not None):
coords, feats, labels = self.prevoxel_transform(coords, feats, labels)
coords, feats, labels, transformation = self.voxelizer.voxelize(coords, feats, labels)
if (self.split == "TRAIN") and (self.input_transforms is not None):
try:
coords, feats, labels = self.input_transforms(coords, feats, labels)
except:
print ("error with: ", coords.shape)
coords = np.zeros((100,3),dtype=np.int32)
feats = np.zeros((100,3),dtype=np.float64)
labels = np.zeros((100,),dtype=np.int32)
if (self.split == "TRAIN") and (self.AUGMENT_COORDS_TO_FEATS):
coords, feats, labels = self._augment_coords_to_feats(coords, feats, labels)
return (coords, feats, labels)