traveller59 / spconv

Spatial Sparse Convolution Library
Apache License 2.0
1.89k stars 366 forks source link

Create Sparse Tensor from Generated Voxel #723

Open rangganast opened 1 month ago

rangganast commented 1 month ago

Greetings I've been trying spconv library for point cloud data. I have checked several answers in the issues and the documentation but I am still unsure how the SparseConvTensor is created from the generated voxel.

` gen = Point2VoxelGPU3d( vsize_xyz=[0.1, 0.1, 0.1], coors_range_xyz=[-80, -80, -2, 80, 80, 6], num_point_features=4, # here num_point_features must equal to pc.shape[1] max_num_voxels=5000, max_num_points_per_voxel=5 )

pc = np.random.uniform(-10, 10, size=[100000, 4]).astype(np.float32) pc_tv = tv.from_numpy(pc).cuda() voxels_tv, indices_tv, num_p_in_vx_tv = gen.point_to_voxel_hash(pc_tv) `

I need some clarity on what to do to create sparse tensor after this step. I appreciate your attention and helps. Thank you.