SAVRN
Search Contact SAVRN

Open-weight model · Object detection

dab-detr-resnet-50

by IDEA-Research IDEA-Research/dab-detr-resnet-50

This is the model card of a transformers model that has been pushed on the Hub. Use the code below to get started with the model.

Parameters44M
Context
Weights350.5 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads19.5k

Runs On

What it takes to serve dab-detr-resnet-50 (44M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.0 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By IDEA-Research, published under apache-2.0, revision d8e2856ee1f7.

This is the model card of a transformers model that has been pushed on the Hub. Use the code below to get started with the model. This should output The DAB-DETR model was trained on COCO 2017 object detection, a dataset consisting of 118k/5k annotated images for training/validation respectively. Following Deformable DETR and Conditional DETR, we use 300 anchors as queries. We select 300 predicted boxes and labels with the largest classification logits for evaluation as well. We also use focal loss (Lin et al., 2020) with α = 0.25, γ = 2 for classification. The same loss terms are used in bipartite matching and final loss calculating, but with different coefficients. Classification loss…

Read IDEA-Research's full model card

Model Card for Model ID

Table of Contents

  1. Model Details
  2. Model Sources
  3. How to Get Started with the Model
  4. Training Details
  5. Evaluation
  6. Model Architecture and Objective
  7. Citation

Model Details

We present in this paper a novel query formulation using dynamic anchor boxes for DETR (DEtection TRansformer) and offer a deeper understanding of the role of queries in DETR. This new formulation directly uses box coordinates as queries in Transformer decoders and dynamically updates them layer-by-layer. Using box coordinates not only helps using explicit positional priors to improve the query-to-feature similarity and eliminate the slow training convergence issue in DETR, but also allows us to modulate the positional attention map using the box width and height information. Such a design makes it clear that queries in DETR can be implemented as performing soft ROI pooling layer-by-layer in a cascade manner. As a result, it leads to the best performance on MS-COCO benchmark among the DETR-like detection models under the same setting, e.g., AP 45.7\% using ResNet50-DC5 as backbone trained in 50 epochs. We also conducted extensive experiments to confirm our analysis and verify the effectiveness of our methods.

Model Description

This is the model card of a transformers model that has been pushed on the Hub. This model card has been automatically generated.

  • Developed by: Shilong Liu, Feng Li, Hao Zhang, Xiao Yang, Xianbiao Qi, Hang Su, Jun Zhu, Lei Zhang
  • Funded by: IDEA-Research
  • Shared by: David Hajdu
  • Model type: DAB-DETR
  • License: Apache-2.0

Model Sources

  • Repository: https://github.com/IDEA-Research/DAB-DETR
  • Paper: https://arxiv.org/abs/2201.12329

How to Get Started with the Model

Use the code below to get started with the model.

import torch
import requests

from PIL import Image
from transformers import AutoModelForObjectDetection, AutoImageProcessor

url = 'http://images.cocodataset.org/val2017/000000039769.jpg' 
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("IDEA-Research/dab-detr-resnet-50")
model = AutoModelForObjectDetection.from_pretrained("IDEA-Research/dab-detr-resnet-50")

inputs = image_processor(images=image, return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

results = image_processor.post_process_object_detection(outputs, target_sizes=torch.tensor([image.size[::-1]]), threshold=0.3)

for result in results:
    for score, label_id, box in zip(result["scores"], result["labels"], result["boxes"]):
        score, label = score.item(), label_id.item()
        box = [round(i, 2) for i in box.tolist()]
        print(f"{model.config.id2label[label]}: {score:.2f} {box}")

This should output

cat: 0.87 [14.7, 49.39, 320.52, 469.28]
remote: 0.86 [41.08, 72.37, 173.39, 117.2]
cat: 0.86 [344.45, 19.43, 639.85, 367.86]
remote: 0.61 [334.27, 75.93, 367.92, 188.81]
couch: 0.59 [-0.04, 1.34, 639.9, 477.09]

Training Details

Training Data

The DAB-DETR model was trained on COCO 2017 object detection, a dataset consisting of 118k/5k annotated images for training/validation respectively.

Training Procedure

Following Deformable DETR and Conditional DETR, we use 300 anchors as queries. We select 300 predicted boxes and labels with the largest classification logits for evaluation as well. We also use focal loss (Lin et al., 2020) with α = 0.25, γ = 2 for classification. The same loss terms are used in bipartite matching and final loss calculating, but with different coefficients. Classification loss with coefficient 2.0 is used in pipartite matching but 1.0 in the final loss. L1 loss with coefficient 5.0 and GIOU loss (Rezatofighi et al., 2019) with coefficient 2.0 are consistent in both the matching and the final loss calculation procedures. All models are trained on 16 GPUs with 1 image per GPU and AdamW (Loshchilov & Hutter, 2018) is used for training with weight decay 10−4. The learning rates for backbone and other modules are set to 10−5 and 10−4 respectively. We train our models for 50 epochs and drop the learning rate by 0.1 after 40 epochs. All models are trained on Nvidia A100 GPU. We search hyperparameters with batch size 64 and all results in our paper are reported with batch size 16

Preprocessing

Images are resized/rescaled such that the shortest side is at least 480 and at most 800 pixels and the long size is at most 1333 pixels, and normalized across the RGB channels with the ImageNet mean (0.485, 0.456, 0.406) and standard deviation (0.229, 0.224, 0.225).

Training Hyperparameters

  • Training regime:
Key Value
activation_dropout 0.0
activation_function prelu
attention_dropout 0.0
auxiliary_loss false
backbone resnet50
bbox_cost 5
bbox_loss_coefficient 5
class_cost 2
cls_loss_coefficient 2
decoder_attention_heads 8
decoder_ffn_dim 2048
decoder_layers 6
dropout 0.1
encoder_attention_heads 8
encoder_ffn_dim 2048
encoder_layers 6
focal_alpha 0.25
giou_cost 2
giou_loss_coefficient 2
hidden_size 256
init_std 0.02
init_xavier_std 1.0
initializer_bias_prior_prob null
keep_query_pos false
normalize_before false
num_hidden_layers 6
num_patterns 0
num_queries 300
query_dim 4
random_refpoints_xy false
sine_position_embedding_scale null
temperature_height 20
temperature_width 20

Evaluation

Model Architecture and Objective

Overview of DAB-DETR. We extract image spatial features using a CNN backbone followed with Transformer encoders to refine the CNN features. Then dual queries, including positional queries (anchor boxes) and content queries (decoder embeddings), are fed into the decoder to probe the objects which correspond to the anchors and have similar patterns with the content queries. The dual queries are updated layer-by-layer to get close to the target ground-truth objects gradually. The outputs of the final decoder layer are used to predict the objects with labels and boxes by prediction heads, and then a bipartite graph matching is conducted to calculate loss as in DETR.

Citation

BibTeX:

@inproceedings{
  liu2022dabdetr,
  title={{DAB}-{DETR}: Dynamic Anchor Boxes are Better Queries for {DETR}},
  author={Shilong Liu and Feng Li and Hao Zhang and Xiao Yang and Xianbiao Qi and Hang Su and Jun Zhu and Lei Zhang},
  booktitle={International Conference on Learning Representations},
  year={2022},
  url={https://openreview.net/forum?id=oMI9PjOb9Jl}
}

Model Card Authors

David Hajdu

Configuration

Architecture
DabDetrForObjectDetection
Layers
6
Hidden size
256
Stored precision
float32
Model type
dab-detr

Identity and Version

Repository
IDEA-Research/dab-detr-resnet-50
Publisher
IDEA-Research
Task
Object detection
Modality
Image
Library
transformers
Parameters
44M parameters
Languages
en
Revision
d8e2856ee1f7a28088f0b8069ceebf2a44cb5042
First published
2024-05-29
Last updated
2025-01-31

Files and Weights

6 files, 350.5 MB in total. The weights are 2 files totalling 350.5 MB in bin, safetensors.

Weights2 files · 350.5 MB
Configuration2 files · 5.1 KB
Documentation1 file · 13.3 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights175.2 MB 39bac44c35ef
pytorch_model.binWeights175.3 MB 45c7cc8a1322
config.jsonConfiguration4.6 KB
preprocessor_config.jsonConfiguration466 B
README.mdDocumentation13.3 KB
.gitattributesRepository1.5 KB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
350.5 MB
Download from IDEA-Research

Released by IDEA-Research through its official repository on Hugging Face. Read the license.

Built From

  • Described by arXiv:2201.12329

Memory Requirements

PrecisionWeights in memory
As published350.5 MB
16-bit0.1 GB
8-bit0.0 GB
4-bit0.0 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About dab-detr-resnet-50

How much GPU memory does dab-detr-resnet-50 need?

About 0.1 GB at 16-bit and 0 GB at 4-bit: the weights (44M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run dab-detr-resnet-50 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use dab-detr-resnet-50 commercially?

Yes. dab-detr-resnet-50 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Object detection

conditional-detr-resnet-50

Microsoft

Conditional DEtection TRansformer (DETR) model trained end-to-end on COCO 2017 object detection (118k annotated images). It was introduced in the paper Conditional DETR for Fast Training Convergence by Meng et al. and first released in this repository. The recently-developed DETR approach applies the transformer encoder and decoder architecture to object detection and achieves promising performance. In this paper, we handle the critical issue, slow training convergence, and present a conditional cross-attention mechanism for fast DETR training. Our approach is motivated by that the cross-attention in DETR relies highly on the content embeddings for localizing the four extremities and…

Open weights apache-2.0 44M parameters 1,024 tokens transformers

Model · Object detection

fashion-object-detection

Yainage90

This model is fine-tuned version of microsoft/conditional-detr-resnet-50. You can find details of model in this github repo -> fashion-visual-search And you can find fashion image feature extractor model -> yainage90/fashion-image-feature-extractor This model was trained using a combination of two datasets: modanet and fashionpedia The labels are ['bag', 'bottom', 'dress', 'hat', 'shoes', 'outer', 'top'] In the 96th epoch out of total of 100 epochs, the best score was achieved with mAP 0.7542. Therefore, it is believed that there is a little room for performance improvement.

Open weights mit 44M parameters 1,024 tokens transformers

Model · Object detection

rtdetr_v2_r50vd

Peking University

The RT-DETRv2 model was proposed in RT-DETRv2: Improved Baseline with Bag-of-Freebies for Real-Time Detection Transformer by Wenyu Lv, Yian Zhao, Qinyao Chang, Kui Huang, Guanzhong Wang, Yi Liu. RT-DETRv2 refines RT-DETR by introducing selective multi-scale feature extraction, a discrete sampling operator for broader deployment compatibility, and improved training strategies like dynamic data augmentation and scale-adaptive hyperparameters. These changes enhance flexibility and practicality while maintaining real-time performance. This model was contributed by @jadechoghari with the help of @cyrilvallez and @qubvel-hf This is RT-DETRv2 consistently outperforms its predecessor across all…

Open weights apache-2.0 43M parameters transformers

Model · Object detection

rtdetr_r50vd_coco_o365

Peking University

However, we observe that the speed and accuracy of YOLOs are negatively affected by the NMS. Recently, end-to-end Transformer-based detectors (DETRs) have provided an alternative to eliminating NMS. Nevertheless, the high computational cost limits their practicality and hinders them from fully exploiting the advantage of excluding NMS. In this paper, we propose the Real-Time DEtection TRansformer (RT-DETR), the first real-time end-to-end object detector to our best knowledge that addresses the above dilemma. We build RT-DETR in two steps, drawing on the advanced DETR: first we focus on maintaining accuracy while improving speed, followed by maintaining speed while improving accuracy.…

Open weights apache-2.0 43M parameters transformers

Model · Object detection

rtdetr_r50vd

Peking University

However, we observe that the speed and accuracy of YOLOs are negatively affected by the NMS. Recently, end-to-end Transformer-based detectors (DETRs) have provided an alternative to eliminating NMS. Nevertheless, the high computational cost limits their practicality and hinders them from fully exploiting the advantage of excluding NMS. In this paper, we propose the Real-Time DEtection TRansformer (RT-DETR), the first real-time end-to-end object detector to our best knowledge that addresses the above dilemma. We build RT-DETR in two steps, drawing on the advanced DETR: first we focus on maintaining accuracy while improving speed, followed by maintaining speed while improving accuracy.…

Open weights apache-2.0 43M parameters transformers

Model · Object detection

detr-resnet-50

AI at Meta

DEtection TRansformer (DETR) model trained end-to-end on COCO 2017 object detection (118k annotated images). It was introduced in the paper End-to-End Object Detection with Transformers by Carion et al. and first released in this repository. Disclaimer: The team releasing DETR did not write a model card for this model so this model card has been written by the Hugging Face team. The DETR model is an encoder-decoder transformer with a convolutional backbone. Two heads are added on top of the decoder outputs in order to perform object detection: a linear layer for the class labels and a MLP (multi-layer perceptron) for the bounding boxes. The model uses so-called object queries to detect…

Open weights apache-2.0 42M parameters 1,024 tokens transformers