DarkMark  v1.8.20-1
Image markup for darknet machine learning.
Looking for a C++ dev who knows OpenCV?
I'm looking for work. Hire me!
Data Augmentation - Misc

Data augmentation requires that darknet be built with support for OpenCV.

Some notes from AlexeyAB:

From page 6 of the YOLOv4 paper:

Mosaic represents a new data augmentation method that mixes 4 training images. Thus 4 different contexts are mixed, while CutMix mixes only 2 input images. This allows detection of objects outside their normal context. In addition, batch normalization calculates activation statistics from 4 different images on each layer. This significantly reduces the need for a large mini-batch size.

Flip

Images are randomly flipped left-right. Turn this off if you are training classes that depend on left-hand and right-hand distinctions.

For example, training to recognize the letters "b" and "d", or "left hand" and "right hand" would be problematic if flip is enabled.

To enable, add this line to the [net] section of your .cfg file:

flip=1

To disable, add this line to the [net] section of your .cfg file:

flip=0
Note
Instead of using this option, see Rotate and Flip.

Mosaic

Data augmentation may combine multiple images into a single image ("mosaic").

mosaic

To enable, add this line to the [net] section of your .cfg file:

mosaic=1

To disable, add this line to the [net] section of your .cfg file:

mosaic=0
See also
https://github.com/AlexeyAB/darknet/issues/4638
https://github.com/AlexeyAB/darknet/issues/7114

Cutmix

To enable, add this line to the [net] section of your .cfg file:

cutmix=1

To disable, add this line to the [net] section of your .cfg file:

cutmix=0
See also
https://github.com/AlexeyAB/darknet/issues/4638
https://github.com/AlexeyAB/darknet/issues/7114

Mixup

Data augmentation may blend multiple images together to create a new image.

mixup

To enable, add this line to the [net] section of your .cfg file:

mixup=1

To disable, add this line to the [net] section of your .cfg file:

mixup=0
See also
https://github.com/AlexeyAB/darknet/issues/4638
https://github.com/AlexeyAB/darknet/issues/7114