efficientdet-pytorch icon indicating copy to clipboard operation
efficientdet-pytorch copied to clipboard

Initial Mosaic augmentation implementation

Open dmatos2012 opened this issue 4 years ago • 3 comments

As per your given TODOs in the README, I thought it would be nice to add initial mosaic augmentation to this codebase. Original implementation is from YoloV5 repo, which I have slightly tweaked to fit here.

I currently do not have the hardware to train with this implementation, but I still would like to contribute. Thats how some of them look visualized from the train script in img, target = create_dataset(args) train_img_26 img_14.

Sometimes the bboxes look off as well. If you give me any pointers to improve the implementation, or to test (on limited hardware) whether this augmentation works here, please let me know. I am willing to make changes if needed, as I am just starting in this deep learning world.

It does add an opencv dependency as per the original repo, so dont know whether that is a problem. Thanks!

dmatos2012 avatar Jun 17 '21 16:06 dmatos2012

@dmatos2012 thanks for the impl, unfortunately I can't merge. Yolov5 is GPL-3 license so I can't include any code from that project here as it would be in conflict with keeping my license Apache 2.0. Any impl would need to be from scratch or based on another Apache/BSD/MIT/etc licensed project that did not originate from Yolov5/3 (Yolov4 / darknet are fine, but they're c++ so not a cut and paste job).

I'll leave this open for now and try to find some time to try it, if it does prove useful then it will raise priority of implementing from scratch.

rwightman avatar Jun 17 '21 19:06 rwightman

Oh, I am sorry, I did not read the license previously. I will try to contribute with other ones from your TODOs , or if you have any other "low hanging fruit" that have since came up, I can also give them a try.

Thanks for the quick reply.

dmatos2012 avatar Jun 18 '21 04:06 dmatos2012

In load_image, when r != 1, the image is resized while bbox is not, which may lead to some problems when the data format is not in yolo style. Maybe you can use resize functions from albumentations or other libraries that can handle image and bbox together.

Promisery avatar Jul 21 '21 12:07 Promisery