johnolafenwa / DeepStack

The World's Leading Cross Platform AI Engine for Edge Devices
Apache License 2.0
678 stars 107 forks source link

image vs file compatability in requests post #25

Closed robmarkcole closed 3 years ago

robmarkcole commented 4 years ago

scope change

robmarkcole commented 3 years ago

I am using FastAPI in https://github.com/robmarkcole/tensorflow-lite-rest-server and I have encountered a bit of a fundamental difference.

Deepstack currently accepts a request of form: requests.post(API_URL, files={"image": image_bytes}). but this is not valid on fastapi.

On the other hand fastapi accepts: requests.post(API_URL, files={"file": image_bytes}) but deepstack does not..!

I believe the use of 'file' indicates a multipart-encoded-file. In deepstack it appears you are checking for "image" in the payload. I am not sure what 'the correct' way is or how to resolve this. Any advice?

Tracking here: https://github.com/robmarkcole/tensorflow-lite-rest-server/issues/26

robmarkcole commented 3 years ago

Ok resolved this in fastapi by renaming the input variable from file to image