drprojects / superpoint_transformer

Official PyTorch implementation of Superpoint Transformer introduced in [ICCV'23] "Efficient 3D Semantic Segmentation with Superpoint Transformer" and SuperCluster introduced in [3DV'24 Oral] "Scalable 3D Panoptic Segmentation As Superpoint Graph Clustering"
MIT License
508 stars 65 forks source link

How to get the super_index_raw_to_level0? #124

Closed Wind010321 closed 2 weeks ago

Wind010321 commented 2 weeks ago

Hello, I find in demo.ipynb: "If we want to do full-resolution predictions, we need to set the parameter to true ." I want to get the 'sub' to obtain the "sub_level0_to_raw" parameter. I have set "load_full_res_idx: true". When I load the .h5 file to see if the P0 has the key 'sub', there isn't a sub but have these below:

截屏2024-06-30 20 52 58
1. I want to obtain the sub_level0_to_raw, so the 'pointers' is what I want(i.e. sub_level0_to_raw=pointers)?
2. I want to assign the P0's index to the point in the raw data, what can i do based on 'pointers' and 'points'?
截屏2024-06-30 21 22 17

Thank you!

drprojects commented 2 weeks ago

If I understand well: the 'sub' key is indeed present in your HDF5 and load_full_res_idx=True ? This should normally work then. Have you tried killing your notebook kernel and restarting it ? After which, make sure your dataset.point_load_keys contains 'sub', this is what load_full_res_idx=True should trigger. To this end check:

# Make sure 'sub' is among the point_load_keys
print(datamodule.val_dataset.point_load_keys)
Wind010321 commented 2 weeks ago

If I understand well: the 'sub' key is indeed present in your HDF5 and load_full_res_idx=True ? This should normally work then. Have you tried killing your notebook kernel and restarting it ? After which, make sure your dataset.point_load_keys contains 'sub', this is what load_full_res_idx=True should trigger. To this end check:

# Make sure 'sub' is among the point_load_keys
print(datamodule.val_dataset.point_load_keys)

@drprojects
Hi, I try killing my notebook kernel and restarting it, but the result is the same. When I run below:

print(datamodule.val_dataset.point_load_keys)

It shows below:

截屏2024-07-01 11 14 50

I can confirm that I correctly set the 'load_full_res_idx=True'. I guess that the 'sub' covered in the '_cluster_' as below is the 'sub' what I want :

截屏2024-06-30 20 52 58

In the '_cluster_' as showed in the first questions I posted, I can get the 'points' and the 'pointers'. The shape of the 'points' is the shape of the raw data. The shape of the 'pointers' is the shape of the super_index(i.e. nag[0].super_index). But I don't know the meanings of the value of 'points' and 'pointers'. If I know the meanings, I can build the corresponding index relationships between the raw data and the P0. Looking forward to your solutions!

Wind010321 commented 2 weeks ago

I experimentally make sure that the 'sub' key is the In the 'cluster' as showed in the first questions I posted where I can get the 'points' and the 'pointers'. Provide some explanations for this question. I solved my problem and I'll close this issue.