https://github.com/hanouticelina/deformable-detr
Implementation of the paper : Deformable DETR: Deformable Transformers for End-to-End Object Detection (ICLR 2021)
https://github.com/hanouticelina/deformable-detr
computer-vision deformable-convnets detr object-detection transformers
Last synced: 8 months ago
JSON representation
Implementation of the paper : Deformable DETR: Deformable Transformers for End-to-End Object Detection (ICLR 2021)
- Host: GitHub
- URL: https://github.com/hanouticelina/deformable-detr
- Owner: hanouticelina
- License: mit
- Created: 2021-01-18T16:03:05.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-16T15:20:27.000Z (about 5 years ago)
- Last Synced: 2023-05-30T04:05:12.161Z (about 3 years ago)
- Topics: computer-vision, deformable-convnets, detr, object-detection, transformers
- Language: Python
- Homepage:
- Size: 24.6 MB
- Stars: 19
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Deformable DETR: Deformable Transformers for End-to-End Object Detection
**Hakim Chekirou, Celina Hanouti & Aymen Merrouche (Equal Contribution)**

This repository contains an implementation of the paper "Deformable Transformers for End-to-End Object Detection" : https://arxiv.org/pdf/2010.04159.pdf
We provide scratch implementation of the following modules :
* `deformable_transformer.py`, `decoder.py`, `encoder.py`, `deformable_detr.py` and `MultiHeadAttention.py`.
the remaining modules are mainly copied from the original DETR implementation : https://github.com/facebookresearch/detr
## Requirements
`pip install -r requirements.txt`
## Dataset
The `coco_extraction.py` script provides functions for creating an annotation file for coco with only the specified class indexes. It removes all images and bounding boxes not containning at least one of those classes. We kept only five randomly sampled classes from 91 available, `bear`, `bus`, `tie`, `toilet` and `vase`. The annotation files are `datasets/coco_light/coco_light_train.json` for the train set and `datasets/coco_light/coco_light_train.json` for the validation set. `Coco lignt` contains ~ 15K images in the train set and 656 images on the validation set.
## Usage
`git clone https://github.com/hanouticelina/deformable-DETR.git`
`cd deformable-DETR`
### Training
The command for training Deformable DETR is as following:
`python main.py --enc_layers 3 --dec_layers 3 --batch_size 1`
Training convergence takes 72 GPU hours on a single GPU GeForce RTX 2080.
### Evaluation
To evaluate Deformable DETR on a subset of COCO 2017 validation set with a single GPU run:
` --resume --eval`
Pre-trained model can be found at : https://www.dropbox.com/s/vnkbfrui1ldwtah/checkpoint.pth?dl=0
## References
Xizhou Zhu et al., Deformable Transformers for End-to-End Object Detection.
Nicolas Carion et al., End-to-End Object Detection with Transformers.