iaa_crop_and_pad
IAACropAndPad
¶
Bases: MultiVariateAlbumentation
Crop and pad images by pixel amounts or fractions of image sizes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
Union[None, str, Iterable[str]]
|
What mode(s) to execute this Op in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
None
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Op in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|
image_in |
Optional[str]
|
The key of an image to be modified. |
None
|
mask_in |
Optional[str]
|
The key of a mask to be modified (with the same random factors as the image). |
None
|
masks_in |
Optional[str]
|
The key of masks to be modified (with the same random factors as the image). |
None
|
image_out |
Optional[str]
|
The key to write the modified image (defaults to |
None
|
mask_out |
Optional[str]
|
The key to write the modified mask (defaults to |
None
|
masks_out |
Optional[str]
|
The key to write the modified masks (defaults to |
None
|
px |
Union[None, int, Tuple[int, int]]
|
he number of pixels to crop (negative values) or pad (positive values) on each side of the image. Either this or the parameter percent may be set, not both at the same time. |
None
|
percent |
Union[None, float, Tuple[float, float]]
|
The number of pixels to crop (negative values) or pad (positive values) on each side of the image given as a fraction of the image height/width. |
None
|
pad_mode |
Union[int, str]
|
OpenCV border mode. |
'constant'
|
pad_cval |
Union[int, Tuple[float], List[int]]
|
The constant value to use if the pad mode is BORDER_CONSTANT. If a tuple of two number s and at least one of them is a float, then a random number will be uniformly sampled per image from the continuous interval [a, b] and used as the value. If both number s are int s, the interval is discrete. If a list of number, then a random value will be chosen from the elements of the list and used as the value. |
0
|
keep_size |
bool
|
Whether to keep the same size as original image. |
True
|
Image types
uint8, float32