You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How about adding also a probability to vary when Cutout is applied? For example something like this:
classCutout(object):
"""Randomly mask out one or more patches from an image. Args: n_holes (int): Number of patches to cut out of each image. length (int): The length (in pixels) of each square patch. p1 (float): Probability of applying CutOut (default value 1, always applied). """def__init__(self, n_holes, length, p1=1.0):
self.n_holes=n_holesself.length=lengthself.p1=p1def__call__(self, img):
""" Args: img (Tensor): Tensor image of size (C, H, W). Returns: Tensor: Image with n_holes of dimension length x length cut out of it. """iftorch.rand(1) >p1: #np.random.rand(1) > p1: returnimg# [...]returnimg
So, when np.random.rand(1) is larger than p1 the input image is returned unchanged (most of the time if p1 is small), if I got it right.
The text was updated successfully, but these errors were encountered:
How about adding also a probability to vary when
Cutout
is applied? For example something like this:So, when
np.random.rand(1)
is larger thanp1
the input image is returned unchanged (most of the time ifp1
is small), if I got it right.The text was updated successfully, but these errors were encountered: