Yolo Tflite Models
#14
by AyushK07 - opened
Add Ultralytics YOLO models in TFLite format
Adds four Ultralytics YOLO models exported to TFLite, runnable through OpenCV's DNN TFLite importer
Models
| Folder | Task | Head / output |
|---|---|---|
yolov8n |
detection | classic [1, 84, 8400] |
yolov5nu |
detection (anchor-free "u") | classic [1, 84, 8400] |
yolo26n |
detection | NMS-free [1, 300, 6] |
yolo26n-seg |
instance segmentation | NMS-free [1, 300, 6+32] + proto [1, 32, 160, 160] |
Each folder contains
<model>.tfliteβ the exported model (fp32).demo.pyβ inference using OpenCV DNN only (cv2.dnn.readNet): letterbox preprocessing matching
ultralytics.data.augment.LetterBox, head decode (classic or NMS-free, including mask reconstruction for-seg),
NMS, and an annotated output image.README.mdβ the.ptβ.tfliteconversion recipe and usage.LICENSEβ AGPL-3.0 (Ultralytics).example_outputs/β input image + annotated result.
Conversion
Each model was exported from its Ultralytics .pt checkpoint with:
yolo export model=<model>.pt format=tflite imgsz=640
or the Python API:
from ultralytics import YOLO
YOLO("<model>.pt").export(format="tflite", imgsz=640)
Replace <model> with yolov8n, yolov5nu, yolo26n, or yolo26n-seg. See each folder's README.md for the exact
command and the pinned environment/versions used to produce that model.
Usage
python demo.py --model <model>.tflite --image example_outputs/input.jpg --output example_outputs/<model>_output.jpg
License
Weights and the Ultralytics exporter are released under AGPL-3.0 β see each folder's LICENSE and the
Ultralytics LICENSE.
AyushK07 changed pull request status to open
abhishek-gola changed pull request status to merged