0
我正在嘗試使用Google Cloud Vision API檢測遠程圖像中的文本,但似乎無法獲得vision.detectText()語法。谷歌雲視覺API:node.js和圖像的URI,如何調用vision.detectText()?
當沒有云存儲存儲桶時,如何使用vision.detectText()?
我想我可以/應該忽略參考storage.bucket()上https://cloud.google.com/vision/docs/detecting-text
表示我:
vision.detectText('https://drive.google.com/file
/d/0Bw4DMtLCtPMkWVlIVXE5a2ZpQlU/view?usp=drivesdk')
.then((results) => {
const detections = results[0];
console.log('Text:');
detections.forEach((text) => console.log(text));
})
.catch((err) => {
console.error('ERROR:', err);
});
控制檯報告:
ERROR: { PartialFailureError: A failure occurred during this request.
at /Users/node_modules/@google-cloud/vision/src/index.js:434:15
at /Users/node_modules/@google-cloud/vision/src/index.js:126:5
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
errors:
[ { image: 'https://drive.google.com/file/d
/0Bw4DMtLCtPMkNFFselFhU0RMV2c/view?usp=drivesdk',
errors: [Object] } ],
response: { responses: [ [Object] ] },
message: 'A failure occurred during this request.' }
我已嘗試使用:
vision.detectText(storage.bucket().file('https://......
但錯誤是:
Error: A bucket name is needed to use Cloud Storage.
vision.detectFaces()不表示一個桶參數像vision.detectText() – user1405141
已更新,以演示文本檢測 – class
罷工。讓我看看,謝謝。 – user1405141