File size: 3,950 Bytes
f75202a
 
 
 
 
 
 
87a2821
f75202a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
521c905
f75202a
 
521c905
f75202a
 
521c905
f75202a
 
521c905
f75202a
 
521c905
f75202a
 
521c905
f75202a
521c905
f75202a
521c905
f75202a
521c905
f75202a
521c905
f75202a
 
 
 
15bdb08
 
 
 
 
 
 
 
e485db3
 
 
 
15bdb08
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f75202a
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
language:
  - en
license: apache-2.0
tags:
    - object-detection
    - AgTech
    - transformers
library_name: pytorch
inference: false
datasets:
  - Laudando-Associates-LLC/pucks
base_model: Laudando-Associates-LLC/d-fine
base_model_relation: finetune
model-index:
- name: D-FINE Medium
  results:
  - task:
      type: object-detection
      name: Object Detection
    dataset:
      type: Laudando-Associates-LLC/pucks
      name: L&A Pucks Dataset
      config: default
      split: validation
    metrics:
    - type: mean_average_precision
      name: mAP@[IoU=0.50:0.95]
      value: 0.840
    - type: mean_average_precision
      name: mAP@0.50
      value: 0.992
    - type: mean_average_precision
      name: mAP@0.75
      value: 0.974
    - type: recall
      name: AR@[IoU=0.50:0.95 | maxDets=100]
      value: 0.894
    - type: recall
      name: AR@0.50
      value: 1.000
    - type: recall
      name: AR@0.75
      value: 0.988
    - type: f1
      value: 0.924
    - type: precision
      value: 0.898
    - type: recall
      value: 0.952
    - type: iou
      value: 0.784
---

<h1 align="center"><strong>D-FINE Medium</strong></h1>

<p align="center">
  <a href="https://huggingface.co/Laudando-Associates-LLC/d-fine-medium">
    <img src="https://img.shields.io/badge/HuggingFace-Model-yellow?logo=huggingface&style=for-the-badge">
  </a>
</p>

This repository contains the [D-FINE](https://arxiv.org/abs/2410.13842) Medium model, a real-time object detector designed for efficient and accurate object detection tasks.

<p align="center">
  <img src="assets/medium.png" alt="Medium Detections" />
</p>

## Try it in the Browser

You can test this model using our interactive Gradio demo:

<p align="center">
  <a href="https://huggingface.co/spaces/Laudando-Associates-LLC/d-fine-demo">
    <img src="https://img.shields.io/badge/Launch%20Demo-Gradio-FF4B4B?logo=gradio&logoColor=white&style=for-the-badge">
  </a>
</p>

## Model Overview

* Architecture: D-FINE Medium

* Parameters: 19.6M

* Performance: 
  
  - mAP@[0.50:0.95]: 0.840

  - mAP@[0.50]: 0.992

  - AR@[0.50:0.95]: 0.894

  - F1 Score: 0.924

* Framework: PyTorch / ONNX

* Training Hardware: 2× NVIDIA RTX A6000 GPUs

## Download

| Format | Link |
|:--------:|:------:|
| ONNX   | <a href="https://huggingface.co/Laudando-Associates-LLC/d-fine-medium/resolve/main/model.onnx"><img src="https://img.shields.io/badge/-ONNX-005CED?style=for-the-badge&logo=onnx&logoColor=white"></a> |
| PyTorch | <a href="https://huggingface.co/Laudando-Associates-LLC/d-fine-medium/resolve/main/pytorch_model.bin"><img src="https://img.shields.io/badge/PyTorch-EE4C2C?style=for-the-badge&logo=pytorch&logoColor=white"></a> |

## Usage

To utilize this model, ensure you have the shared [D-FINE processor](https://huggingface.co/Laudando-Associates-LLC/d-fine):

```python
from transformers import AutoProcessor, AutoModel

# Load processor
processor = AutoProcessor.from_pretrained("Laudando-Associates-LLC/d-fine", trust_remote_code=True)

# Load model
model = AutoModel.from_pretrained("Laudando-Associates-LLC/d-fine-medium", trust_remote_code=True)

# Process image
inputs = processor(image)

# Run inference
outputs = model(**inputs, conf_threshold=0.4)
```

## Evaluation

This model was trained and evaluated on the [L&A Pucks Dataset](https://huggingface.co/datasets/Laudando-Associates-LLC/pucks).

## License

This model is licensed under the [Apache License 2.0](https://github.com/Peterande/D-FINE/blob/master/LICENSE).

## Citation
If you use `D-FINE` or its methods in your work, please cite the following BibTeX entries:

```latex
@misc{peng2024dfine,
      title={D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement},
      author={Yansong Peng and Hebei Li and Peixi Wu and Yueyi Zhang and Xiaoyan Sun and Feng Wu},
      year={2024},
      eprint={2410.13842},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
```