nielsr's picture
nielsr HF Staff
Update model card with paper, code and usage info
9d8c7e1 verified
|
raw
history blame
2.73 kB
metadata
license: apache-2.0
pipeline_tag: object-detection
tags:
  - model_hub_mixin
  - pytorch_model_hub_mixin
  - object-detection

DEIMv2-Pico

DEIMv2 is an evolution of the DEIM (Dense One-to-One DETR) framework, leveraging features from DINOv3 for real-time object detection. The DEIMv2-Pico variant is an ultra-lightweight model designed for mobile and edge deployment, achieving 38.5 AP on COCO with only 1.5 million parameters.

Model Description

DEIMv2 establishes new state-of-the-art results for real-time DETRs across various model sizes. For the ultra-lightweight variants like Pico, the model utilizes an HGNetv2 backbone with depth and width pruning, a Lite encoder, and a simplified decoder. This design enables a superior performance-cost trade-off, matching the performance of larger models like YOLOv10-Nano with significantly fewer parameters.

Usage

You can load this model using the PyTorchModelHubMixin integration. To use it, you need to have the official DEIMv2 source code in your Python path to import the necessary modules.

import torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin

# The following imports require the source code from the DEIMv2 repository
from engine.backbone import HGNetv2
from engine.deim import LiteEncoder, DEIMTransformer
from engine.deim.postprocessor import PostProcessor

class DEIMv2(nn.Module, PyTorchModelHubMixin):
    def __init__(self, config):
        super().__init__()
        self.backbone = HGNetv2(**config["HGNetv2"])
        self.encoder = LiteEncoder(**config["LiteEncoder"])
        self.decoder = DEIMTransformer(**config["DEIMTransformer"])
        self.postprocessor = PostProcessor(**config["PostProcessor"])

    def forward(self, x, orig_target_sizes):
        x = self.backbone(x)
        x = self.encoder(x)
        x = self.decoder(x)
        x = self.postprocessor(x, orig_target_sizes)
        return x

# Load the model from the Hub
model = DEIMv2.from_pretrained("Intellindust/DEIMv2_HGNetv2_PICO_COCO")
model.eval()

Citation

If you find DEIMv2 useful in your research, please cite:

@article{huang2025deimv2,
  title={Real-Time Object Detection Meets DINOv3},
  author={Huang, Shihua and Hou, Yongjie and Liu, Longfei and Yu, Xuanlong and Shen, Xi},
  journal={arXiv},
  year={2025}
}