Update model card with paper, code, and usage info
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,10 +1,68 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- model_hub_mixin
|
| 4 |
- pytorch_model_hub_mixin
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
pipeline_tag: object-detection
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
license: apache-2.0
|
| 5 |
tags:
|
| 6 |
- model_hub_mixin
|
| 7 |
- pytorch_model_hub_mixin
|
| 8 |
---
|
| 9 |
|
| 10 |
+
# DEIMv2-Atto
|
| 11 |
+
|
| 12 |
+
DEIMv2-Atto is a real-time object detection model introduced in the paper [Real-Time Object Detection Meets DINOv3](https://huggingface.co/papers/2509.20787). It is the ultra-lightweight entry in the DEIMv2 series, which leverages DINOv3 features to achieve state-of-the-art performance-cost trade-offs.
|
| 13 |
+
|
| 14 |
+
- **Project Page:** [https://intellindust-ai-lab.github.io/projects/DEIMv2/](https://intellindust-ai-lab.github.io/projects/DEIMv2/)
|
| 15 |
+
- **Repository:** [https://github.com/Intellindust-AI-Lab/DEIMv2](https://github.com/Intellindust-AI-Lab/DEIMv2)
|
| 16 |
+
|
| 17 |
+
## Model Description
|
| 18 |
+
Benefiting from the simplicity and effectiveness of Dense O2O and MAL, DEIM has become a mainstream training framework for real-time DETRs. DEIMv2-Atto employs HGNetv2 with depth and width pruning to meet strict resource budgets. Together with a simplified decoder and an upgraded Dense O2O, this unified design enables DEIMv2 to achieve a superior performance-cost trade-off, making it suitable for GPU, edge, and mobile deployment.
|
| 19 |
+
|
| 20 |
+
| Model | Dataset | AP | #Params | GFLOPs | Latency (ms) |
|
| 21 |
+
| :---: | :---: | :---: | :---: | :---: | :---: |
|
| 22 |
+
| **Atto** | COCO | **23.8** | 0.5M | 0.8 | 1.10 |
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
To use this model, you need to have the DEIMv2 repository code available to define the architecture. You can then load the model from the Hub as follows:
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
import torch.nn as nn
|
| 29 |
+
from huggingface_hub import PyTorchModelHubMixin
|
| 30 |
+
|
| 31 |
+
# Ensure the DEIMv2 components from the official GitHub repo are in your python path
|
| 32 |
+
from engine.backbone import HGNetv2
|
| 33 |
+
from engine.deim import LiteEncoder
|
| 34 |
+
from engine.deim import DEIMTransformer
|
| 35 |
+
from engine.deim.postprocessor import PostProcessor
|
| 36 |
+
|
| 37 |
+
class DEIMv2(nn.Module, PyTorchModelHubMixin):
|
| 38 |
+
def __init__(self, config):
|
| 39 |
+
super().__init__()
|
| 40 |
+
self.backbone = HGNetv2(**config["HGNetv2"])
|
| 41 |
+
self.encoder = LiteEncoder(**config["LiteEncoder"])
|
| 42 |
+
self.decoder = DEIMTransformer(**config["DEIMTransformer"])
|
| 43 |
+
self.postprocessor = PostProcessor(**config["PostProcessor"])
|
| 44 |
+
|
| 45 |
+
def forward(self, x, orig_target_sizes):
|
| 46 |
+
x = self.backbone(x)
|
| 47 |
+
x = self.encoder(x)
|
| 48 |
+
x = self.decoder(x)
|
| 49 |
+
x = self.postprocessor(x, orig_target_sizes)
|
| 50 |
+
|
| 51 |
+
return x
|
| 52 |
+
|
| 53 |
+
# Load the model from the hub
|
| 54 |
+
model = DEIMv2.from_pretrained("Intellindust/DEIMv2_HGNetv2_ATTO_COCO")
|
| 55 |
+
model.eval()
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Citation
|
| 59 |
+
If you use `DEIMv2` or its methods in your work, please cite the following:
|
| 60 |
+
|
| 61 |
+
```bibtex
|
| 62 |
+
@article{huang2025deimv2,
|
| 63 |
+
title={Real-Time Object Detection Meets DINOv3},
|
| 64 |
+
author={Huang, Shihua and Hou, Yongjie and Liu, Longfei and Yu, Xuanlong and Shen, Xi},
|
| 65 |
+
journal={arXiv},
|
| 66 |
+
year={2025}
|
| 67 |
+
}
|
| 68 |
+
```
|