This is the HF transformers implementation for D-FINE
Performance
D-FINE, a powerful real-time object detector that achieves outstanding localization precision by redefining the bounding box regression task in DETR models. D-FINE comprises two key components: Fine-grained Distribution Refinement (FDR) and Global Optimal Localization Self-Distillation (GO-LSD).
How to use
import torch
import requests
from PIL import Image
from transformers import DFineForObjectDetection, AutoImageProcessor
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)
image_processor = AutoImageProcessor.from_pretrained("vladislavbro/dfine_x_obj2coco")
model = DFineForObjectDetection.from_pretrained("vladislavbro/dfine_x_obj2coco")
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 inzip(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}")
Training
D-FINE is trained on COCO (Lin et al. [2014]) train2017 and validated on COCO val2017 dataset. We report the standard AP metrics (averaged over uniformly sampled IoU thresholds ranging from 0.50 − 0.95 with a step size of 0.05), and APval5000 commonly used in real scenarios.
Applications
D-FINE is ideal for real-time object detection in diverse applications such as
autonomous driving
,
surveillance systems
,
robotics
, and
retail analytics
. Its enhanced flexibility and deployment-friendly design make it suitable for both edge devices and large-scale systems + ensures high accuracy and speed in dynamic, real-world environments.
Runs of ustc-community dfine_x_obj2coco on huggingface.co
53
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About dfine_x_obj2coco huggingface.co Model
dfine_x_obj2coco huggingface.co is an AI model on huggingface.co that provides dfine_x_obj2coco's model effect (), which can be used instantly with this ustc-community dfine_x_obj2coco model. huggingface.co supports a free trial of the dfine_x_obj2coco model, and also provides paid use of the dfine_x_obj2coco. Support call dfine_x_obj2coco model through api, including Node.js, Python, http.
dfine_x_obj2coco huggingface.co is an online trial and call api platform, which integrates dfine_x_obj2coco's modeling effects, including api services, and provides a free online trial of dfine_x_obj2coco, you can try dfine_x_obj2coco online for free by clicking the link below.
ustc-community dfine_x_obj2coco online free url in huggingface.co:
dfine_x_obj2coco is an open source model from GitHub that offers a free installation service, and any user can find dfine_x_obj2coco on GitHub to install. At the same time, huggingface.co provides the effect of dfine_x_obj2coco install, users can directly use dfine_x_obj2coco installed effect in huggingface.co for debugging and trial. It also supports api for free installation.