Add NOTICE.md (clean MIT chain)
Browse files
NOTICE.md
CHANGED
|
@@ -1,35 +1,46 @@
|
|
| 1 |
# NOTICE β Attribution and Provenance
|
| 2 |
|
| 3 |
-
This repository hosts an **INT8-quantized ONNX derivative** of
|
| 4 |
-
prepared by **Pablo Mendoza**
|
| 5 |
-
ZedBoard XC7Z020.
|
| 6 |
|
| 7 |
-
The work this
|
| 8 |
-
is released under the MIT License (see
|
| 9 |
-
keep their original licenses, listed
|
|
|
|
| 10 |
|
| 11 |
---
|
| 12 |
|
| 13 |
## Provenance chain
|
| 14 |
|
| 15 |
```
|
| 16 |
-
AlexeyAB / darknet
|
|
|
|
|
|
|
| 17 |
β
|
| 18 |
-
β
|
| 19 |
βΌ
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
β
|
| 22 |
-
β
|
| 23 |
βΌ
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
β
|
| 26 |
-
β
|
|
|
|
| 27 |
βΌ
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 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 |
-
- **
|
| 44 |
-
- **
|
|
|
|
| 45 |
|
| 46 |
-
### 2. Darknet β
|
| 47 |
|
| 48 |
-
- **Project**: `
|
| 49 |
-
- **Source**: https://github.com/
|
| 50 |
-
- **License**: MIT
|
| 51 |
-
- **What we use**: the `
|
|
|
|
| 52 |
|
| 53 |
-
### 3.
|
| 54 |
|
| 55 |
-
- **
|
| 56 |
-
- **
|
| 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.
|
| 62 |
|
| 63 |
-
- **
|
| 64 |
-
- **
|
| 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 |
-
|
| 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 |
-
| `
|
| 100 |
-
| `
|
| 101 |
-
| `
|
| 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 |
-
|
| 114 |
|
| 115 |
-
| Repository |
|
| 116 |
-
|---|---|
|
| 117 |
-
| [`
|
| 118 |
-
|
|
| 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
|
| 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.
|