Downloads · 30 days
104
21% of all-time downloads
anan19990108/yolov5s_tflite
yolov5s_tflite is a object detection model from anan19990108. Use it when you need objects located in an image. The card lists the license as agpl-3.0.
TensorFlow Lite exports of YOLOv5s at 320×320 and 640×640 for edge-deployment experiments.
Downloads · 30 days
104
21% of all-time downloads
All-time downloads
500
Public
Repo size
73.6 MB
Likes
1
Public
Click a slice to open those files.
.tflite73.6 MB · 100%
From the Hugging Face model README
TensorFlow Lite exports of YOLOv5s at 320×320 and 640×640 for edge-deployment experiments.
The quantized variants use UINT8 input tensors and FP32 output tensors, while most internal tensors are INT8. They are not full-integer input/output models.
The YOLOv5 architecture and base weights originate from Ultralytics. Andrew Chiao prepared the TensorFlow Lite conversion, 320/640 deployment variants, quantized packaging, tensor-level verification, and Qualcomm deployment integration guidance.
| File | Input | Outputs | Bytes | SHA-256 |
|---|---|---|---|---|
yolov5s_fp32_320.tflite | FP32 [1,320,320,3] | three FP32 detection heads | 29,120,476 | fd05b3aab83a69e26f5db610375b3c50918c594a91b32c07601bce87283eb05c |
yolov5s_fp32_640.tflite | FP32 [1,640,640,3] | three FP32 detection heads | 29,120,476 | ec53e90922469ff2eb0dcbc809ea9656472e79c205f8499a8c717ac2ce012292 |
yolov5s_int8_320.tflite | UINT8 [1,320,320,3], scale 1/255, zero point 0 | three FP32 detection heads | 7,702,976 | f0ac35ebb789d0c3ab84df48af3a2f719414956093f1f7027986ae88f8bd7f16 |
yolov5s_int8_640.tflite | UINT8 [1,640,640,3], scale 1/255, zero point 0 | three FP32 detection heads | 7,702,952 | 4f9ff432e79fc5bb30984694e63cd565bf2b519baa35b894205870263428b3d3 |
The quantized variants contain 307 INT8 tensors and 370 tensors with quantization parameters. Post-processing and NMS are not included in this repository.
import numpy as np
from PIL import Image
import tensorflow as tf
interpreter = tf.lite.Interpreter("yolov5s_int8_640.tflite")
interpreter.allocate_tensors()
inp = interpreter.get_input_details()[0]
outs = interpreter.get_output_details()
# Use production letterboxing for correct geometry. This short example only
# demonstrates the model I/O contract.
rgb = Image.open("image.jpg").convert("RGB").resize((640, 640))
input_uint8 = np.asarray(rgb, dtype=np.uint8)[None]
interpreter.set_tensor(inp["index"], input_uint8)
interpreter.invoke()
heads = [interpreter.get_tensor(item["index"]) for item in outs]
print([head.shape for head in heads])
# [(1, 80, 80, 255), (1, 40, 40, 255), (1, 20, 20, 255)]
The three FP32 outputs are YOLOv5 detection heads. Decode them with the matching anchors/strides and apply confidence filtering plus NMS.
Use a QNN LiteRT delegate and runtime from the same authorized Qualcomm SDK release. The quantized variants request the quantized HTP precision:
QnnDelegate.Options qnn = new QnnDelegate.Options();
qnn.setSkelLibraryDir(context.getApplicationInfo().nativeLibraryDir);
qnn.setCacheDir(context.getCacheDir().getAbsolutePath());
qnn.setModelToken("yolov5s_int8_640");
qnn.setBackendType(QnnDelegate.Options.BackendType.HTP_BACKEND);
qnn.setHtpPerformanceMode(
QnnDelegate.Options.HtpPerformanceMode.HTP_PERFORMANCE_BURST);
qnn.setHtpPrecision(QnnDelegate.Options.HtpPrecision.HTP_PRECISION_QUANTIZED);
QnnDelegate delegate = new QnnDelegate(qnn);
Interpreter.Options options = new Interpreter.Options();
options.setUseNNAPI(false);
options.setUseXNNPACK(false);
options.addDelegate(delegate);
Interpreter interpreter = new Interpreter(modelBuffer, options);
Check HTP_RUNTIME_QUANTIZED capability before construction, keep the delegate
alive with the interpreter, and confirm graph delegation in the device log.
Tensor shapes, dtypes, quantization parameters, sizes, and hashes were checked with TensorFlow Lite. This repository currently does not include a reproducible accuracy or device-latency benchmark, so no QCS8550 performance claim is made in this model card.
The upstream Ultralytics YOLOv5 project is offered under AGPL-3.0 or a separate Ultralytics enterprise license. This repository uses AGPL-3.0 metadata; users should review upstream terms for their deployment.