Deploying a YOLOv5 Model to Flask, Android and iOS

David Landup
David Landup

Hosting platforms that offer Inference as a Service are more numerous now than ever before. Roboflow is one of them - and you can upload your model to Roboflow, which will host it and spin up an API that you can send images to and receive predictions from.

This is a low-code solution, but doesn't let you have the good old control over the system. Some prefer deploying the model to their own servers and applications, such as creating a Flask app, and serving an endpoint that acts as an API for your model's inference. Spinning up a Flask REST API takes a minute or so, especially when you consider that the prediction your model will make is essentially a mathematical function call on the input.

Finally - you may decide to totally skip APIs and directly deploy a model to a phone or an edge device such as an Arduino or Raspberry Pi. Platform GUIs and offering's change, so if you want to deploy to a platform to host the model - they usually have a nicely detailed, simple tutorial page.

In this section, I'll focus on spinning up a Flask API and deploying to an iOS/Android device. Mobile development is a very separate skillset, and it out of scope for this book. I'll cover the process of preparing models for mobile phones, and loading them in the respective environments, but will assume experience with Android/iOS development on your part as it is required to make any actual use of the model once it reaches the environment.

Start project to continue
Lessson 6/6
You must first start the project before tracking progress.
Mark completed

© 2013-2024 Stack Abuse. All rights reserved.