Add DeiT (PyTorch) (#11056)

* First draft of deit

* More improvements

* Remove DeiTTokenizerFast from init

* Conversion script works

* Add DeiT to ViT conversion script

* Add tests, add head model, add support for deit in vit conversion script

* Update model checkpoint names

* Update image_mean and image_std, set resample to bicubic

* Improve docs

* Docs improvements

* Add DeiTForImageClassificationWithTeacher to init

* Address comments by @sgugger

* Improve feature extractors

* Make fix-copies

* Minor fixes

* Address comments by @patil-suraj

* All models uploaded

* Fix tests

* Remove labels argument from DeiTForImageClassificationWithTeacher

* Fix-copies, style and quality

* Fix tests

* Fix typo

* Multiple docs improvements

* More docs fixes
This commit is contained in:
NielsRogge
2021-04-13 00:07:10 +02:00
committed by GitHub
parent cb251ba619
commit 9f1260971f
25 changed files with 2271 additions and 108 deletions

View File

@@ -42,11 +42,11 @@ class ViTFeatureExtractionTester(unittest.TestCase):
image_size=18,
min_resolution=30,
max_resolution=400,
image_mean=[0.5, 0.5, 0.5],
image_std=[0.5, 0.5, 0.5],
do_normalize=True,
do_resize=True,
size=18,
do_normalize=True,
image_mean=[0.5, 0.5, 0.5],
image_std=[0.5, 0.5, 0.5],
):
self.parent = parent
self.batch_size = batch_size
@@ -54,11 +54,11 @@ class ViTFeatureExtractionTester(unittest.TestCase):
self.image_size = image_size
self.min_resolution = min_resolution
self.max_resolution = max_resolution
self.image_mean = image_mean
self.image_std = image_std
self.do_normalize = do_normalize
self.do_resize = do_resize
self.size = size
self.do_normalize = do_normalize
self.image_mean = image_mean
self.image_std = image_std
def prepare_feat_extract_dict(self):
return {