Skip to content

Commit

Permalink
Updated XY_masking
Browse files Browse the repository at this point in the history
  • Loading branch information
ternaus committed Jan 7, 2025
1 parent 444d6e5 commit f08f1de
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions albumentations/augmentations/dropout/xy_masking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from typing import Any, cast
from warnings import warn

import numpy as np
from pydantic import model_validator
Expand Down Expand Up @@ -46,7 +45,7 @@ class XYMasking(BaseDropout):
- 'inpaint_telea': uses OpenCV Telea inpainting method
- 'inpaint_ns': uses OpenCV Navier-Stokes inpainting method
Default: 0
mask_fill_value (ColorType | None): Fill value for dropout regions in the mask.
fill_mask (ColorType | None): Fill value for dropout regions in the mask.
If None, mask regions corresponding to image dropouts are unchanged. Default: None
p (float): Probability of applying the transform. Defaults to 0.5.
Expand All @@ -65,9 +64,6 @@ class InitSchema(BaseTransformInitSchema):
mask_x_length: NonNegativeIntRangeType
mask_y_length: NonNegativeIntRangeType

fill_value: DropoutFillValue | None
mask_fill_value: ColorType | None

fill: DropoutFillValue
fill_mask: ColorType | None

Expand All @@ -82,14 +78,6 @@ def check_mask_length(self) -> Self:
msg = "At least one of `mask_x_length` or `mask_y_length` Should be a positive number."
raise ValueError(msg)

if self.fill_value is not None:
warn("fill_value is deprecated, use fill instead", DeprecationWarning, stacklevel=2)
self.fill = self.fill_value

if self.mask_fill_value is not None:
warn("mask_fill_value is deprecated, use fill_mask instead", DeprecationWarning, stacklevel=2)
self.fill_mask = self.mask_fill_value

return self

def __init__(
Expand All @@ -98,8 +86,6 @@ def __init__(
num_masks_y: ScaleIntType = 0,
mask_x_length: ScaleIntType = 0,
mask_y_length: ScaleIntType = 0,
fill_value: DropoutFillValue | None = None,
mask_fill_value: ColorType | None = None,
fill: DropoutFillValue = 0,
fill_mask: ColorType | None = None,
p: float = 0.5,
Expand Down

0 comments on commit f08f1de

Please sign in to comment.