0👍
If anyone is looking to implement Google Vision Api in a Vue.js/ Django app, this is how I resolved it:
checkImageLabels: function() {
this.picToCheck = this.image.dataUrl.replace(/^data:image\/[a-z]+;base64,/, "");
const data = {
"requests" : [{
"features": [{
"type": "LABEL_DETECTION"
}],
"image": {
"content": this.picToCheck
}
}]
}
axios.post(`https://vision.googleapis.com/v1/images:annotate?key=${this.apiKey}`, data)
}
You have to have "axios" imported into your project and a valid Google Cloud APIKey. As for the input format, I use base64 pictures and I clear the header with a regular expression.
Source:stackexchange.com