Model Converter

Overview

This page provides an overview of methods for converting YOLOv5s PyTorch models to TensorFlow Lite (TFLite) format. It covers two primary conversion methods: using an open-source converter script and the MTK Converter tool provided by the NeuroPilot SDK.

YOLOv5s Model Convert

  1. Open Source Converter: - Use the export.py script provided by the open source community. This script leverages TensorFlow Lite Converter to create a converter object that converts the YOLOv5 model from PyTorch format to TensorFlow Lite format.

  2. MTK Converter: - Download the NeuroPilot SDK All-In-One Bundle, install the NeuroPilot Converter tool that matches the user’s Python version, and use the MTK converter to convert the YOLOv5 model from PyTorch format to TensorFlow Lite format.

Install and Verify NeuroPilot Converter Tool

  1. Download NeuroPilot SDK All-In-One Bundle:

    Visit the download page: NeuroPilot Downloads

  2. Extract the Bundle:

    tar zxvf neuropilot-sdk-basic-7.0.5-build20240103.tar.gz
    
  3. Install NeuroPilot Converter Tool for Python 3.7:

    pip3 install /path/to/neuropilot-sdk-basic-7.0.5-build20240205/offline_tool/mtk_converter-7.14.1+release-cp37-cp37-manylinux_2_5_x86_64.manylinux1_x86_64.whl
    
  4. Verify the Installation:

    The following script prints the installed package version:

    python3 -c 'import mtk_converter; print(mtk_converter.__version__)'
    

For detailed conversion steps, please refer to the Open Source Converter page and the MTK Converter page.