Script for image augmentation writing new Pascal VOC annotations, using the imgaug library.
Augment images present in dataset/images/
considering their Pascal VOC annotations in dataset/annotations/
. This library is useful AFTER you've annotated your images with a tool such as labelImg.
ℹ️ This script was designed to consume a low amount of RAM. Images are processed one by one.
-
Place your images in
dataset/images/
and their associated annotations indataset/annotations/
The image filenames must match their annotation filenames.
-
Configure the augmentation options as you wish in
docker-compose.yml
-
Run the script
docker-compose up augment
You can run the following command then to visualize newly annotated images that were copied in dataset-augmented/
A red square will be drawn around the bounding boxes described in the annotations
Images will be saved into dataset-visualization/
docker-compose up visualize
Here is an example :
Top left you can see the original image, and then the augmented images. You can customize the augmentation parameters in augment.py at line 185.
- Part of this project is an adaptation of the asetkn's tutorial on how to perform image augmentation with Pascal VOC annotated images