Add NOTICE.md (clean MIT chain)
Browse files
NOTICE.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NOTICE β Attribution and Provenance
|
| 2 |
+
|
| 3 |
+
This repository hosts an **INT8-quantized ONNX derivative** of
|
| 4 |
+
**YOLOv4-tiny-416**, prepared by **Pablo Mendoza** (`@thefalley`) for
|
| 5 |
+
deployment on a custom INT8 DPU (ZedBoard XC7Z020 FPGA).
|
| 6 |
+
|
| 7 |
+
The work this repo adds (ONNX export pipeline + INT8 quantization with
|
| 8 |
+
COCO calibration) is released under the MIT License (see `LICENSE`). All
|
| 9 |
+
upstream components keep their original licenses, listed below in
|
| 10 |
+
dependency order.
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
## Provenance chain
|
| 15 |
+
|
| 16 |
+
```
|
| 17 |
+
AlexeyAB / darknet (YOLO License v2 = public domain)
|
| 18 |
+
yolov4-tiny.weights (23.13 MiB)
|
| 19 |
+
yolov4-tiny.cfg
|
| 20 |
+
β
|
| 21 |
+
β parsed and loaded by:
|
| 22 |
+
βΌ
|
| 23 |
+
gwinndr / YOLOv4-Pytorch (MIT) (used as conversion tool)
|
| 24 |
+
utilities/configs.py::parse_config β parses darknet .cfg dynamically
|
| 25 |
+
utilities/weights.py::load_weights β reads AlexeyAB binary .weights
|
| 26 |
+
+ small in-repo patch to handle [route] groups
|
| 27 |
+
+ DarknetRaw wrapper (this repo, MIT) that captures pre-YoloLayer outputs
|
| 28 |
+
β
|
| 29 |
+
β torch.onnx.export(opset=13)
|
| 30 |
+
βΌ
|
| 31 |
+
yolov4-tiny-416_float.onnx (this repo, MIT β derivative)
|
| 32 |
+
2 raw outputs:
|
| 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-tiny-416_int8_qop.onnx (this repo, MIT β derivative)
|
| 40 |
+
|
| 41 |
+
External Python decoder (this repo, MIT) reproduces the standard YOLOv4
|
| 42 |
+
post-processing: sigmoid + scale_xy + grid offset + anchor multiplication
|
| 43 |
+
+ NMS. This decoder is not part of the ONNX graph (matches the standard
|
| 44 |
+
deployable design where the decoder runs on the host CPU after the DPU
|
| 45 |
+
executes the conv backbone+neck+head).
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Component-level attribution
|
| 51 |
+
|
| 52 |
+
### 1. Model weights β AlexeyAB / darknet
|
| 53 |
+
|
| 54 |
+
- **Project**: `AlexeyAB/darknet`
|
| 55 |
+
- **Source**: https://github.com/AlexeyAB/darknet
|
| 56 |
+
- **Weights URL**: https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights
|
| 57 |
+
- **License**: YOLO License v2 β *"Darknet is public domain. Do whatever you want with it."*
|
| 58 |
+
- **What we use**: the trained `yolov4-tiny.weights` file (23.13 MiB) and the corresponding `yolov4-tiny.cfg`. No modifications.
|
| 59 |
+
|
| 60 |
+
### 2. Darknet β PyTorch conversion β gwinndr / YOLOv4-Pytorch
|
| 61 |
+
|
| 62 |
+
- **Project**: `gwinndr/YOLOv4-Pytorch`
|
| 63 |
+
- **Source**: https://github.com/gwinndr/YOLOv4-Pytorch
|
| 64 |
+
- **License**: MIT (Copyright (c) 2020 Damon Gwinn)
|
| 65 |
+
- **What we use**: the `parse_config` cfg parser and the `load_weights` AlexeyAB binary loader.
|
| 66 |
+
- **Modifications we made** (to handle yolov4-tiny's CSPDarknet route trick):
|
| 67 |
+
- Patched `utilities/configs.py::parse_route_block` to read `groups` and `group_id` from `[route]` blocks.
|
| 68 |
+
- Patched `model/layers/route.py::RouteLayer` to apply channel-wise split when `groups > 1`.
|
| 69 |
+
- These patches are also released under MIT.
|
| 70 |
+
- We do NOT redistribute gwinndr's source code in this HF repo. We reference it as a build-time tool. To reproduce, clone gwinndr's repo and apply the patches in our companion firmware repository.
|
| 71 |
+
|
| 72 |
+
### 3. ONNX export
|
| 73 |
+
|
| 74 |
+
- **Tool**: `torch.onnx.export` (PyTorch core, BSD-3-Clause). Used as a tool, not redistributed.
|
| 75 |
+
- **Wrapper**: `DarknetRaw` (β 30 lines, this work, MIT) intercepts the pre-YoloLayer feature maps and exports them as 2 raw 4D tensors. The decoder lives in `inference.py` (Python, MIT).
|
| 76 |
+
|
| 77 |
+
### 4. INT8 quantization
|
| 78 |
+
|
| 79 |
+
- **Tool**: `onnxruntime.quantization.quantize_static` (Microsoft, MIT). Used as a tool, not redistributed.
|
| 80 |
+
- **Configuration**:
|
| 81 |
+
- `quant_format = QuantFormat.QOperator`
|
| 82 |
+
- `weight_type = QuantType.QInt8` (per-tensor, symmetric)
|
| 83 |
+
- `activation_type = QuantType.QInt8` (per-tensor, asymmetric)
|
| 84 |
+
- `per_channel = False`
|
| 85 |
+
- `reduce_range = False`
|
| 86 |
+
- **Calibration data**: 1000 randomly-sampled images from MS COCO val2017 (CC BY 4.0). No COCO image is embedded inside the ONNX file; the dataset's role ends after calibration.
|
| 87 |
+
|
| 88 |
+
### 5. Calibration dataset β COCO val2017
|
| 89 |
+
|
| 90 |
+
- **Source**: https://cocodataset.org
|
| 91 |
+
- **License**: Creative Commons Attribution 4.0 (CC BY 4.0) for both images and annotations.
|
| 92 |
+
|
| 93 |
+
---
|
| 94 |
+
|
| 95 |
+
## File-level integrity (SHA-256)
|
| 96 |
+
|
| 97 |
+
| File | Size | SHA-256 |
|
| 98 |
+
|---|---:|---|
|
| 99 |
+
| `yolov4-tiny.weights` (AlexeyAB upstream) | 24,251,276 B | `cf9fbfd0f6d4869b35762f56100f50ed05268084078805f0e7989efe5bb8ca87` |
|
| 100 |
+
| `yolov4-tiny-416_float.onnx` | 24,230,209 B | `eea691d460fd3eb5c1a250b4e5f822784cd44e11aaa77a24299b0952b9f4fc9f` |
|
| 101 |
+
| `yolov4-tiny-416_int8_qop.onnx` | 6,113,440 B | `c30c8f0a33b3a0edc13a2ca21726a288228e1448b3c38940f9da0c7d8cee4760` |
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Author of the INT8 derivative
|
| 106 |
+
|
| 107 |
+
**Pablo Mendoza** β HuggingFace [`@thefalley`](https://huggingface.co/thefalley)
|
| 108 |
+
|
| 109 |
+
Companion repositories:
|
| 110 |
+
|
| 111 |
+
| Repository | Purpose |
|
| 112 |
+
|---|---|
|
| 113 |
+
| [`Thefalley/yolov4-leaky-416-int8-qop`](https://huggingface.co/Thefalley/yolov4-leaky-416-int8-qop) | Larger sibling: full YOLOv4-Leaky-416 INT8 (61.66 MiB) for higher mAP |
|
| 114 |
+
| `Thefalley/dpu-firmware` (GitHub, ***) | Bare-metal C firmware + RTL for the custom DPU on ZedBoard XC7Z020 |
|
| 115 |
+
|
| 116 |
+
## Contact
|
| 117 |
+
|
| 118 |
+
If you are a rights holder and believe this attribution is inaccurate or
|
| 119 |
+
incomplete, please open an issue on this repository and it will be
|
| 120 |
+
corrected promptly.
|