stouputils.data_science.data_processing.image_augmentation module#

class ImageDatasetAugmentation(
final_dataset_size: int,
techniques: list[ProcessingTechnique] | None = None,
)[source]#

Bases: ImageDatasetPreprocess

Image dataset augmentation class. Check the class constructor for more information.

_add_suffix(
path: str,
used_destinations: set[str],
) str[source]#

Add a count suffix to the path in order to avoid overwriting the same file

Parameters:

path (str) – Path to the file (example: “path/to/file.jpg”)

Returns:

Path with the suffix (example: “path/to/file_1.jpg”)

Return type:

str

get_queue(
dataset_path: str,
destination_path: str,
images_per_class_dict: dict[str, int] | None = None,
) list[tuple[str, str, list[ProcessingTechnique]]][source]#

Get the queue of images to process with their techniques.

Parameters:
  • dataset_path (str) – Path to the dataset

  • destination_path (str) – Path to the destination dataset

  • images_per_class_dict (dict[str, int]) – Dictionary mapping class names to desired number of images (optional, defaults to empty dictionary)

Returns:

Queue of (source_path, dest_path, techniques) tuples

Return type:

list[tuple[str, str, list[ProcessingTechnique]]]