Resizing transforms (augmentations.geometric.resize)¶
¶
class albumentations.augmentations.geometric.resize.LongestMaxSize
(max_size=1024, interpolation=1, always_apply=False, p=1)
[view source on GitHub]
¶
Rescale an image so that maximum side is equal to max_size, keeping the aspect ratio of the initial image.
Parameters:
Name | Type | Description |
---|---|---|
max_size |
int |
maximum size of the image after the transformation. |
interpolation |
OpenCV flag |
interpolation method. Default: cv2.INTER_LINEAR. |
p |
float |
probability of applying the transform. Default: 1. |
Targets: image, mask, bboxes, keypoints
Image types: uint8, float32
class albumentations.augmentations.geometric.resize.RandomScale
(scale_limit=0.1, interpolation=1, always_apply=False, p=0.5)
[view source on GitHub]
¶
Randomly resize the input. Output image size is different from the input image size.
Parameters:
Name | Type | Description |
---|---|---|
scale_limit |
[float, float] or float |
scaling factor range. If scale_limit is a single float value, the range will be (1 - scale_limit, 1 + scale_limit). Default: (0.9, 1.1). |
interpolation |
OpenCV flag |
flag that is used to specify the interpolation algorithm. Should be one of: cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_CUBIC, cv2.INTER_AREA, cv2.INTER_LANCZOS4. Default: cv2.INTER_LINEAR. |
p |
float |
probability of applying the transform. Default: 0.5. |
Targets: image, mask, bboxes, keypoints
Image types: uint8, float32
class albumentations.augmentations.geometric.resize.Resize
(height, width, interpolation=1, always_apply=False, p=1)
[view source on GitHub]
¶
Resize the input to the given height and width.
Parameters:
Name | Type | Description |
---|---|---|
height |
int |
desired height of the output. |
width |
int |
desired width of the output. |
interpolation |
OpenCV flag |
flag that is used to specify the interpolation algorithm. Should be one of: cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_CUBIC, cv2.INTER_AREA, cv2.INTER_LANCZOS4. Default: cv2.INTER_LINEAR. |
p |
float |
probability of applying the transform. Default: 1. |
Targets: image, mask, bboxes, keypoints
Image types: uint8, float32
class albumentations.augmentations.geometric.resize.SmallestMaxSize
(max_size=1024, interpolation=1, always_apply=False, p=1)
[view source on GitHub]
¶
Rescale an image so that minimum side is equal to max_size, keeping the aspect ratio of the initial image.
Parameters:
Name | Type | Description |
---|---|---|
max_size |
int |
maximum size of smallest side of the image after the transformation. |
interpolation |
OpenCV flag |
interpolation method. Default: cv2.INTER_LINEAR. |
p |
float |
probability of applying the transform. Default: 1. |
Targets: image, mask, bboxes, keypoints
Image types: uint8, float32