Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web server API #270

Open
DConcord opened this issue Mar 2, 2019 · 1 comment
Open

Web server API #270

DConcord opened this issue Mar 2, 2019 · 1 comment

Comments

@DConcord
Copy link

DConcord commented Mar 2, 2019

Hi, is it possible to run the web server and use it to run API calls with something simple such as cURL to POST an image and get the object detection results returned as JSON?

running the server with these flags:
lumi server web --checkpoint fast --host "0.0.0.0" --port 5000

I've tried various methods with no luck:
curl -X POST -F 'file=@/path/to/file' http://x.x.x.x:5000/api/fasterrcnn/predict/

status code: 400
{"error":"Missing image"}

In Node-Red, I also tried converting my binary image to base64 and performing a POST with content-type: application/json, but same status code and error.

Any suggestions? thanks for the great product! Saved me a ton of work and headache trying to get familiarized with Tensorflow for the first time

@mcr-ksh
Copy link

mcr-ksh commented Dec 30, 2019

do specify instead of "file" -> "image".
curl -X POST -F 'image=@/tmp/pic.jpg'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants