# NOTICE — Attribution and Provenance This repository hosts an **INT8-quantized ONNX derivative** of **YOLOv4-Leaky-416**, prepared by **Pablo Mendoza** (`@thefalley`) for deployment on a custom INT8 DPU (ZedBoard XC7Z020 FPGA). The work this repository adds (ONNX export pipeline + INT8 quantization with COCO calibration + decoder) is released under the MIT License (see `LICENSE`). All upstream components keep their original licenses, listed below in dependency order. --- ## Provenance chain ``` AlexeyAB / darknet (YOLO License v2 = public domain) yolov4-leaky-416.weights (245.78 MiB) yolov4-leaky-416.cfg │ │ parsed and loaded by: ▼ gwinndr / YOLOv4-Pytorch (MIT) (used as conversion tool) utilities/configs.py::parse_config utilities/weights.py::load_weights + DarknetRaw wrapper (this repo, MIT) that captures pre-YoloLayer outputs │ │ torch.onnx.export(opset=13) ▼ yolov4-leaky-416_float.onnx (this repo, MIT) 3 raw outputs: out_stride8 — shape (1, 255, 52, 52) out_stride16 — shape (1, 255, 26, 26) out_stride32 — shape (1, 255, 13, 13) │ │ onnxruntime.quantize_static (MIT, used as tool) │ + COCO val2017 calibration (1000 images, CC BY 4.0) ▼ yolov4-leaky-416_int8_qop.onnx (this repo, MIT) External Python decoder (this repo, MIT) reproduces standard YOLOv4 post-processing: sigmoid + scale_xy + grid offset + anchor multiplication + NMS. The decoder lives outside the ONNX graph. ``` --- ## Component-level attribution ### 1. Model weights — AlexeyAB / darknet - **Project**: `AlexeyAB/darknet` - **Source**: https://github.com/AlexeyAB/darknet - **Wiki listing**: https://github.com/AlexeyAB/darknet/wiki/YOLOv4-model-zoo - **License**: YOLO License v2 — *"Darknet is public domain. Do whatever you want with it."* - **What we use**: the trained `yolov4-leaky-416.weights` file (245.78 MiB) and the corresponding `yolov4-leaky-416.cfg`. No modifications. ### 2. Darknet → PyTorch conversion — gwinndr / YOLOv4-Pytorch - **Project**: `gwinndr/YOLOv4-Pytorch` - **Source**: https://github.com/gwinndr/YOLOv4-Pytorch - **License**: MIT (Copyright (c) 2020 Damon Gwinn) - **What we use**: the `parse_config` cfg parser and the `load_weights` AlexeyAB binary loader. - We do NOT redistribute gwinndr's source code in this HF repo. It is a build-time tool. ### 3. ONNX export - **Tool**: `torch.onnx.export` (PyTorch core, BSD-3-Clause). Used as a tool, not redistributed. - **Wrapper**: `DarknetRaw` (≈ 30 lines, this work, MIT) intercepts the pre-YoloLayer feature maps and exports them as 3 raw 4D tensors. ### 4. INT8 quantization - **Tool**: `onnxruntime.quantization.quantize_static` (Microsoft, MIT). Used as a tool, not redistributed. - **Configuration**: - `quant_format = QuantFormat.QOperator` - `weight_type = QuantType.QInt8` (per-tensor, symmetric) - `activation_type = QuantType.QInt8` (per-tensor, asymmetric) - `per_channel = False` - `reduce_range = False` - **Calibration data**: 1000 randomly-sampled images from MS COCO val2017 (CC BY 4.0). No COCO image is embedded in the ONNX file. ### 5. Calibration dataset — COCO val2017 - **Source**: https://cocodataset.org - **License**: Creative Commons Attribution 4.0 (CC BY 4.0). --- ## File-level integrity (SHA-256) | File | Size | SHA-256 | |---|---:|---| | `yolov4-leaky-416.weights` (AlexeyAB upstream) | 257,717,640 B | `5b5b359940fd91e6d35bb8a957f6a8b27a05316889319173d39d25f8f33c0640` | | `yolov4-leaky-416_float.onnx` | 257,388,314 B | `d7277fc1c6522cb063999d2d72058fb15de6f15900c66d0093d535df0bcf200f` | | `yolov4-leaky-416_int8_qop.onnx` | 64,655,943 B | `ca31b2c53227518f1e29cb50e59294e758b69de26f33e374f1e65c922d338da4` | --- ## Author of the INT8 derivative **Pablo Mendoza** — HuggingFace [`@thefalley`](https://huggingface.co/thefalley) Companion repositories: | Repository | Purpose | |---|---| | [`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 | | `Thefalley/dpu-firmware` (GitHub, ***) | Bare-metal C firmware + RTL for the custom DPU on ZedBoard XC7Z020 | ## Contact If you are a rights holder and believe this attribution is inaccurate or incomplete, please open an issue on this repository and it will be corrected promptly.