YOLOv5s optimized for Arm-based Edge Linux systems
An INT8-quantized version of YOLOv5s for object detection, exported to ExecuTorch (.pte) and optimized for Arm-based Edge Linux systems.
Summary
This repository contains an Arm-optimized version of YOLOv5s for object detection, quantized to INT8 via static post-training quantization — per-channel symmetric weights, per-tensor affine activations. The model is provided in ExecuTorch (.pte) format, targeting Edge Linux systems.
This version is intended to demonstrate efficient inference on Arm-based platforms while preserving the original model's intended behavior. Arm has evaluated this model on COCO 2017 val and measured performance on a representative evaluation target.
Key results
Area
Result
Model format
ExecuTorch (
.pte
)
Target device class
Edge Linux
Reference device
Raspberry Pi 5 (Cortex-A76, Linux Raspberry Pi OS 64-bit, based on Debian 13 "Trixie")
Primary performance result
p50 latency 258.068 ms (2.40x faster than baseline)
Pinned runtime dependencies for
example.py
, resolved with uv
uv.lock
Locked dependency resolution for
pyproject.toml
config.yaml
Model input/output contract used by the example
benchmarks/
FP32 baseline and Arm-optimized benchmark records
Performance
Performance was measured on the reference configuration below. Results are intended to make the optimization reproducible but do not guarantee identical performance on every Arm-based system.
Reference configuration
Field
Value
Device / platform
Raspberry Pi 5
CPU architecture
arm64
CPU
Cortex-A76, 4 cores @ 2.4 GHz
System memory
8 GB
OS
Linux, Raspberry Pi OS 64-bit, based on Debian 13 "Trixie"
Accuracy was evaluated using the same preprocessing, input resolution, and evaluation protocol described below. Where possible, the optimized model is compared against the original model under the same evaluation conditions.
Accuracy was measured using the evaluation setup described above. Users should re-evaluate the model on their own data before production use.
Arm optimization approach
Arm optimized this model for efficient inference on Arm-based platforms using a hardware-aware conversion and validation flow.
For this release, Arm used:
Optimization area
Applied?
Notes
Model conversion
Yes
Captured with torch.export and converted to ExecuTorch
.pte
Quantization
Yes
INT8 static PTQ via the PT2E path — per-channel symmetric weights, per-tensor affine activations; calibrated on 1,000 randomly selected COCO 2017 images. Layers were skipped from quantization to keep accuracy within acceptable ranges
Runtime/backend selection
Yes
XNNPACK + KleidiAI delegate
Graph/runtime compatibility updates
Yes
Post-convert graph surgery strips the Q/DQ pairs that
XNNPACKQuantizer._annotate_cat
inserts around the detection head's concatenation and view nodes despite the layer filter, and peels the equivalent pair off the output node
Accuracy validation
Yes
Compared against the original model or published baseline
Performance validation
Yes
Measured on the reference Arm platform
The goal of this process is to improve deployment characteristics such as latency, memory use, model size, and runtime compatibility while preserving the model's intended behavior. Detailed conversion scripts, calibration configuration, or backend-specific implementation details may be provided separately where appropriate.
Using this model
Install dependencies
Dependencies are declared in
pyproject.toml
, which ships with this repository. Resolve and install them into a local virtual environment with uv:
uv python install
uv sync --frozen
Download
yolov5s_raspberry_executorch_optimized.pte
and place it beside
example.py
.
Run the example
uv run example.py
The script reads
sample_input.jpg
— a samoyed lying on a beach — runs inference with
yolov5s_raspberry_executorch_optimized.pte
, prints the detections it kept, and writes:
sample_output.jpg
— the input image at its native resolution with each detection's box and label drawn in red
detections.json
— the class, score, and xyxy box of every detection, in original-image coordinates
Both files ship with this repository as expected results, and the run overwrites them in place. Copy the directory first if you want to keep them for comparison.
Expected input
Property
Value
Shape
[1, 3, 640, 640]
Dtype
float32
Range
[0.0, 1.0]; no mean/std normalization — YOLOv5 consumes raw [0, 1] values
Preprocessing
to tensor and divide by 255, then letterbox to 640x640: aspect-preserving
F.interpolate(mode="bilinear", align_corners=False)
followed by centerd padding with the Ultralytics gray fill of 114/255
Resizing runs on the
[0, 1]
tensor rather than the PIL image, and the aspect ratio is preserved. A plain stretch to 640x640 would shift every box and move the results away from the numbers above.
Expected output
Property
Value
Shape
[1, 25200, 85]
Format
Per anchor: 4 xywh center coordinates + 1 objectness + 80 class scores
Postprocessing
sigmoid applied to objectness and class scores only if they fall outside [0, 1]; score = objectness x max(class scores); confidence threshold 0.25; xywh to xyxy; per-class batched NMS at IoU 0.45; inverse letterbox back to native resolution, clamped to the image bounds
Intended use
This model is intended for developers evaluating object detection workloads on Arm-based platforms. It is suitable as a reference implementation for benchmarking, prototyping, and integration exploration.
Limitations
Evaluated on 5000 images from COCO 2017 val2017, the full validation split
Fixed input size of 640x640 with letterbox padding — other input resolutions require re-export, and small objects lose resolution relative to their native size
Detects only the 80 COCO classes; anything outside that vocabulary is either missed or reported as the nearest COCO class
Performance measurements are from Raspberry Pi 5 hardware; results may differ on other Arm devices
Additional notes
The detection head concatenates box coordinates in the 0-640 range with class confidence scores in the 0-1 range into one output tensor, so a single per-tensor scale would crush the small-range channels to zero. Layers were therefore skipped from quantization to keep accuracy within acceptable ranges: the first backbone convolution stays in FP32 as the input-quantization boundary, and within the head the convolutional and linear layers are quantized while the element-wise operations (sigmoid, multiply, add, concatenation) are kept in FP32. Calibration used 1,000 randomly selected images from COCO 2017.
Confidence filtering, box decoding, and NMS run in Python rather than inside the exported graph, so PT2E canonicalization cannot affect the result.
Sample input:
sample_input.jpg
is derived from
Samoyed on Beach
by Appleinfl, via Wikimedia Commons (public domain).
About this version
Original Model:
YOLOv5s by Ultralytics -
Repository
Optimization/conversion:
Arm-Optimized version for execution on Arm-based platforms.
Converted/optimized by:
Arm
License:
The Original Model and the Optimized Model are subject to
AGPL-3.0
.
This repository contains a converted or optimized version of the Original Model (the “Optimized Model”). The Original Model has been converted or optimized as described above for execution on Arm-based platforms.
No retraining or fine-tuning of the Original Model was performed as part of the conversion or optimization. The conversion or optimization was not intended to change the Original Model’s behavior or intended use.
Original Model and Documentation
For information about the Original Model, including its development, training data, intended uses, limitations and other relevant information, please refer to the
Original Model repository
. Information in that repository was provided by the original developer or other third parties and, unless expressly stated otherwise, has not been independently verified by Arm.
Licenses and Third-Party Terms
Use of the Original Model and the Optimized Model is subject to the applicable licenses, usage restrictions and other terms identified above and in the relevant repositories. Publication of the Optimized Model does not grant any rights beyond those provided under the applicable license terms.
You are responsible for reviewing those terms and ensuring that your use of the Original Model and the Optimized Model is permitted.
Purpose of this Release
The Optimized Model is provided as a reference implementation to demonstrate and evaluate execution and performance on Arm-based systems. It is not a production-ready or supported solution.
Arm’s publication of the Optimized Model does not constitute an endorsement or certification of the Original Model or a representation that the Optimized Model is suitable for production use or any particular purpose.
To the fullest extent permitted by applicable law (i) the Optimized Model is provided “as is.” Arm makes no representations or warranties that the Original Model, the Optimized Model or their outputs are accurate, safe, secure, non-infringing, legally compliant, suitable for production use or fit for any particular purpose; and (ii) Arm will not be liable for any loss or damage arising from or in connection with the Optimized Model, its use or its outputs.
You are responsible for independently evaluating the Optimized Model, its outputs and its suitability for your intended use, including compliance with applicable legal, regulatory, safety and security requirements.
Arm does not commit to provide ongoing support, maintenance or updates for the Optimized Model. Any use of or reliance on the Optimized Model or its outputs is at your own risk.
Use of Ultralytics models
Ultralytics provides Ultralytics YOLO software and models available through the Arm AI Portal and/or Arm's Hugging Face Organization under the GNU Affero General Public License v3.0 ("AGPL-3.0"), unless you have entered into a separate written license agreement with Ultralytics. Accessing, downloading, or retraining these materials through Arm AI Portal does not grant you an Ultralytics Enterprise License or any other proprietary Ultralytics license.
AGPL-3.0 requires you to release the complete source code of any application that uses Ultralytics YOLO, including applications made available over a network, under the same license. If you are embedding YOLO in a commercial product, internal tool, or production deployment and cannot open-source your code, you need an Ultralytics Enterprise License.
You are responsible for determining which applies to your use. Terms and enterprise licensing options are available at
ultralytics.com
.
Runs of Arm yolov5s-int8-xnnpack-executorch on huggingface.co
163
Total runs
0
24-hour runs
0
3-day runs
64
7-day runs
126
30-day runs
More Information About yolov5s-int8-xnnpack-executorch huggingface.co Model
More yolov5s-int8-xnnpack-executorch license Visit here:
yolov5s-int8-xnnpack-executorch huggingface.co is an AI model on huggingface.co that provides yolov5s-int8-xnnpack-executorch's model effect (), which can be used instantly with this Arm yolov5s-int8-xnnpack-executorch model. huggingface.co supports a free trial of the yolov5s-int8-xnnpack-executorch model, and also provides paid use of the yolov5s-int8-xnnpack-executorch. Support call yolov5s-int8-xnnpack-executorch model through api, including Node.js, Python, http.
yolov5s-int8-xnnpack-executorch huggingface.co is an online trial and call api platform, which integrates yolov5s-int8-xnnpack-executorch's modeling effects, including api services, and provides a free online trial of yolov5s-int8-xnnpack-executorch, you can try yolov5s-int8-xnnpack-executorch online for free by clicking the link below.
Arm yolov5s-int8-xnnpack-executorch online free url in huggingface.co:
yolov5s-int8-xnnpack-executorch is an open source model from GitHub that offers a free installation service, and any user can find yolov5s-int8-xnnpack-executorch on GitHub to install. At the same time, huggingface.co provides the effect of yolov5s-int8-xnnpack-executorch install, users can directly use yolov5s-int8-xnnpack-executorch installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
yolov5s-int8-xnnpack-executorch install url in huggingface.co: