5

I created a face recognition method in Python that compares an image (from a parameter) to another one, from a local repository. I need it to be called from a Flutter front-end, is it somehow possible?

It can't be as an API request, since the application must also work offline.

gustavosmanc
  • 51
  • 1
  • 5

3 Answers3

1

No, there's no provided way to call directly into Python code from Dart, and by extension Flutter.

If this is absolutely critical to your application, you could theoretically call into a Python method from Java/Kotlin on Android using the approach described here and then pass the result back to Dart code via a MethodChannel. However, you're probably better off finding a Flutter plugin or Dart package that can do the work you need to perform.

Ben Konyi
  • 2,849
  • 12
  • 20
0

Yes you can there is a flutter plugin called startflut that you could use to run python functions in a flutter app you can also find an example here

MCTRACO
  • 16
  • 1
0

The simplest way to integrate python code into your flutter app is by using chaquopy plugin, which lets users run python code and also supports Pip packages by which you can easily integrate any python packages inside your app such as numpy, scipy, pandas, etc.

Jay Dangar
  • 3,271
  • 1
  • 16
  • 35