vision api
影像辨識
const Vision = require('@google-cloud/vision');
// Instantiates a client
const vision = Vision({
languageHints: [ "en", "zh-TW", "zh-CN" ], //要辨識的語言
keyFilename:'./01.json'
});
// The path to the local image file, e.g. "/path/to/image.png"
// const fileName = '/path/to/image.png';
// Performs text detection on the local file
vision.detectText('./0.jpg')
.then((results) => {
const detections = results[0];
console.log('Text:');
detections.forEach((text) => console.log(text));
});Open Source可用模組
#從browser發出request
Last updated