transforms
DropAlphaChannel
Bases: DualTransform
Transform that takes rgba images and mask and that removes the alpha channel
Target : image, mask, masks Type : any
FixedCropAroundMaskIfExists
Bases: CropNonEmptyMaskIfExists
Crop area with mask if mask is non-empty, else make center crop. Cropped area will always be centered around a non empty area in a fully deterministic way.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height |
int
|
vertical size of crop in pixels |
required |
width |
int
|
horizontal size of crop in pixels |
required |
ignore_values |
Optional[Sequence[int]]
|
values to ignore in mask, |
None
|
ignore_channels |
Optional[Sequence[int]]
|
channels to ignore in mask
(e.g. if background is a first channel set |
None
|
p |
float
|
probability of applying the transform. Default: 1.0. |
1.0
|
RandomCropAroundMaskIfExists
Bases: CropNonEmptyMaskIfExists
Crop area with mask if mask is non-empty, else make random crop. Cropped area will always be centered around a non empty area with a random offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
height |
int
|
vertical size of crop in pixels |
required |
width |
int
|
horizontal size of crop in pixels |
required |
ignore_values |
Optional[Sequence[int]]
|
values to ignore in mask, |
None
|
ignore_channels |
Optional[Sequence[int]]
|
channels to ignore in mask
(e.g. if background is a first channel set |
None
|
p |
float
|
probability of applying the transform. Default: 1.0. |
1.0
|
ToSingleChannelMask
Bases: DualTransform
Transforms that takes a grayscale masks with rgb or rgba channels and transform them into a single channel image
Target : mask, masks Type : any