YOLOv5s TFLite
YOLOv5s at 320 or 640 pixels, with floating-point and quantized exports. Choose a size and input dtype that match your application.
| Download | Input (NHWC) | Outputs | Size |
|---|---|---|---|
| FP32 320 | FP32 [1,320,320,3] | 3 FP32 heads | 27.77 MiB |
| FP32 640 | FP32 [1,640,640,3] | 3 FP32 heads | 27.77 MiB |
| Quantized 320 | UINT8 [1,320,320,3] | 3 FP32 heads | 7.35 MiB |
| Quantized 640 | UINT8 [1,640,640,3] | 3 FP32 heads | 7.35 MiB |
COCO labels · SHA-256 checksums
Run on CPU
Download Quantized 640 and install ai-edge-litert, numpy, and Pillow. This checks the three raw heads with a local image.
import numpy as np
from ai_edge_litert.interpreter import Interpreter
from PIL import Image
model = Interpreter(model_path="yolov5s_int8_640.tflite")
model.allocate_tensors()
inp = model.get_input_details()[0]
image = Image.open("image.jpg").convert("RGB").resize((640, 640))
model.set_tensor(inp["index"], np.asarray(image, dtype=np.uint8)[None])
model.invoke()
print([tuple(model.get_tensor(out["index"]).shape) for out in model.get_output_details()])
# [(1, 80, 80, 255), (1, 40, 40, 255), (1, 20, 20, 255)]
Model interface
The quantized exports use input scale 1/255 and zero point 0. For FP32, feed RGB values in [0, 1]. In order of strides 8, 16, and 32, each head has 255 channels. Detection requires aspect-ratio-preserving preprocessing, the matching YOLOv5 anchors, output decoding, and NMS. The example stretches the image to exercise the input/output contract. The original export manifest with exact anchors is unavailable here.
Validation
All four exports passed a LiteRT CPU tensor check. Labeled accuracy and device latency are unreported. Andrew Chiao prepared the TFLite exports.
Source and license
The four exports match 59 convolution weight tensors from Ultralytics YOLOv5s yolov5s.pt v5.0. The same check found no matches against the tested v4.0 and v6.0 checkpoints. The v5.0 source tree carries GPL-3.0. Ultralytics publishes current licensing terms. The terms for redistributing these historical TFLite exports are still unverified.
See evaluation/results.json for the checkpoint hashes and comparison details.