Paperspace / DataAugmentationForObjectDetection

Data Augmentation For Object Detection
https://blog.paperspace.com/data-augmentation-for-bounding-boxes/
MIT License
1.13k stars 318 forks source link

I encountered a problem about rgb #13

Open 3epochs opened 5 years ago

3epochs commented 5 years ago

hi, firstly, thanks for this fantastic repo! In your code, when you use opencv to load image, you changed its color channel by [:,:,::-1], right? when I run your code and use opencv' imwrite to save it, the output is just weird, I think its the channel's problem, Do I need to convert rgb back to bgr before I save my image?

3epochs commented 5 years ago

and I have another issue and suggestion. issue: In your RandomRotate() func in data_aug/data_aug.py: you cliped the bounding box( if remaining box area less than a value, discard this box, this is a terrific idea!), but in the mean time you resized the img. I think these two operation should not take place in one image, since if you resize img, the bounding box could never get out of (w, h) limitation. I tried about 100 pics, all pics that have been remove box actually have quite obvious object.

suggestion: you can add some code to deal with the situation that bounding box is np.array([]),(there is no object in the img) to make your code more robust.

anyway, thanks for ur fantastic code.