luminoth icon indicating copy to clipboard operation
luminoth copied to clipboard

Web server API

Open DConcord opened this issue 5 years ago • 1 comments

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

DConcord avatar Mar 02 '19 06:03 DConcord

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

mcr-ksh avatar Dec 30 '19 14:12 mcr-ksh