Skip to content

Commit

Permalink
docstring refinements (#1047)
Browse files Browse the repository at this point in the history
* docstring refinements

Make `MaskDrop` docstring consistent with others and fix a missing hanging indent.

* W293 fix

fix W293 blank line contains whitespace

Co-authored-by: Vladimir Iglovikov <ternaus@users.noreply.github.com>
  • Loading branch information
shyn and ternaus committed Dec 1, 2021
1 parent 6de7dd0 commit 28c6049
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions albumentations/augmentations/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ class Solarize(ImageOnlyTransform):
Args:
threshold ((int, int) or int, or (float, float) or float): range for solarizing threshold.
If threshold is a single value, the range will be [threshold, threshold]. Default: 128.
If threshold is a single value, the range will be [threshold, threshold]. Default: 128.
p (float): probability of applying the transform. Default: 0.5.
Targets:
Expand Down Expand Up @@ -2606,6 +2606,18 @@ class MaskDropout(DualTransform):
Image can be any number of channels.
Inspired by https://www.kaggle.com/c/severstal-steel-defect-detection/discussion/114254
Args:
max_objects: Maximum number of labels that can be zeroed out. Can be tuple, in this case it's [min, max]
image_fill_value: Fill value to use when filling image.
Can be 'inpaint' to apply inpaining (works only for 3-chahnel images)
mask_fill_value: Fill value to use when filling mask.
Targets:
image, mask
Image types:
uint8, float32
"""

def __init__(
Expand All @@ -2616,19 +2628,6 @@ def __init__(
always_apply=False,
p=0.5,
):
"""
Args:
max_objects: Maximum number of labels that can be zeroed out. Can be tuple, in this case it's [min, max]
image_fill_value: Fill value to use when filling image.
Can be 'inpaint' to apply inpaining (works only for 3-chahnel images)
mask_fill_value: Fill value to use when filling mask.
Targets:
image, mask
Image types:
uint8, float32
"""
super(MaskDropout, self).__init__(always_apply, p)
self.max_objects = to_tuple(max_objects, 1)
self.image_fill_value = image_fill_value
Expand Down

0 comments on commit 28c6049

Please sign in to comment.