Converting YOLO V7 to Tensorflow Lite for Mobile Deployment

Vikas Kumar Ojha
Geek Culture
Published in
5 min readSep 20, 2022

--

Photo by Claudio Schwarz on Unsplash

Yolo V7 is the latest object detector in the YOLO family. It is currently the state-of-the-art object detector both in terms of accuracy and speed. It's very hardware efficient and can be trained on small datasets with the help of transfer learning. Apart from object detection YOLO v7 is also capable of doing certain other tasks like segmentation and pose estimation. Having an accurate and efficient model is good but it is only useful if it can be deployed in production. On the official repo of YOLO v7, its authors have already created scripts and instructions for converting the YOLO v7 into ONNX and tensorRT making the model deployment friendly. But there is no instruction for converting the model into TensorFlow lite which is the most popular framework for deploying models into mobile devices. Hence in this article, we would convert the officially available YOLO v7 model to the TensorFlow Lite model and will run inference using it.

Steps for Converting YOLO V7 Model to Tensorflow Lite

  1. Conversion of YOLO PyTorch model to ONNX model.
  2. Making predictions using the ONNX model.

3. Conversion of ONNX model to TensorFlow model.

4. Conversion of TensorFlow model to TensorFlow lite.

--

--