Skip to content

maxmarkov/yolov5-coral-dev-mini

Repository files navigation

Export YOLOv5 to Google Coral Dev Mini

Table of contents

Step 0: Preparation. Download models.

Clone the repository implementing inference with YOLOv5 models on Google Coral Dev Board Mini

git clone https://github.com/maxmarkov/yolov5-coral-dev-mini.git

This repository uses YOLOv5 as submodule. Clone the submodule and checkout the latest stable release (v5.0 on July 24)

git submodule init && git submodule update && cd yolov5 && git checkout tags/v5.0

Install all necessary requirements

cd .. && pip install -r yolov5/requirements.txt && pip install -r requirements.txt

Download PyTorch models from YOLOv5 repository into models folder:

python download.py --weights yolov5s.pt yolov5s6.pt 

Step 1: Convert PyTorch model into TensorFlow Lite

Coral Dev Board requires the model to be in a TensorFlow Lite format. Custom models should be placed into models folder.

Method 1 (via TensorFlow)

Conversion diagram

PyTorch to ONNX to TensorFlow to TensorFlow Lite:

python export.py --weights models/yolov5s.pt --img 320 --batch 1 --dynamic

Download already converted files: onnx | tf | tflite

Method 2 (via Keras)

Conversion via keras using this repository

cd yolov5-conversion && python3 models/tf.py --weights ../models/yolov5s.pt --cfg models/yolov5s.yaml --img 320 

Method 3 (via OpenVINO IR)

Conversion via OpenVINO IR using this repository

python export.py --weights models/yolov5s.pt --img 320 --batch 1 --dynamic onnx openvino

Step 2: Deploy model on Coral Dev Board Mini

python detect.py --weights models/yolov5s.tflite

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages