tsinghua-rll / VoxelNet-tensorflow

A 3D object detection system for autonomous driving.
MIT License
453 stars 123 forks source link

voxelization steps #54

Closed OneManArmy93 closed 5 years ago

OneManArmy93 commented 5 years ago

Can anyone tell me where is the voxelization steps exactly? Im having hard time wrapping my mind around the code Thx

ansabsheikh9 commented 5 years ago

I think this function could help you with that https://github.com/tsinghua-rll/VoxelNet-tensorflow/blob/d24c3eefc5762e4785ca3be6ca7d1fd0ef16bc61/utils/preprocess.py#L18

OneManArmy93 commented 5 years ago

@ansabsheikh9 Thank you! Do you have any idea how can I visualize after voxelization process?

ansabsheikh9 commented 5 years ago

the voxelization here is different than voxelization step in 3dfcnn. Here voxelization is just to divide the pointcloud into small parts of resolution and extract the feature directly from pointcloud using fully connected network from each voxel grid (of some resolution) (You can refer to the paper for further details). However, in 3dfcnn each voxel grid is represented by 1 if there is any pointcloud present in that. and then the voxel grid is feeded to the 3d convolution network. You can visualize voxel grid representaiton of a point cloud using following code example:

import mayavi.mlab
import numpy

data = (100, 100, 100)
data = numpy.zeros(data)
data[0:50, 50:70, 0:50] = 1
data[0:50, 0:20, 0:50] = 1

xx, yy, zz = numpy.where(data == 1)

mayavi.mlab.points3d(xx, yy, zz,
                     mode="cube",
                     color=(0, 1, 0),
                     scale_factor=1)

mayavi.mlab.show() 
OneManArmy93 commented 5 years ago

@ansabsheikh9 thank you for your patience. Im trying to implement a voxel grid which have 0 or 1 (like in the 3dfcnn) and I was looking for some inspiration here in VoxelNet. I guess this won't lead me no where. Thank you for shedding the light, much appreciated :)

ansabsheikh9 commented 5 years ago

@OneManArmy93 Voxelnet is better architecture to start working with pointcloud data and learn about pointcloud processing. Anyhow this function is used to convert raw pointcloud information to voxelgrid represtntation which is used by 3dfcnn. https://github.com/yukitsuji/3D_CNN_tensorflow/blob/5104ecf3f75a4e51a2170b72244e3f2a8993ce25/input_velodyne.py#L174