Skip to content

Instantly share code, notes, and snippets.

@OlafenwaMoses
Last active August 5, 2019 20:21
Show Gist options
  • Save OlafenwaMoses/cec40e739466d8eb984a7ab53464ab7b to your computer and use it in GitHub Desktop.
Save OlafenwaMoses/cec40e739466d8eb984a7ab53464ab7b to your computer and use it in GitHub Desktop.
const request = require("request")
const fs = require("fs")
image_stream = fs.createReadStream("test-image.jpg")
var form = {"image":image_stream}
request.post({url:"http://localhost:80/v1/vision/detection", formData:form},function(err,res,body){
response = JSON.parse(body)
predictions = response["predictions"]
for(var i =0; i < predictions.length; i++){
console.log(predictions[i]["label"])
}
console.log(response)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment