tryolabs / luminoth

Deep Learning toolkit for Computer Vision.
https://tryolabs.com
BSD 3-Clause "New" or "Revised" License
2.4k stars 401 forks source link

Web server API #270

Open DConcord opened 5 years ago

DConcord commented 5 years ago

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 commented 4 years ago

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