sel118 / LaneAF

189 stars 36 forks source link

About ignore_label #18

Closed jiayily closed 3 years ago

jiayily commented 3 years ago

Why the seg label would contain 255 in Tusimple and CULane?

jiayily commented 3 years ago

I got it. The GroupRandomRotation will pad board value 255 in the seg label tf.GroupRandomRotation(degree=(-1, 1), interpolation=(cv2.INTER_LINEAR, cv2.INTER_NEAREST), padding=(self.mean, (self.ignore_label, ))) But why don't you pad zero values?

arangesh commented 3 years ago

We pad the image with 255 so that these pixels can be ignored during loss calculation. This is because we do not know the true class of these border pixels after random rotations. If we use zero values, that would mean that the border pixels are all background - which is not necessarily the case.

jiayily commented 3 years ago

This makes sense. I notice the two lines of code in ground-truth generation. mask[seg[:, :, 0] == self.ignore_label] = self.ignore_label # pixels of ignore_label won't contribute to segmentation loss seg_wo_ignore[seg_wo_ignore == self.ignore_label] = 0 # pixels of ignore_label don't need predict afs By the way how much does random rotations affect the performance?

arangesh commented 3 years ago

You can check our paper for ablation experiments on TuSimple. In our experience, random transformations do lead to some marginal improvements and produce better affinity fields.

jiayily commented 3 years ago

I see it. It does lead a marginal improvement. Thanks for your reply.