Closed jiayily closed 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?
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.
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?
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.
I see it. It does lead a marginal improvement. Thanks for your reply.
Why the seg label would contain 255 in Tusimple and CULane?