license: apache-2.0
pipeline_tag: object-detection
tags:
- model_hub_mixin
- pytorch_model_hub_mixin
DEIMv2-Femto
DEIMv2 is a real-time object detection framework introduced in the paper Real-Time Object Detection Meets DINOv3. This specific checkpoint is the Femto variant, which is an ultra-lightweight model designed for mobile and edge deployment.
- Paper: Real-Time Object Detection Meets DINOv3
- Repository: Intellindust-AI-Lab/DEIMv2
- Project Page: DEIMv2 Project Webpage
Model Description
DEIMv2 represents an evolution of the DEIM framework, leveraging features from DINOv3. For ultra-lightweight models (Nano, Pico, Femto, and Atto), the architecture employs HGNetv2 with depth and width pruning. Combined with a simplified decoder and an upgraded Dense O2O training objective, DEIMv2 achieves superior performance-cost trade-offs compared to prior real-time detectors like the YOLO series.
Sample Usage
This model can be loaded using the PyTorchModelHubMixin integration. To use it, ensure you have the official repository code available to provide the necessary component definitions.
import torch.nn as nn
from huggingface_hub import PyTorchModelHubMixin
# Ensure the engine modules from the official repo are in your path
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 pretrained model
model = DEIMv2.from_pretrained("Intellindust/DEIMv2_HGNetv2_FEMTO_COCO")
model.eval()
Citation
@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}
}