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 β†’ .tflite conversion 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

Sign up or log in to comment