Skip to content

Instantly share code, notes, and snippets.

@OlafenwaMoses
Last active May 29, 2019 14:45
Show Gist options
  • Save OlafenwaMoses/81e2789c3c4eb3c4fc3f503ab9fff407 to your computer and use it in GitHub Desktop.
Save OlafenwaMoses/81e2789c3c4eb3c4fc3f503ab9fff407 to your computer and use it in GitHub Desktop.
const request = require("request")
const fs = require("fs")
image_stream = fs.createReadStream("office.png")
var form = {"image":image_stream}
//REMEMBER TO REPLACE IP '165.22.72.67' below with the IP of your Ubuntu server
request.post({url:"http://165.22.72.67: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