Thefalley commited on
Commit
3ea0293
Β·
verified Β·
1 Parent(s): 2a45676

Add NOTICE.md (clean MIT chain)

Browse files
Files changed (1) hide show
  1. NOTICE.md +59 -69
NOTICE.md CHANGED
@@ -1,35 +1,46 @@
1
  # NOTICE β€” Attribution and Provenance
2
 
3
- This repository hosts an **INT8-quantized ONNX derivative** of YOLOv4-Leaky-416,
4
- prepared by **Pablo Mendoza** as part of a custom DPU FPGA toolchain for the
5
- ZedBoard XC7Z020.
6
 
7
- The work this repo adds (calibration + INT8 quantization in QOperator format)
8
- is released under the MIT License (see `LICENSE`). All upstream components
9
- keep their original licenses, listed below in dependency order.
 
10
 
11
  ---
12
 
13
  ## Provenance chain
14
 
15
  ```
16
- AlexeyAB / darknet (original .weights, YOLO License β‰ˆ MIT)
 
 
17
  β”‚
18
- β”‚ conversion via david8862's scripts
19
  β–Ό
20
- david8862 / keras-YOLOv3-model-set (MIT)
 
 
 
21
  β”‚
22
- β”‚ packaged in
23
  β–Ό
24
- Xilinx / Vitis-AI Model Zoo (tf_yolov4-416_3.5) (Apache 2.0)
 
 
 
 
25
  β”‚
26
- β”‚ source of the float .pb used as input
 
27
  β–Ό
28
- yolov4_float.onnx (this repo, MIT β€” derivative)
29
- β”‚
30
- β”‚ INT8 static quantization with COCO val2017 calibration
31
- β–Ό
32
- yolov4_int8_qop.onnx (this repo, MIT β€” derivative)
33
  ```
34
 
35
  ---
@@ -40,55 +51,38 @@ yolov4_int8_qop.onnx (this repo, MIT β€” derivative)
40
 
41
  - **Project**: `AlexeyAB/darknet`
42
  - **Source**: https://github.com/AlexeyAB/darknet
43
- - **License**: YOLO License (effectively MIT-compatible; permits redistribution and modification)
44
- - **What we use**: the trained `yolov4-leaky-416.weights` file (indirectly, via the converted `.pb`).
 
45
 
46
- ### 2. Darknet β†’ TensorFlow conversion β€” david8862
47
 
48
- - **Project**: `david8862/keras-YOLOv3-model-set`
49
- - **Source**: https://github.com/david8862/keras-YOLOv3-model-set
50
- - **License**: MIT
51
- - **What we use**: the `convert.py` and `keras_to_tensorflow.py` pipeline that produced the `.pb` we started from. We did not run these scripts ourselves; we used the `.pb` already generated by Xilinx's packaging.
 
52
 
53
- ### 3. Float `.pb` packaging β€” Xilinx / Vitis-AI
54
 
55
- - **Project**: `Xilinx/Vitis-AI` β€” Model Zoo entry `tf_yolov4-416_3.5`
56
- - **Source**: https://github.com/Xilinx/Vitis-AI/tree/master/model_zoo/model-list/tf_yolov4-416_3.5
57
- - **License**: Apache License 2.0
58
- - **What we use**: the file `float/yolov4-leaky-416.pb` (245 MB) packaged inside the model-zoo archive. We did not redistribute the archive itself β€” only the derivative ONNX models produced from that `.pb`.
59
- - **Note**: Per the README inside that model-zoo entry, the `.pb` was produced by running david8862's MIT-licensed conversion scripts on AlexeyAB's MIT-licensed weights. Xilinx did not train this model; they packaged it.
60
 
61
- ### 4. Calibration dataset β€” COCO val2017
62
 
63
- - **Source**: https://cocodataset.org
64
- - **License**: Creative Commons Attribution 4.0 (CC BY 4.0) for the images; annotations are CC BY 4.0.
65
- - **What we use**: a small subset of `val2017` images was used **only as runtime input** to drive the activation calibrator inside `onnxruntime.quantization.quantize_static`. No COCO image is embedded inside the ONNX file; the dataset's role ends after calibration.
66
-
67
- ### 5. Quantization tool β€” ONNX Runtime
68
-
69
- - **Project**: `microsoft/onnxruntime`
70
- - **Source**: https://github.com/microsoft/onnxruntime
71
- - **License**: MIT
72
- - **What we use**: the `onnxruntime.quantization.quantize_static` API with the following settings:
73
  - `quant_format = QuantFormat.QOperator`
74
- - `weight_type = QuantType.QInt8`
75
- - `activation_type = QuantType.QInt8`
76
  - `per_channel = False`
77
  - `reduce_range = False`
 
78
 
79
- ---
80
 
