Eaphan / UPIDet

Unleash the Potential of Image Branch for Cross-modal 3D Object Detection [NeurIPS2023]
Apache License 2.0
54 stars 7 forks source link

Semantic segmentation label generation #1

Closed crop-leaderboard closed 1 year ago

crop-leaderboard commented 1 year ago

Hi, Thanks for your great work. Currently, I am trying to do some experiments on my customized data. Could you please tell me how to generate the semantic segmentation label in the info files? Thanks!

Eaphan commented 1 year ago

You can notice that we add the mask property of each object, namely "inmodal_seg", in the kitti_infos_train/val.pkl and kitti_dbinfos_train.pkl. So how to generate the semantic segmentation label in the info files? Let single_object_mask be the mask of a single object, where the value of valid pixels is 1 and 0 for other pixels.

import pycocotools.mask as maskUtils
inmodal_seg = maskUtils.encode(np.asfortranarray(single_object_mask .astype(np.uint8)))

Then we can decode the encoded data when we want to use it during training or evaluation.

I hope it's helpful to you.