edwardzhou130 / PolarSeg

Implementation for PolarNet: An Improved Grid Representation for Online LiDAR Point Clouds Semantic Segmentation (CVPR 2020)
BSD 3-Clause "New" or "Revised" License
369 stars 80 forks source link

inquiry meaning about " label - 1" , thanks!! #44

Open emilyemliyM opened 2 years ago

emilyemliyM commented 2 years ago

Dear author, I got confused about func "SemKITTI2train_single" about "label-1". what does the function want to do?

def SemKITTI2train(label): if isinstance(label, list): return [SemKITTI2train_single(a) for a in label] else: return SemKITTI2train_single(label)

def SemKITTI2train_single(label): return label - 1 # uint8 trick

edwardzhou130 commented 2 years ago

SemanticKITTI uses label 0 as the 'unlabeled' class. https://github.com/edwardzhou130/PolarSeg/blob/3531f15bb9f38b3ae075ea33183d32ab6139980a/semantic-kitti.yaml#L144-L164 Our model won't predict this class during training. So each gt label needs to be shifted down by 1 when calculating the loss.