带有Node.js的Google Vision API:如何指定区域?

时间:2019-04-15 11:36:17

标签: node.js google-vision

使用相应的Node.js client package访问Google API时,例如Cloud Vision API @google-cloud/vision如何指定在其中调用此资源的region

我问是因为其他提供程序允许您将区域指定为客户端类构造函数的一部分,例如AWS JavaScript SDK

var s3 = new AWS.S3({apiVersion: '2006-03-01', region: 'us-west-2'});

但是,我在ImageAnnotatorClient中找不到类似的参数:

// Imports the Google Cloud client library
const vision = require('@google-cloud/vision');

// Creates a client
const client = new vision.ImageAnnotatorClient();

// Performs label detection on the image file
client
  .labelDetection('./resources/wakeupcat.jpg')
  .then(results => { 
    // do something with the results
  })
  .catch(err => {
    console.error('ERROR:', err);
  });

0 个答案:

没有答案