--- library_name: onnx license: agpl-3.0 tags: - foundation - amd - rocm - object-detection pipeline_tag: object-detection --- ![](https://huggingface.co/AMD-PAVS-AI/yolo26_detect/resolve/main/yolo26_detect.jpg) # YOLO26: Optimized for AMD ROCm YOLO26 is a real-time object detection model that detects and localizes axis-aligned bounding boxes across 80 COCO categories in a single forward pass. This repository packages inference for object detection using **ONNX Runtime**, exported and validated for **AMD ROCm** so it runs efficiently on AMD GPUs, CPUs, and NPUs. This is based on the implementation of YOLO26 found [here](https://github.com/ultralytics/ultralytics). This repository contains configurations and scripts optimized for **AMD® ROCm™** platforms. You can use the [yolo26_detect AMD scripts](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/yolo26_detect) to reproduce results or export with custom configurations. More details on model performance can be found [here](#accuracy-pipeline). --- ## Task Overview **Task:** Object detection **Dataset:** COCO val2017 (5,000 images, 80 categories) **Output metrics:** mAP@0.5:0.95, mAP@0.5, mAP@0.75, AR@100, per-size mAP/AR (small/medium/large) > **Model variants:** Default is **n**. Override with `MODEL_SIZE=n/s/m/l/x`. > **GPU/NPU note:** MIGraphX runtime-quantizes a single FP32 ONNX model to cover all GPU precisions. NPU execution requires BF16 — VitisAI quantizes the FP32 ONNX internally at runtime using `configs/vitisai/detect_bf16.json`. --- ## AMD ROCm Optimization This model export has been adapted and validated for **AMD Instinct™ / Radeon™ GPUs** running **ROCm**, as well as AMD CPUs and AMD Ryzen AI NPUs. Key points: - Validated backends: **ONNX Runtime** across CPU (FP32), GPU (MIGraphX Execution Provider — FP32/FP16/BF16/INT8), and NPU (VitisAI Execution Provider — BF16, auto-quantized internally). - No code changes required versus the upstream Ultralytics YOLO26 implementation — only environment/runtime configuration differs. - GPU first run: MIGraphX compiles the model on first use (30+ minutes); compiled kernels are cached and reused afterwards. | Runtime | Precision | Backend | Hardware | Notes | |---|---|---|---|---| | ONNX Runtime | FP32 | CPU Execution Provider | AMD CPU | — | | ONNX Runtime | FP32 / FP16 / BF16 / INT8 | MIGraphX Execution Provider | AMD Instinct™ / Radeon™ GPU (ROCm) | First run pays a 30+ minute graph-compilation cost | | ONNX Runtime | BF16 | VitisAI Execution Provider | AMD Ryzen AI NPU | Auto-quantized internally | --- ## Getting Started For setup instructions, evaluation scripts, and custom configuration options, see the [yolo26_detect on GitHub](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/yolo26_detect). --- ## Model Details **Model Type:** Object detection (single-pass CNN detector) **Base Model:** YOLO26 (Ultralytics), size `n` default **Model Stats:** - Input: `(1, 3, 640, 640)` float32 - Output: `(1, 300, 6)` float32 - Precision tested: FP32 (CPU); FP32, FP16, BF16, INT8 (GPU); BF16 (NPU) --- ## Accuracy Pipeline COCO quality evaluation is fully implemented — `make eval-` runs inference across all 5,000 COCO val2017 images and scores predictions with `pycocotools`, the reference implementation for axis-aligned boxes. Higher mAP means the model's predicted boxes and classes agree more closely with ground truth across the dataset — 1.0 is perfect detection, 0.0 means no correct detections. In practice, values above ~0.5 for mAP@0.5:0.95 are considered strong for COCO-scale object detection. ### Metrics Explained | Metric | Description | |--------|-------------| | mAP@0.5:0.95 | Primary COCO metric — mean AP averaged across IoU thresholds 0.5–0.95. The strictest, most holistic accuracy number: higher means boxes are both correctly classified and tightly localized across a range of overlap thresholds. | | mAP@0.5 | AP at a single, looser IoU threshold of 0.5 (VOC-style) — a prediction only needs to overlap the ground-truth box by 50% to count as correct. Typically higher than mAP@0.5:0.95; reflects "did it find the object" more than "how precisely." | | mAP@0.75 | AP at a stricter IoU threshold of 0.75 — the predicted box must overlap ground truth by 75%. Rewards precise localization, not just correct detection. | | AR@100 | Average recall with up to 100 detections per image — of all ground-truth objects, what fraction did the model find. High AR means few missed objects; low AR means the model is overlooking objects regardless of precision. | | mAP/AR-small/medium/large | mAP@0.5:0.95 and AR@100 broken down by object size. Small objects are typically the hardest; this breakdown exposes size-specific weaknesses a single aggregate score would hide. | ### Accuracy Results **Full Dataset Evaluation (COCO val2017)** — `MODEL_SIZE=n`: | Device | Precision | mAP@0.5:0.95 | mAP@0.5 | mAP@0.75 | AR@100 | |--------|-----------|--------------|---------|----------|--------| | CPU | FP32 | 0.4024 | 0.5578 | 0.4356 | 0.6142 | | GPU | FP32 | 0.4024 | 0.5578 | 0.4356 | 0.6142 | | NPU | BF16 | 0.0020 | 0.0029 | 0.0020 | 0.0052 | **NPU accuracy anomaly:** the NPU BF16 run above reports near-zero mAP despite running genuinely on-device (`execution_provider: VitisAIExecutionProvider`, `device_fell_back_to_cpu: False` — not a silent CPU fallback). This is well outside the normal BF16-quantization delta and looks like a broken NPU accuracy path (e.g. a postprocessing/decode mismatch specific to the NPU export) rather than expected precision loss, and needs investigation before treating this number as representative. --- ## Dig Deeper Want to explore the full evaluation scripts, config options, and other AMD-optimized model examples? 📂 **[View the full project on GitHub](https://github.com/AMD-PAVS/physical_ai_sdk/blob/main/models/yolo26_detect)** The GitHub repository includes: - Setup and prerequisites for ROCm environments - Full COCO val2017 evaluation pipeline via `pycocotools` - Per-operator latency profiling scripts (including NPU AI Analyzer integration) - Benchmarking and reproduction instructions across CPU, GPU, and NPU