Training YOLOv5 Model and Deploying to DEBIX

2025.6.13by debix.io

Installation

Create a virtual environment with Python version greater than 3.10 and install the Ultralytics tool:

conda create -n yolo python=3.10

conda activate yolo

pip install Ultralytics


Training

Launch training using the yolo CLI. If the dataset and pretrained model are not locally available, they will be automatically downloaded from the latest YOLOv5:

yolo train data=coco8.yaml model=yolov5n.pt epochs=100 imgsz=640


Exporting

Export the trained model to a TFLite model.

yolo export model=runs/detect/train/weights/best.pt format=tflite int8=true data=coco8.yaml


Ultralytics will export five types of models: float32, float16, int8, integer_quant, full_integer_quant.

On DEBIX, it is recommended to choose the integer_quant type of model.



Testing

Copy the exported model integer_quant.tflite to DEBIX.

Run the test using the built-in TensorFlow benchmark tool of the system:

/usr/bin/tensorflow-lite-2.16.2/examples/benchmark_model --graph=best_integer_quant.tflite --enable_op_profiling=true --external_delegate_path=/usr/lib/libvx_delegate.so