Annotate

Service that performs image detection and annotation for a batch of files

22 variables
16 variables

Service that performs image detection and annotation for a batch of files. Now only "application/pdf", "image/tiff" and "image/gif" are supported.

This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • View and manage your data across Google Cloud Platform services
  • Apply machine learning models to understand and label images

Input

This building block consumes 22 input parameters

  = Parameter name
  = Format

requests[] OBJECT

A request to annotate one single file, e.g. a PDF, TIFF or GIF file

requests[].pages[] INTEGER

requests[].inputConfig OBJECT

The desired input location and metadata

requests[].inputConfig.content BINARY

File content, represented as a stream of bytes. Note: As with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

Currently, this field only works for BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles requests

requests[].inputConfig.gcsSource OBJECT

The Google Cloud Storage location where the input will be read from

requests[].inputConfig.gcsSource.uri STRING

Google Cloud Storage URI for the input file. This must only be a Google Cloud Storage object. Wildcards are not currently supported

requests[].inputConfig.mimeType STRING

The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" are supported. Wildcards are not supported

requests[].features[] OBJECT

The type of Google Cloud Vision API detection to perform, and the maximum number of results to return for that type. Multiple Feature objects can be specified in the features list

requests[].features[].type ENUMERATION

The feature type

requests[].features[].maxResults INTEGER

Maximum number of results of this type. Does not apply to TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, or CROP_HINTS

requests[].features[].model STRING

Model to use for the feature. Supported values: "builtin/stable" (the default if unset) and "builtin/latest"

requests[].imageContext OBJECT

Image context and/or feature-specific parameters

requests[].imageContext.cropHintsParams OBJECT

Parameters for crop hints annotation request

requests[].imageContext.cropHintsParams.aspectRatios[] FLOAT

requests[].imageContext.productSearchParams OBJECT

Parameters for a product search request

requests[].imageContext.productSearchParams.productCategories[] STRING

requests[].imageContext.productSearchParams.filter STRING

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='

requests[].imageContext.productSearchParams.productSet STRING

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

requests[].imageContext.languageHints[] STRING

requests[].imageContext.webDetectionParams OBJECT

Parameters for web detection request

requests[].imageContext.webDetectionParams.includeGeoResults BOOLEAN

Whether to include results derived from the geo information in the image

requests[].imageContext.latLongRect OBJECT

Rectangle determined by min and max LatLng pairs

Output

This building block provides 16 output parameters

  = Parameter name
  = Format

responses[] OBJECT

Response to a single file annotation request. A file may contain one or more images, which individually have their own responses

responses[].responses[] OBJECT

Response to an image annotation request

responses[].responses[].productSearchResults OBJECT

Results for a product search request

responses[].responses[].error OBJECT

The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the API Design Guide

responses[].responses[].fullTextAnnotation OBJECT

TextAnnotation contains a structured representation of OCR extracted text. The hierarchy of an OCR extracted text structure is like this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each structural component, starting from Page, may further have their own properties. Properties describe detected languages, breaks etc.. Please refer to the TextAnnotation.TextProperty message definition below for more detail

responses[].responses[].imagePropertiesAnnotation OBJECT

Stores image properties, such as dominant colors

responses[].responses[].context OBJECT

If an image was produced from a file (e.g. a PDF), this message gives information about the source of that image

responses[].responses[].webDetection OBJECT

Relevant information for the image from the Internet

responses[].responses[].safeSearchAnnotation OBJECT

Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence)

responses[].responses[].cropHintsAnnotation OBJECT

Set of crop hints that are used to generate new crops when serving images

responses[].inputConfig OBJECT

The desired input location and metadata

responses[].inputConfig.content BINARY

File content, represented as a stream of bytes. Note: As with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

Currently, this field only works for BatchAnnotateFiles requests. It does not work for AsyncBatchAnnotateFiles requests

responses[].inputConfig.gcsSource OBJECT

The Google Cloud Storage location where the input will be read from

responses[].inputConfig.gcsSource.uri STRING

Google Cloud Storage URI for the input file. This must only be a Google Cloud Storage object. Wildcards are not currently supported

responses[].inputConfig.mimeType STRING

The type of the file. Currently only "application/pdf", "image/tiff" and "image/gif" are supported. Wildcards are not supported

responses[].totalPages INTEGER

This field gives the total number of pages in the file