Skip to content

MaskDropout augmentation (augmentations.dropout.mask_dropout)

class albumentations.augmentations.dropout.mask_dropout.MaskDropout (max_objects=1, image_fill_value=0, mask_fill_value=0, always_apply=False, p=0.5) [view source on GitHub]

Image & mask augmentation that zero out mask and image regions corresponding to randomly chosen object instance from mask.

Mask must be single-channel image, zero values treated as background. Image can be any number of channels.

Inspired by


Name Type Description

Maximum number of labels that can be zeroed out. Can be tuple, in this case it's [min, max]


Fill value to use when filling image. Can be 'inpaint' to apply inpaining (works only for 3-chahnel images)


Fill value to use when filling mask.

Targets: image, mask

Image types: uint8, float32