mdbloice / Augmentor

Image augmentation library in Python for machine learning.
https://augmentor.readthedocs.io/en/stable
MIT License
5.08k stars 866 forks source link

random_erasing() should not add noise to the annotation mask #214

Open Mahi-Mai opened 4 years ago

Mahi-Mai commented 4 years ago

So I noticed that when I apply random erasing, the changes get applied to the annotation.

p = Augmentor.Pipeline(source_directory='/dir/samples/images', 
                       save_format='png')

 p.random_erasing(probability=0.5, rectangle_area=0.11)

p.ground_truth('/dir/samples/annotations')
p.random_distortion(probability=0.6, grid_width=5, grid_height=5, magnitude=4)
p.skew(probability=1, magnitude=10)
p.rotate(probability=0.5, max_left_rotation=25, max_right_rotation=25)
p.flip_left_right(probability=0.5)
p.flip_top_bottom(probability=0.5)
p.crop_random(probability=0.5, percentage_area=0.60)

Is there a way to prevent this?

Thanks!