We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 037e5e6 commit 7cedc8dCopy full SHA for 7cedc8d
timm/data/auto_augment.py
@@ -36,11 +36,16 @@
36
img_mean=_FILL,
37
)
38
39
-_RANDOM_INTERPOLATION = (Image.BILINEAR, Image.BICUBIC)
+if hasattr(Image, "Resampling"):
40
+ _RANDOM_INTERPOLATION = (Image.Resampling.BILINEAR, Image.Resampling.BICUBIC)
41
+ _DEFAULT_INTERPOLATION = Image.Resampling.BICUBIC
42
+else:
43
+ _RANDOM_INTERPOLATION = (Image.BILINEAR, Image.BICUBIC)
44
+ _DEFAULT_INTERPOLATION = Image.BICUBIC
45
46
47
def _interpolation(kwargs):
- interpolation = kwargs.pop('resample', Image.BILINEAR)
48
+ interpolation = kwargs.pop('resample', _DEFAULT_INTERPOLATION)
49
if isinstance(interpolation, (list, tuple)):
50
return random.choice(interpolation)
51
else:
0 commit comments