Constructor

ImageAnnotatorClient

new ImageAnnotatorClient(options)

Construct an instance of ImageAnnotatorClient.

Parameter

options

Optional

object

The configuration object. See the subsequent parameters for more details.

Properties

port

static

The port for this API service.

scopes

static

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static

The DNS address for this API service.

Methods

batchAnnotateImages

batchAnnotateImages(request, options, callback) returns Promise

Run image detection and annotation for a batch of images.

Parameter

request

Object

The request object that will be sent.

options

Optional

Object

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback

Optional

function(nullable Error, nullable Object)

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing BatchAnnotateImagesResponse.

Returns

Promise 

  • The promise which resolves to an array. The first element of the array is an object representing BatchAnnotateImagesResponse. The promise has a method named "cancel" which cancels the ongoing API call.

Example

const vision = require('@google-cloud/vision');

var client = new vision.v1p1beta1.ImageAnnotatorClient({
  // optional auth parameters.
});

var requests = [];
client.batchAnnotateImages({requests: requests})
  .then(responses => {
    var response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

getProjectId

getProjectId(callback)

Return the project ID used by this class.

Parameter

callback

function(Error, string)

the callback to be called with the current project Id.