Last active
August 5, 2019 20:21
-
-
Save OlafenwaMoses/cec40e739466d8eb984a7ab53464ab7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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