Unverified Commit d3eacbb8 authored by NielsRogge's avatar NielsRogge Committed by GitHub
Browse files

Add DETR (#11653)



* Squash all commits of modeling_detr_v7 branch into one

* Improve docs

* Fix tests

* Style

* Improve docs some more and fix most tests

* Fix slow tests of ViT, DeiT and DETR

* Improve replacement of batch norm

* Restructure timm backbone forward

* Make DetrForSegmentation support any timm backbone

* Fix name of output

* Address most comments by @LysandreJik

* Give better names for variables

* Conditional imports + timm in setup.py

* Address additional comments by @sgugger

* Make style, add require_timm and require_vision to testsé

* Remove train_backbone attribute of DetrConfig, add methods to freeze/unfreeze backbone

* Add png files to fixtures

* Fix type hint

* Add timm to workflows

* Add `BatchNorm2d` to the weight initialization

* Fix retain_grad test

* Replace model checkpoints by Facebook namespace

* Fix name of checkpoint in test

* Add user-friendly message when scipy is not available

* Address most comments by @patrickvonplaten

* Remove return_intermediate_layers attribute of DetrConfig and simplify Joiner

* Better initialization

* Scipy is necessary to get sklearn metrics

* Rename TimmBackbone to DetrTimmConvEncoder and rename DetrJoiner to DetrConvModel

* Make style

* Improve docs and add 2 community notebooks
Co-authored-by: default avatarLysandre <lysandre.debut@reseau.eseo.fr>
parent d14e0af2
......@@ -47,11 +47,26 @@ class ImageClassificationPipelineTests(unittest.TestCase):
"http://images.cocodataset.org/val2017/000000039769.jpg",
]
},
{"images": "tests/fixtures/coco.jpg"},
{"images": ["tests/fixtures/coco.jpg", "tests/fixtures/coco.jpg"]},
{"images": Image.open("tests/fixtures/coco.jpg")},
{"images": [Image.open("tests/fixtures/coco.jpg"), Image.open("tests/fixtures/coco.jpg")]},
{"images": [Image.open("tests/fixtures/coco.jpg"), "tests/fixtures/coco.jpg"]},
{"images": "./tests/fixtures/tests_samples/COCO/000000039769.png"},
{
"images": [
"./tests/fixtures/tests_samples/COCO/000000039769.png",
"./tests/fixtures/tests_samples/COCO/000000039769.png",
]
},
{"images": Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png")},
{
"images": [
Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"),
Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"),
]
},
{
"images": [
Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"),
"./tests/fixtures/tests_samples/COCO/000000039769.png",
]
},
]
def test_small_model_from_factory(self):
......
......@@ -38,6 +38,9 @@ IGNORE_NON_TESTED = [
"BigBirdPegasusEncoder", # Building part of bigger (tested) model.
"BigBirdPegasusDecoder", # Building part of bigger (tested) model.
"BigBirdPegasusDecoderWrapper", # Building part of bigger (tested) model.
"DetrEncoder", # Building part of bigger (tested) model.
"DetrDecoder", # Building part of bigger (tested) model.
"DetrDecoderWrapper", # Building part of bigger (tested) model.
"M2M100Encoder", # Building part of bigger (tested) model.
"M2M100Decoder", # Building part of bigger (tested) model.
"Speech2TextEncoder", # Building part of bigger (tested) model.
......@@ -95,6 +98,7 @@ IGNORE_NON_AUTO_CONFIGURED = [
"CLIPVisionModel",
"FlaxCLIPTextModel",
"FlaxCLIPVisionModel",
"DetrForSegmentation",
"DPRReader",
"DPRSpanPredictor",
"FlaubertForQuestionAnswering",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment