-1

I am doing a project for image recognition. I want to send an image or a video from an android app to the raspberryPi, that is my server (I use flask), and make the recognition on the server and then send back the result to android. I want to do this with REST and python. So how can I do this? I am new to all of this so any help is really helpful!

Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30
MariannaP
  • 1
  • 1

2 Answers2

0

Yes, as your raspberryPi server use flask, so you can done the task through HTTP and your android phone browser as client.
raspberryPi as server should have the following api: Chose a image and upload, then recognition and send the result back.

That all.

Moon.Hou
  • 45
  • 1
  • 8
-1

Since you are using flask, you need to implement REST endpoint that handles multipart/form-data, the example of such endpoint you can find here.

On the client part (in your case - android app) you need to implement sending of the image to that endpoint, example you can find here.

Lukario
  • 1
  • 3
  • Thank you for your response! I make the recognition and get, perhaps, the name of the person, how i will handle it in android and show it to the user? I didn't understand! – MariannaP Nov 20 '18 at 11:12
  • After you execute request, you will receive HttpResponse and you can extract responce content like that : BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8")); String json = reader.readLine(); – Lukario Nov 26 '18 at 09:44