utils package

Submodules

utils.artifact_utilities module

utils.artifact_utilities.check_results_dir_exists(results_dir)[source]

Check if the results directory exists.

Parameters:

results_dir (str) – The path to the results directory.

Returns:

True if the results directory exists, False otherwise.

Return type:

bool

utils.files_managment module

utils.files_managment.copy_results_directory(src_dir, dest_dir, absolute_paths=(False, False))[source]

Copy the results directory to the destination directory.

Parameters:
  • src_dir (str) – Source directory.

  • dest_dir (str) – Destination directory.

  • absolute_paths (tuple[bool]) – Tuple of two booleans, if True, the source or destination paths will be absolute.

Returns:

None

Raises:
Return type:

None

utils.transforms module

class utils.transforms.HorizontalCenterCrop(width)[source]

Bases: object

Applies a horizontal center crop to an image.

Parameters:

width (int) – The desired width of the cropped image.

width

The desired width of the cropped image.

Type:

int

__call__(img

Image.Image) -> Image.Image: Applies a horizontal center crop to the input image.

__call__(img)[source]

Applies a horizontal center crop to the input image.

Parameters:

img (PIL.Image.Image) – The input image.

Returns:

The cropped image.

Return type:

PIL.Image.Image

Module contents

utils.copy_results_directory(src_dir, dest_dir, absolute_paths=(False, False))[source]

Copy the results directory to the destination directory.

Parameters:
  • src_dir (str) – Source directory.

  • dest_dir (str) – Destination directory.

  • absolute_paths (tuple[bool]) – Tuple of two booleans, if True, the source or destination paths will be absolute.

Returns:

None

Raises:
Return type:

None