Commit Graph

13 Commits (5895056dc46f0b826dd3676a1af3b19da903c688)

Author SHA1 Message Date
Jakub Kaczmarzyk db64393c0d
use `Image.Resampling` namespace for PIL mapping (#1256)
* use `Image.Resampling` namespace for PIL mapping

PIL shows a deprecation warning when accessing resampling constants via the `Image` namespace. The suggested namespace is `Image.Resampling`. This commit updates `_pil_interpolation_to_str` to use the `Image.Resampling` namespace.

```
/tmp/ipykernel_11959/698124036.py:2: DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
  Image.NEAREST: 'nearest',
/tmp/ipykernel_11959/698124036.py:3: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
  Image.BILINEAR: 'bilinear',
/tmp/ipykernel_11959/698124036.py:4: DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
  Image.BICUBIC: 'bicubic',
/tmp/ipykernel_11959/698124036.py:5: DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
  Image.BOX: 'box',
/tmp/ipykernel_11959/698124036.py:6: DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
  Image.HAMMING: 'hamming',
/tmp/ipykernel_11959/698124036.py:7: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
  Image.LANCZOS: 'lanczos',
```

* use new pillow resampling enum only if it exists
2022-06-12 22:30:57 -07:00
Ross Wightman a41de1f666 Add interpolation mode handling to transforms. Removes InterpolationMode warning. Works for torchvision versions w/ and w/o InterpolationMode enum. Fix #738. 2021-10-28 17:35:01 -07:00
Ross Wightman d584e7f617 Support for huggingface hub via create_model and default_cfgs.
* improve consistency of model creation helper fns
* add comments to some of the model helpers
* support passing external default_cfgs so they can be sourced from hub
2021-03-16 22:48:26 -07:00
Ross Wightman 232ab7fb12 Working on an implementation of AugMix with JensenShannonDivergence loss that's compatible with my AutoAugment and RandAugment impl 2019-12-20 23:04:11 -08:00
Ross Wightman 31453b039e Update Auto/RandAugment comments, README, more.
* Add a weighted choice option for RandAugment
* Adjust magnitude noise/std naming, config
2019-11-22 13:24:52 -08:00
Ross Wightman 4243f076f1 Adding RandAugment to AutoAugment impl, some tweaks to AA included 2019-11-21 21:14:33 -08:00
Ross Wightman 4002c0d4ce Fix AutoAugment abs translate calc 2019-09-01 22:07:45 -07:00
Ross Wightman b750b76f67 More AutoAugment work. Ready to roll... 2019-09-01 16:55:42 -07:00
Ross Wightman 25d2088d9e Working on auto-augment 2019-08-31 23:09:48 -07:00
Ross Wightman 66634d2200 Add support to split random erasing blocks into randomly selected number with --recount arg. Fix random selection of aspect ratios. 2019-08-12 16:01:58 -07:00
Ross Wightman 65a634626f Switch random erasing to doing normal_() on CPU to avoid instability, remove a debug print 2019-06-29 10:03:13 -07:00
Ross Wightman c6b32cbe73 A number of tweaks to arguments, epoch handling, config
* reorganize train args
* allow resolve_data_config to be used with dict args, not just arparse
* stop incrementing epoch before save, more consistent naming vs csv, etc
* update resume and start epoch handling to match above
* stop auto-incrementing epoch in scheduler
2019-06-28 13:49:20 -07:00
Ross Wightman aa4354f466 Big re-org, working towards making pip/module as 'timm' 2019-06-19 17:20:51 -07:00