Transform label according to the image transform used

I am trying to classify various parts of cars exterior i.e. left door, right door, bumper.
I want to augment data by using horizontal flips. But the problem is that labels should change accordingly. I want to change labels whenever the horizontal flip is applied.

My guess that an elegant solution would be to create a custom label class and just add an encode method to Flip with this label type to flip the label at the same time.

1 Like