johnolafenwa/DeepStack

image vs file compatability in requests post

Closed this issue · 2 comments

scope change

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: robmarkcole/tensorflow-lite-rest-server#26

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