This notebook is based on notebook of Alex P that can be found here.
This project makes use of albumentatioos library to generate synthetic images for object detection, but you can use the generated synthetic images in any other project where you need add more images. Albumentations is a fast and flexible image augmentation library project that can be found here.
I've updated the notebook adding comments and the COCO format to the generated images.
In the figure below, the first image is the original image,
the second image is the augmented image and
the third image is the augmented image with the bounding boxes.
In the function generate_dataset4coco()
you can define the number of augmented images you want to generate and the target operation: train, valid, test
.
The generator will provide the json file with bounding boxes for each image as well.
Enjoy!