81
- ## Apache 2.0 compliance summary (Vitis-AI)
82
-
83
- Apache License 2.0 (Section 4) requires, when redistributing derivative
84
- works, that we:
85
-
86
- | Requirement | How we comply |
87
- |---|---|
88
- | Give recipients a copy of the License | Apache 2.0 is referenced in this NOTICE.md (full text at https://www.apache.org/licenses/LICENSE-2.0) |
89
- | State changes made | We changed: `.pb` β†’ ONNX float (via `tf2onnx`), then ONNX float β†’ INT8 ONNX (via `onnxruntime.quantize_static` with COCO calibration). No weights were modified by hand. |
90
- | Preserve copyright/attribution notices | This NOTICE.md preserves attribution to Xilinx, david8862 and AlexeyAB |
91
- | Carry forward the NOTICE file | Included as `NOTICE.md` in this repo |
92
 
93
  ---
94
 
@@ -96,13 +90,9 @@ works, that we:
96
 
97
  | File | Size | SHA-256 |
98
  |---|---:|---|
99
- | `yolov4_float.onnx` | 245.46 MB | `a168d4c5e07e83b393c3592822ea003aa8ff55d4606d2b29604d29741080aee9` |
100
- | `yolov4_int8_qop.onnx` | 61.62 MB | `0a4ccbea7081368b7e336b78d7dfefd83ec725a7bfa5cbdb825a917cb228e774` |
101
- | `quantize_float_to_int8.py` | ~8 KB | (see git commit hash on HF for the canonical version) |
102
-
103
- The float ONNX `yolov4-leaky-416.pb` (245.96 MB) is **not** rehosted here β€”
104
- it lives in the Xilinx Vitis-AI Model Zoo. Its SHA-256 at the time of this
105
- work was `e2428d0d890feb2e245b37899f7bcea22300b24f3b768aafc6fbb0c890342686`.
106
 
107
  ---
108
 
@@ -110,15 +100,15 @@ work was `e2428d0d890feb2e245b37899f7bcea22300b24f3b768aafc6fbb0c890342686`.
110
 
111
  **Pablo Mendoza** β€” HuggingFace [`@thefalley`](https://huggingface.co/thefalley)
112
 
113
- Source code that consumes this model:
114
 
115
- | Repository | Status | Purpose |
116
- |---|---|---|
117
- | [`thefalley/yolov4-dpu-toolchain`](https://github.com/thefalley/yolov4-dpu-toolchain) | 🚧 **Pending upload** | Python toolchain that downloads this ONNX and produces firmware-ready `weights.bin` + `layer_configs.json`. |
118
- | [`thefalley/dpu-firmware`](https://github.com/thefalley/dpu-firmware) | 🚧 **Pending upload** | Bare-metal C firmware + RTL (SystemVerilog) for the custom DPU on ZedBoard XC7Z020. |
119
 
120
  ## Contact
121
 
122
  If you are a rights holder and believe this attribution is inaccurate or
123
- incomplete, please open an issue on this repository and it will be corrected
124
- promptly.
 
1
  # NOTICE β€” Attribution and Provenance
2
 
3
+ This repository hosts an **INT8-quantized ONNX derivative** of
4
+ **YOLOv4-Leaky-416**, prepared by **Pablo Mendoza** (`@thefalley`) for
5
+ deployment on a custom INT8 DPU (ZedBoard XC7Z020 FPGA).
6
 
7
+ The work this repository adds (ONNX export pipeline + INT8 quantization
8
+ with COCO calibration + decoder) is released under the MIT License (see
9
+ `LICENSE`). All upstream components keep their original licenses, listed
10
+ below in dependency order.
11
 
12
  ---
13
 
14
  ## Provenance chain
15
 
16
  ```
17
+ AlexeyAB / darknet (YOLO License v2 = public domain)
18
+ yolov4-leaky-416.weights (245.78 MiB)
19
+ yolov4-leaky-416.cfg
20
  β”‚
21
+ β”‚ parsed and loaded by:
22
  β–Ό
23
+ gwinndr / YOLOv4-Pytorch (MIT) (used as conversion tool)
24
+ utilities/configs.py::parse_config
25
+ utilities/weights.py::load_weights
26
+ + DarknetRaw wrapper (this repo, MIT) that captures pre-YoloLayer outputs
27
  β”‚
28
+ β”‚ torch.onnx.export(opset=13)
29
  β–Ό
30
+ yolov4-leaky-416_float.onnx (this repo, MIT)
31
+ 3 raw outputs:
32
+ out_stride8 β€” shape (1, 255, 52, 52)
33
+ out_stride16 β€” shape (1, 255, 26, 26)
34
+ out_stride32 β€” shape (1, 255, 13, 13)
35
  β”‚
36
+ β”‚ onnxruntime.quantize_static (MIT, used as tool)
37
+ β”‚ + COCO val2017 calibration (1000 images, CC BY 4.0)
38
  β–Ό
39
+ yolov4-leaky-416_int8_qop.onnx (this repo, MIT)
40
+
41
+ External Python decoder (this repo, MIT) reproduces standard YOLOv4
42
+ post-processing: sigmoid + scale_xy + grid offset + anchor multiplication
43
+ + NMS. The decoder lives outside the ONNX graph.
44
  ```
45
 
46
  ---
 
51
 
52
  - **Project**: `AlexeyAB/darknet`
53
  - **Source**: https://github.com/AlexeyAB/darknet
54
+ - **Wiki listing**: https://github.com/AlexeyAB/darknet/wiki/YOLOv4-model-zoo
55
+ - **License**: YOLO License v2 β€” *"Darknet is public domain. Do whatever you want with it."*
56
+ - **What we use**: the trained `yolov4-leaky-416.weights` file (245.78 MiB) and the corresponding `yolov4-leaky-416.cfg`. No modifications.
57
 
58
+ ### 2. Darknet β†’ PyTorch conversion β€” gwinndr / YOLOv4-Pytorch
59
 
60
+ - **Project**: `gwinndr/YOLOv4-Pytorch`
61
+ - **Source**: https://github.com/gwinndr/YOLOv4-Pytorch
62
+ - **License**: MIT (Copyright (c) 2020 Damon Gwinn)
63
+ - **What we use**: the `parse_config` cfg parser and the `load_weights` AlexeyAB binary loader.
64
+ - We do NOT redistribute gwinndr's source code in this HF repo. It is a build-time tool.
65
 
66
+ ### 3. ONNX export
67
 
68
+ - **Tool**: `torch.onnx.export` (PyTorch core, BSD-3-Clause). Used as a tool, not redistributed.
69
+ - **Wrapper**: `DarknetRaw` (β‰ˆ 30 lines, this work, MIT) intercepts the pre-YoloLayer feature maps and exports them as 3 raw 4D tensors.
 
 
 
70
 
71
+ ### 4. INT8 quantization
72
 
73
+ - **Tool**: `onnxruntime.quantization.quantize_static` (Microsoft, MIT). Used as a tool, not redistributed.
74
+ - **Configuration**:
 
 
 
 
 
 
 
 
75
  - `quant_format = QuantFormat.QOperator`
76
+ - `weight_type = QuantType.QInt8` (per-tensor, symmetric)
77
+ - `activation_type = QuantType.QInt8` (per-tensor, asymmetric)
78
  - `per_channel = False`
79
  - `reduce_range = False`
80
+ - **Calibration data**: 1000 randomly-sampled images from MS COCO val2017 (CC BY 4.0). No COCO image is embedded in the ONNX file.
81
 
82
+ ### 5. Calibration dataset β€” COCO val2017
83
 
84
+ - **Source**: https://cocodataset.org
85
+ - **License**: Creative Commons Attribution 4.0 (CC BY 4.0).
 
 
 
 
 
 
 
 
 
86
 
87
  ---
88
 
 
90
 
91
  | File | Size | SHA-256 |
92
  |---|---:|---|
93
+ | `yolov4-leaky-416.weights` (AlexeyAB upstream) | 257,717,640 B | `5b5b359940fd91e6d35bb8a957f6a8b27a05316889319173d39d25f8f33c0640` |
94
+ | `yolov4-leaky-416_float.onnx` | 257,388,314 B | `d7277fc1c6522cb063999d2d72058fb15de6f15900c66d0093d535df0bcf200f` |
95
+ | `yolov4-leaky-416_int8_qop.onnx` | 64,655,943 B | `ca31b2c53227518f1e29cb50e59294e758b69de26f33e374f1e65c922d338da4` |
 
 
 
 
96
 
97
  ---
98
 
 
100
 
101
  **Pablo Mendoza** β€” HuggingFace [`@thefalley`](https://huggingface.co/thefalley)
102
 
103
+ Companion repositories:
104
 
105
+ | Repository | Purpose |
106
+ |---|---|
107
+ | [`Thefalley/yolov4-tiny-416-int8-qop`](https://huggingface.co/Thefalley/yolov4-tiny-416-int8-qop) | Smaller sibling: YOLOv4-tiny-416 INT8 (5.83 MiB) β€” fast embedded inference |
108
+ | `Thefalley/dpu-firmware` (GitHub, ***) | Bare-metal C firmware + RTL for the custom DPU on ZedBoard XC7Z020 |
109
 
110
  ## Contact
111
 
112
  If you are a rights holder and believe this attribution is inaccurate or
113
+ incomplete, please open an issue on this repository and it will be
114
+ corrected promptly.