Home > Net >  How to integrate Python with Flutter Application?
How to integrate Python with Flutter Application?

Time:05-12

What I have:

I built a python model which generates a JSON file based on the given input. Now i want my Flutter Application to use this JSON file and to show the required output on the screen. But I don't know how to generate this JSON file whenever requested by my Flutter App. Please guide me with the approach where I will be able to integrate my Python Model with my Flutter Application.

What I want:

Python Model -> Generates a JSON file based on given input on my Flutter App -> Displaying contents of the JSON file on Flutter Application

CodePudding user response:

You need to serve python (AI) model as a REST (API) service. You can use Django, Flask or FastAPI for this. Then called the API in Flutter, which will return JSON. You can then use the JSON as you like in Flutter.

Another brief example here: https://flutterrepos.com/lib/ketanchoyal-InstaKnow

CodePudding user response:

You need to export your Machine Learning model to tensorflow lite (assuming you built it using tensorflow). After that you can access your tensorflow model using flutter, see this and scroll down to Module 2: Importing and using model.tflite in a Flutter app.

  • Related