A COCO annotation loader.
annotations_file (str), required
The path to the JSON file containing the annotations
Loads annotations from a CSV file in the following format.
image_name, x_min, y_min, x_max, y_max, label
annotations_file (str), required
The path to the CSV file containing the annotations
normalized (bool) = True
whether the bounding box coordinates are stored in a normalized format
A Pascal VOC annotation loader.
annotations_folder (str), required
The folder where the annotations are stored
Loads annotations from a CSV file in the following format.
image_name, x_min, y_min, width, height, label
annotations_file (str), required
The path to the CSV file containing the annotations
normalized (bool) = True
whether the bounding box coordinates are stored in a normalized format
A YOLO Darknet annotation loader.
annotations_folder (str), required
The folder where the annotations are stored
image_ext (str) = jpg
The file extension for loaded images
A YOLO Keras annotation loader.
annotations_file (str), required
The path to the TXT file containing the annotations
A COCO annotation writer.
annotations_file (str), required
The path to the JSON file to write the annotations to
Writes annotations to a CSV file in the following format.
image_name, x_min, y_min, x_max, y_max, label
annotations_file (str), required
The path to the CSV file to write the annotations to
normalized (bool) = True
whether the bounding box coordinates should be normalized before saving
A Pascal VOC annotation writer.
annotations_folder (str), required
the directory to save annotation files to
clean_directory (bool) = True
whether to forcibly ensure the output directory is empty
database (str) =
The name of the source database
Writes annotations to a CSV file in the following format.
image_name, x_min, y_min, width, height, label
annotations_file (str), required
The path to the CSV file to write the annotations to
normalized (bool) = True
whether the bounding box coordinates should be normalized before saving
A YOLO Darknet annotation writer.
annotations_folder (str), required
the directory to save annotation files to
clean_directory (bool) = True
whether to forcibly ensure the output directory is empty
A YOLO Keras annotation writer.
annotations_file (str), required
The path to the TXT file to write the annotations to
Load images from a directory in the filesystem.
The image name from the AnnotationLoader will be used to fetch a file with the same name in the given directory.
directory (str), required
The directory from which to load images
Writes images to a directory in the filesystem.
Images will be saved to a file with the given name in the given directory.
clean_directory (bool) = True
whether to forcibly ensure the output directory is empty
directory (str), required
the directory to save images to
Changes the color temperature of the input image.
The class changes the color temperature to a value between 1,000 and 40,000 Kelvins (ie. working as a warming or cooling filter).
This class has largely been adapted from @aleju/imgaug library's augmenters.ChangeColorTemperature() function. @aleju/imgaug library can be found at https://github\.com/aleju/imgaug/
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
kelvin (int in range [1000, 40000]) = 3000
temperature value in to which temperature should be changed
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Add gaussian noise to the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
mean (float) = 0
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
variance (float) = 0.01
Return a grayscale version of the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Horizontally flips the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Apply a compression effect to the given image.
This function is a lossy JPEG compression operation.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
strength (int in range [0, 100]) = 1
Compression strength
Add motionblur to a given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
direction (DOWN | UP | RIGHT | LEFT | TOPRIGHT | TOPLEFT | BOTTOMLEFT | BOTTOMRIGHT) = DOWN
direction in which the blur is pointer towards
kernel_size (int in range [0, Inf]) = 10
Specify the kernel size, greater the size, the more the motion
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Sample image augmented with options:
kernel_size: 100
Perform a randomly selected augmentation on the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
augmentations (augmentation_list) = []
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Sample image augmented with options:
augmentations:
- name: GrayScale
options: {}
- name: Rotate
options:
angle: 47
Randomly crops the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
max_height (float in range [0, 1]) = 0.7
Maximum height of cropped area (normalized)
max_width (float in range [0, 1]) = 0.7
Maximum width of cropped area (normalized)
min_height (float in range [0, 1]) = 0.1
Minimum height of cropped area (normalized)
min_width (float in range [0, 1]) = 0.1
Minimum width of cropped area (normalized)
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Sample image augmented with options:
max_height: 0.9
max_width: 0.9
Randomly erase a rectangular area in the given image.
The erased area is replaced with random noise.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
x_range (range in [0.0, 1.0]) = (0.0, 1.0)
normalized x range for coordinates that may be erased
y_range (range in [0.0, 1.0]) = (0.0, 1.0)
normalized y range for coordinates that may be erased
Randomly shift the color space of the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
brightness (range in [-Inf, Inf]) = (0.0, 0.0)
hue (range in [-Inf, Inf]) = (0.0, 0.0)
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
saturation (range in [-Inf, Inf]) = (0.0, 0.0)
Randomly rotate the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
angle_range (range in [-360.0, 360.0]) = (-10.0, 10.0)
The range from which the random angle will be chosen
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Randomly scale the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
scale_range (range in [-1, Inf]) = (0.2, 0.2)
The scale range should be bigger than -1
Randomly shear the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
shear_range (range in [-Inf, Inf]) = (0.2, 0.2)
The shear range has no bounds
Randomly Translate the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
translate_range (range in [0, 1]) = (0.2, 0.2)
The translate range should be within 0 and 1
Resize an image without preserving aspect ratio.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
height (int in range [0, Inf]) = 512
The height of the resized image
interpolation (INTER_NEAREST | INTER_LINEAR | INTER_AREA | INTER_CUBIC | INTER_LANCZOS4) = INTER_LINEAR
The interpolation type
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
width (int in range [0, Inf]) = 512
the width of the resized image
Resize an image while preserving aspect ratio.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
input_dim (int in range [0, Inf]) = 512
The new length of the shortest dimension
interpolation (INTER_NEAREST | INTER_LINEAR | INTER_AREA | INTER_CUBIC | INTER_LANCZOS4) = INTER_LINEAR
The interpolation type
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Rotate the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
angle (float) = 5
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Add salt and pepper or RGB noise to the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
noise_type (RGB | SnP) = RGB
The type of noise
pepper (int in range [0, 255]) = 0
The color of the pepper
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
replace_probs (float) = 0.1
salt (int in range [0, 255]) = 255
The color of the salt
Scale the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
scale_x (float in range [-1.0, Inf]) = 0.2
scale_y (float in range [-1.0, Inf]) = 0.2
Returns a given image passed through the sepia filter.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Perform a sequence of augmentations on the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
augmentations (augmentation_list) = []
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
Sample image augmented with options:
augmentations:
- name: GrayScale
- name: Rotate
options:
angle: 35
- name: SaltAndPepperNoise
options:
noise_type: SnP
Horizontally shear the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
shear_factor (float) = 0.2
Translate the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied
translate_x (float in range [0.0, 1.0]) = 0.2
translate_y (float in range [0.0, 1.0]) = 0.2
Vertically flip the given image.
Input Image | Augmented Image | Input Image (with Bounding Boxes) |
Augmented Image (with Bounding Boxes) |
![]() |
![]() |
![]() |
![]() |
probs (float in range [0.0, 1.0]) = 1.0
The probability that this augmentation will be applied