loicland / superpoint_graph

Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs
MIT License
758 stars 214 forks source link

Understanding libplc.prune() function using S3DIS dataset #224

Closed Crane-YU closed 1 year ago

Crane-YU commented 4 years ago

Hi @loicland ,

Thank you for your wonderful work. I get lost when going through your 'prune()' function in ply_c.cpp. Could you explain what the difference is between the input label and the pruned label, and also the pruned_object? From my understanding, the original input labels range from [0, 13] indicating 1 backgroud + 12 objects. However, when I compile the following code, I found that the elements are not within the original range (e.g. from 0 to 13): if args.voxel_width > 0: xyz, rgb, labels, dump = libply_c.prune(xyz.astype('f4'), args.voxel_width, rgb.astype('uint8'), labels.astype('uint8'), np.zeros(1, dtype='uint8'), n_labels, 0) Could you please explain libply_c.prune. Thank you so much.

loicland commented 4 years ago

Hi,

sorry I missed this issue. This is a simple code that voxelized the input cloud into cubes of side voxel_width. The input label/object is a vector of size n_original int indicating class label/object index of each point. The pruned version are matrices of size n_pruned,n_label indicating the number of points for each label withing each cubes.

[0, 13] is 14 classes: 1 background + 13 objects. So it make sense that the pruned labels would be in [0,13].

Crane-YU commented 4 years ago

@loicland Thank you. While I've encountered another issue that I am using my own dataset with no label and rgb information. When I was doing xyz = libply_c.prune(xyz, args.voxel_width, np.zeros(xyz.shape, dtype='u1'), np.array(1, dtype='u1'), 0)[0] An error occurred

Boost.Python.ArgumentError: Python argument types in partition.ply_c.libply_c.prune(numpy.ndarray, float, numpy.ndarray, numpy.ndarray, int) did not match C++ signature: prune(boost::python::numpy::ndarray, float, boost::python::numpy::ndarray, boost::python::numpy::ndarray, boost::python::numpy::ndarray, int, int) It seems to me that I have to input 7 arguments while from the suggestion I can only input 5 arguments when no label or rgb information is present. Can you explain this? Thank you.

loicland commented 1 year ago

Hi!

We are releasing a new version of SuperPoint Graph called SuperPoint Transformer (SPT).

https://github.com/drprojects/superpoint_transformer

It is better in any way:

✨ SPT in numbers ✨
📊 SOTA results: 76.0 mIoU S3DIS 6-Fold, 63.5 mIoU on KITTI-360 Val, 79.6 mIoU on DALES
🦋 212k parameters only!
⚡ Trains on S3DIS in 3h on 1 GPU
Preprocessing is x7 faster than SPG!
🚀 Easy install (no more boost!)

If you are interested in lightweight, high-performance 3D deep learning, you should check it out. In the meantime, we will finally retire SPG and stop maintaining this repo.