Source: https://github.com/jason9075/opencv-mosaic-data-aug
|
|
|
Get images list and annotations list from input dir. |
|
Automatic generate random 32 characters. |
|
label_dir <type: str>: Path to label include annotation of images
img_dir <type: str>: Path to folder contain images
Return <type: list>: List of images path and labels
Get images list and annotations list from input dir. Update new images and annotations. Save images and annotations in output dir.
Automatic generate random 32 characters. Get random string code: ‘7b7ad245cdff75241935e4dd860f3bad’ >>> len(random_chars(32)) 32
all_img_list <type: list>: list of all images
all_annos <type: list>: list of all annotations of specific image
idxs <type: list>: index of image in list
output_size <type: tuple>: size of output image (Height, Width)
scale_range <type: tuple>: range of scale image
filter_scale <type: float>: the condition of downscale image and bounding box
output_img <type: narray>: image after resize
new_anno <type: list>: list of new annotation after scale
path[0] <type: string>: get the name of image file