Offline Data Augmentation for a COCO Object Detection Dataset
The augmentation tool path is ./dataset_tools/coco_data_aug/coco_data_aug.py. The data augmentation for object detection supports offline data augmentation, which is implemented by mobility and blocking augmentation.
Table 1 describes the names, types, value ranges, default values, and descriptions of each parameter in coco_data_aug.
Parameter |
Type |
Value Range |
Default Value |
Description |
|---|---|---|---|---|
--input_dataset_path |
String |
- |
"" |
Path of the COCO dataset. |
--output_dataset_path |
String |
- |
./output_dataset_path |
Path for saving the augmented data. |
--x_offset |
Bool |
True or False |
False |
Mobility augmentation switch on the X axis. |
--y_offset |
Bool |
True or False |
False |
Mobility augmentation switch on the Y axis. |
--offset_target_times |
Integer |
[1,10] |
1 |
Increased multiplier of data for mobility augmentation. |
--obj_block |
Bool |
True or False |
False |
Blocking augmentation switch. |
--block_labels |
String |
- |
label0,label1 |
List of blocked object labels. Use commas (,) to separate multiple labels. |
--obj_erase |
Bool |
True or False |
False |
Erasing switch for blocking augmentation. |
The following is an example of the default parameter settings:
python3 ./dataset_tools/coco_data_aug/coco_data_aug.py --input_dataset_path=./train --output_dataset_path=./output_dataset_path --x_offset=True --y_offset=True --obj_block=True --block_labels='label0,label1' --obj_erase=True --offset_target_times=2
Each augmentation mode can be enabled separately or in combination. If the blocking augmentation is enabled, you need to specify the tag to be blocked in --block_labels.
The reference log information is as follows:
After the script is executed, augmented data is generated in the output directory specified by the --output_dataset_path parameter.