Thefalley commited on
Commit
024b781
·
verified ·
1 Parent(s): 05bd871

Add professional model card with mAP

Browse files
Files changed (1) hide show
  1. README.md +115 -3
README.md CHANGED
@@ -1,3 +1,115 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - object-detection
5
+ - yolov4-tiny
6
+ - onnx
7
+ - int8
8
+ - coco
9
+ - fpga
10
+ language: en
11
+ library_name: onnxruntime
12
+ pipeline_tag: object-detection
13
+ ---
14
+
15
+ # YOLOv4-tiny-416 INT8 (ONNX, MIT)
16
+
17
+ Post-training INT8 quantization of YOLOv4-tiny (Bochkovskiy et al., 2020),
18
+ exported to ONNX QOperator format. Calibrated on 1,000 COCO val2017 images.
19
+
20
+ ## Files
21
+
22
+ | File | Size | SHA-256 |
23
+ |---|---:|---|
24
+ | `yolov4-tiny-416_float.onnx` | 24,230,209 B | `eea691d460fd3eb5c1a250b4e5f822784cd44e11aaa77a24299b0952b9f4fc9f` |
25
+ | `yolov4-tiny-416_int8_qop.onnx` | 6,113,440 B | `c30c8f0a33b3a0edc13a2ca21726a288228e1448b3c38940f9da0c7d8cee4760` |
26
+
27
+ ## Architecture
28
+
29
+ | | |
30
+ |---|---|
31
+ | Layers | 21 Conv2D, 3 MaxPool, 1 Upsample, 11 Route, 2 YOLO heads |
32
+ | Activation | LeakyReLU (α = 0.1) on 19/21 convs; remaining 2 are linear (pre-head) |
33
+ | Input | 1×3×416×416, RGB, [0, 1], NCHW, letterbox-padded with 114 |
34
+ | Output | 2 raw conv tensors at strides 16 and 32 (decoder external) |
35
+ | Anchors | (10,14), (23,27), (37,58), (81,82), (135,169), (344,319) |
36
+ | Quantization | Per-tensor INT8 (W symmetric, A asymmetric); bias INT32 |
37
+
38
+ ## Performance
39
+
40
+ | Metric | FP32 | INT8 | Reference (AlexeyAB) |
41
+ |---|---|---|---|
42
+ | AP @ IoU=0.5:0.95 | 0.2076 | *** | 0.217 |
43
+ | AP @ IoU=0.5 | 0.3914 | *** | 0.402 |
44
+ | AP_small | 0.070 | *** | — |
45
+ | AP_medium | 0.239 | *** | — |
46
+ | AP_large | 0.325 | *** | — |
47
+ | Size | 23.11 MiB | 5.83 MiB | — |
48
+
49
+ > *** = pending. INT8 mAP measurement on COCO val2017 is in progress;
50
+ > values will replace these markers once the evaluation completes.
51
+
52
+ ### Evaluation protocol
53
+
54
+ | | |
55
+ |---|---|
56
+ | Dataset | MS COCO **val2017** (5,000 images, 36,781 annotated objects, 80 classes) |
57
+ | Annotations | `instances_val2017.json` from `annotations_trainval2017.zip` (CC BY 4.0) |
58
+ | Tool | `pycocotools.cocoeval.COCOeval` (bbox IoU type) |
59
+ | Score threshold | 0.001 (low to populate the PR curve correctly) |
60
+ | NMS | greedy, per-class, IoU threshold 0.45 |
61
+ | Detections per image | top-100 (matches `params.maxDets[2]`) |
62
+ | Image preprocessing | letterbox to 416×416, padding value 114, RGB, [0, 1], NCHW |
63
+
64
+ ### Calibration protocol (for the INT8 model)
65
+
66
+ | | |
67
+ |---|---|
68
+ | Dataset | MS COCO **val2017** (1,000 images sampled) |
69
+ | Sampling | uniform random with `random.Random(42).sample(...)` (deterministic) |
70
+ | Preprocessing | identical to evaluation (letterbox 416, padding 114, RGB, /255, NCHW) |
71
+ | Quantizer | `onnxruntime.quantization.quantize_static` (MIT) |
72
+
73
+ ## Reproducibility
74
+
75
+ ```bash
76
+ python quantize_float_to_int8.py
77
+ python inference.py --onnx yolov4-tiny-416_int8_qop.onnx
78
+ ```
79
+
80
+ The quantization script produces a bit-similar INT8 model from
81
+ `yolov4-tiny-416_float.onnx`. Differences in calibration sampling order
82
+ may shift activation scales by a few LSBs.
83
+
84
+ ## Provenance
85
+
86
+ ```
87
+ AlexeyAB/darknet yolov4-tiny.weights public domain (YOLO License v2)
88
+ │
89
+ │ parse_config + load_weights from gwinndr/YOLOv4-Pytorch (MIT, used as tool)
90
+ │ + DarknetRaw wrapper to capture pre-YoloLayer outputs
91
+ â–¼
92
+ yolov4-tiny-416_float.onnx MIT (this repository)
93
+ │
94
+ │ onnxruntime.quantize_static (MIT, used as tool)
95
+ │ + COCO val2017 calibration (CC BY 4.0, 1,000 images)
96
+ â–¼
97
+ yolov4-tiny-416_int8_qop.onnx MIT (this repository)
98
+ ```
99
+
100
+ No Vitis-AI nor Apache-2.0 components are bundled. Tools (PyTorch, ONNX Runtime,
101
+ gwinndr) are used to produce the artifacts but not redistributed. See
102
+ `NOTICE.md` for full attribution.
103
+
104
+ ## Citation
105
+
106
+ ```bibtex
107
+ @article{bochkovskiy2020yolov4,
108
+ author = {Bochkovskiy, Alexey and Wang, Chien-Yao and Liao, Hong-Yuan Mark},
109
+ title = {YOLOv4: Optimal Speed and Accuracy of Object Detection},
110
+ journal = {arXiv:2004.10934},
111
+ year = {2020}
112
+ }
113
+ ```
114
+
115
+ Author of the INT8 derivative: **Pablo Mendoza** (`@thefalley`), 2026.