transform

Classes

Resize

Resize sample to given size (width, height).

NormalizeImage

Normlize image by given mean and std.

PrepareForNet

Prepare sample for usage as network input.

Crop

Crop sample for batch-wise training. Image is of shape CxHxW

Functions

apply_min_size(sample, size[, image_interpolation_method])

Rezise the sample to ensure the given size. Keeps aspect ratio.

Module Contents

transform.apply_min_size(sample, size, image_interpolation_method=cv2.INTER_AREA)

Rezise the sample to ensure the given size. Keeps aspect ratio.

Parameters:
  • sample (dict) – sample

  • size (tuple) – image size

Returns:

new size

Return type:

tuple