@@ -263,7 +263,7 @@ class RandAugment(torch.nn.Module):
263
263
image. If given a number, the value is used for all bands respectively.
264
264
"""
265
265
266
- def __init__ (self , num_ops : int = 2 , magnitude : int = 9 , num_magnitude_bins : int = 30 ,
266
+ def __init__ (self , num_ops : int = 2 , magnitude : int = 9 , num_magnitude_bins : int = 31 ,
267
267
interpolation : InterpolationMode = InterpolationMode .NEAREST ,
268
268
fill : Optional [List [float ]] = None ) -> None :
269
269
super ().__init__ ()
@@ -276,6 +276,7 @@ def __init__(self, num_ops: int = 2, magnitude: int = 9, num_magnitude_bins: int
276
276
def _augmentation_space (self , num_bins : int , image_size : List [int ]) -> Dict [str , Tuple [Tensor , bool ]]:
277
277
return {
278
278
# op_name: (magnitudes, signed)
279
+ "Identity" : (torch .tensor (0.0 ), False ),
279
280
"ShearX" : (torch .linspace (0.0 , 0.3 , num_bins ), True ),
280
281
"ShearY" : (torch .linspace (0.0 , 0.3 , num_bins ), True ),
281
282
"TranslateX" : (torch .linspace (0.0 , 150.0 / 331.0 * image_size [0 ], num_bins ), True ),
@@ -289,7 +290,6 @@ def _augmentation_space(self, num_bins: int, image_size: List[int]) -> Dict[str,
289
290
"Solarize" : (torch .linspace (256.0 , 0.0 , num_bins ), False ),
290
291
"AutoContrast" : (torch .tensor (0.0 ), False ),
291
292
"Equalize" : (torch .tensor (0.0 ), False ),
292
- "Invert" : (torch .tensor (0.0 ), False ),
293
293
}
294
294
295
295
def forward (self , img : Tensor ) -> Tensor :
@@ -345,7 +345,7 @@ class TrivialAugmentWide(torch.nn.Module):
345
345
image. If given a number, the value is used for all bands respectively.
346
346
"""
347
347
348
- def __init__ (self , num_magnitude_bins : int = 30 , interpolation : InterpolationMode = InterpolationMode .NEAREST ,
348
+ def __init__ (self , num_magnitude_bins : int = 31 , interpolation : InterpolationMode = InterpolationMode .NEAREST ,
349
349
fill : Optional [List [float ]] = None ) -> None :
350
350
super ().__init__ ()
351
351
self .num_magnitude_bins = num_magnitude_bins
0 commit comments