transformers/docs/source/en/model_doc/deformable_detr.md
Pavel Iakubovskii 998dbe068b
Add examples for detection models finetuning (#30422)
* Training script for object detection

* Evaluation script for object detection

* Training script for object detection with eval loop outside trainer

* Trainer DETR finetuning

* No trainer DETR finetuning

* Eval script

* Refine object detection example with trainer

* Remove commented code and enable telemetry

* No trainer example

* Add requirements for object detection examples

* Add test for trainer example

* Readme draft

* Fix uploading to HUB

* Readme improvements

* Update eval script

* Adding tests for object-detection examples

* Add object-detection example

* Add object-detection resources to docs

* Update README with custom dataset instructions

* Update year

* Replace valid with validation

* Update instructions for custom dataset

* Remove eval script

* Remove use_auth_token

* Add copied from and telemetry

* Fixup

* Update readme

* Fix id2label

* Fix links in docs

* Update examples/pytorch/object-detection/run_object_detection.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Update examples/pytorch/object-detection/run_object_detection.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Move description to the top

* Fix Trainer example

* Update no trainer example

* Update albumentations version

---------

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
2024-05-08 11:42:07 +01:00

3.9 KiB

Deformable DETR

Overview

The Deformable DETR model was proposed in Deformable DETR: Deformable Transformers for End-to-End Object Detection by Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, Jifeng Dai. Deformable DETR mitigates the slow convergence issues and limited feature spatial resolution of the original DETR by leveraging a new deformable attention module which only attends to a small set of key sampling points around a reference.

The abstract from the paper is the following:

DETR has been recently proposed to eliminate the need for many hand-designed components in object detection while demonstrating good performance. However, it suffers from slow convergence and limited feature spatial resolution, due to the limitation of Transformer attention modules in processing image feature maps. To mitigate these issues, we proposed Deformable DETR, whose attention modules only attend to a small set of key sampling points around a reference. Deformable DETR can achieve better performance than DETR (especially on small objects) with 10 times less training epochs. Extensive experiments on the COCO benchmark demonstrate the effectiveness of our approach.

drawing

Deformable DETR architecture. Taken from the original paper.

This model was contributed by nielsr. The original code can be found here.

Usage tips

  • Training Deformable DETR is equivalent to training the original DETR model. See the resources section below for demo notebooks.

Resources

A list of official Hugging Face and community (indicated by 🌎) resources to help you get started with Deformable DETR.

  • Demo notebooks regarding inference + fine-tuning on a custom dataset for [DeformableDetrForObjectDetection] can be found here.
  • Scripts for finetuning [DeformableDetrForObjectDetection] with [Trainer] or Accelerate can be found here.
  • See also: Object detection task guide.

If you're interested in submitting a resource to be included here, please feel free to open a Pull Request and we'll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource.

DeformableDetrImageProcessor

autodoc DeformableDetrImageProcessor - preprocess - post_process_object_detection

DeformableDetrFeatureExtractor

autodoc DeformableDetrFeatureExtractor - call - post_process_object_detection

DeformableDetrConfig

autodoc DeformableDetrConfig

DeformableDetrModel

autodoc DeformableDetrModel - forward

DeformableDetrForObjectDetection

autodoc DeformableDetrForObjectDetection - forward