API documentation for vision_v1.types
module.
Classes
AddProductToProductSetRequest
Request message for the AddProductToProductSet
method.
Required. The resource name for the Product to be added to
this ProductSet. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
AnnotateFileRequest
A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
Required. Requested features.
Pages of the file to perform image annotation. Pages starts from 1, we assume the first page of the file is page 1. At most 5 pages are supported per request. Pages can be negative. Page 1 means the first page. Page 2 means the second page. Page -1 means the last page. Page -2 means the second to the last page. If the file is GIF instead of PDF or TIFF, page refers to GIF frames. If this field is empty, by default the service performs image annotation for the first 5 pages of the file.
AnnotateFileResponse
Response to a single file annotation request. A file may contain one or more images, which individually have their own responses.
Individual responses to images found within the file. This
field will be empty if the error
field is set.
If set, represents the error message for the failed request.
The responses
field will not be set in this case.
AnnotateImageRequest
Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.
Requested features.
AnnotateImageResponse
Response to an image annotation request.
If present, landmark detection has completed successfully.
If present, label detection has completed successfully.
If present, text (OCR) detection has completed successfully.
If present, safe-search annotation has completed successfully.
If present, crop hints have completed successfully.
If present, product search has completed successfully.
If present, contextual information is needed to understand where this image comes from.
Any
API documentation for vision_v1.types.Any
class.
AsyncAnnotateFileRequest
An offline file annotation request.
Required. Requested features.
Required. The desired output location and metadata (e.g. format).
AsyncAnnotateFileResponse
The response for a single offline file annotation request.
AsyncBatchAnnotateFilesRequest
Multiple async file annotation requests are batched into a single service call.
Optional. Target project and location to make a call. Format:
projects/{project-id}/locations/{location-id}
. If no
parent is specified, a region will be chosen automatically.
Supported location-ids: us
: USA country only, asia
:
East asia areas, like Japan, Taiwan, eu
: The European
Union. Example: projects/project-A/locations/eu
.
AsyncBatchAnnotateFilesResponse
Response to an async batch file annotation request.
AsyncBatchAnnotateImagesRequest
Request for async image annotation for a list of images.
Required. The desired output location and metadata (e.g. format).
AsyncBatchAnnotateImagesResponse
Response to an async batch image annotation request.
BatchAnnotateFilesRequest
A list of requests to annotate files using the BatchAnnotateFiles API.
Optional. Target project and location to make a call. Format:
projects/{project-id}/locations/{location-id}
. If no
parent is specified, a region will be chosen automatically.
Supported location-ids: us
: USA country only, asia
:
East asia areas, like Japan, Taiwan, eu
: The European
Union. Example: projects/project-A/locations/eu
.
BatchAnnotateFilesResponse
A list of file annotation responses.
BatchAnnotateImagesRequest
Multiple image annotation requests are batched into a single service call.
Optional. Target project and location to make a call. Format:
projects/{project-id}/locations/{location-id}
. If no
parent is specified, a region will be chosen automatically.
Supported location-ids: us
: USA country only, asia
:
East asia areas, like Japan, Taiwan, eu
: The European
Union. Example: projects/project-A/locations/eu
.
BatchAnnotateImagesResponse
Response to a batch image annotation request.
BatchOperationMetadata
Metadata for the batch operations such as the current state.
This is included in the metadata
field of the Operation
returned
by the GetOperation
call of the google::longrunning::Operations
service.
The time when the batch request was submitted to the server.
Block
Logical element on the page.
The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: - when the text is horizontal it might look like: :: 0----1 | | 3----2 - when it's rotated 180 degrees around the top-left corner it becomes: :: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
Detected block type (text, image etc) for this block.
BoolValue
API documentation for vision_v1.types.BoolValue
class.
BoundingPoly
A bounding polygon for the detected image annotation.
The bounding polygon normalized vertices.
BytesValue
API documentation for vision_v1.types.BytesValue
class.
CancelOperationRequest
API documentation for vision_v1.types.CancelOperationRequest
class.
Color
API documentation for vision_v1.types.Color
class.
ColorInfo
Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.
Image-specific score for this color. Value in range [0, 1].
CreateProductRequest
Request message for the CreateProduct
method.
Required. The product to create.
CreateProductSetRequest
Request message for the CreateProductSet
method.
Required. The ProductSet to create.
CreateReferenceImageRequest
Request message for the CreateReferenceImage
method.
Required. The reference image to create. If an image ID is specified, it is ignored.
CropHint
Single crop hint that is used to generate a new crop when serving an image.
Confidence of this being a salient region. Range [0, 1].
CropHintsAnnotation
Set of crop hints that are used to generate new crops when serving images.
CropHintsParams
Parameters for crop hints annotation request.
DeleteOperationRequest
API documentation for vision_v1.types.DeleteOperationRequest
class.
DeleteProductRequest
Request message for the DeleteProduct
method.
DeleteProductSetRequest
Request message for the DeleteProductSet
method.
DeleteReferenceImageRequest
Request message for the DeleteReferenceImage
method.
DominantColorsAnnotation
Set of dominant colors and their corresponding scores.
DoubleValue
API documentation for vision_v1.types.DoubleValue
class.
Empty
API documentation for vision_v1.types.Empty
class.
EntityAnnotation
Set of detected entity features.
The language code for the locale in which the entity textual
description
is expressed.
Overall score of the result. Range [0, 1].
The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1].
The location information for the detected entity. Multiple
LocationInfo
elements can be present because one location
may indicate the location of the scene in the image, and
another location may indicate the location of the place where
the image was taken. Location information is usually present
for landmarks.
FaceAnnotation
A face annotation object contains the results of face detection.
The fd_bounding_poly
bounding polygon is tighter than the
boundingPoly
, and encloses only the skin part of the face.
Typically, it is used to eliminate the face from any image
analysis that detects the "amount of skin" visible in an
image. It is not based on the landmarker results, only on the
initial face detection, hence the fd (face detection) prefix.
Roll angle, which indicates the amount of clockwise/anti- clockwise rotation of the face relative to the image vertical about the axis perpendicular to the face. Range [-180,180].
Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image's horizontal plane. Range [-180,180].
Face landmarking confidence. Range [0, 1].
Sorrow likelihood.
Surprise likelihood.
Blurred likelihood.
Feature
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.
Maximum number of results of this type. Does not apply to
TEXT_DETECTION
, DOCUMENT_TEXT_DETECTION
, or
CROP_HINTS
.
FieldMask
API documentation for vision_v1.types.FieldMask
class.
FloatValue
API documentation for vision_v1.types.FloatValue
class.
GcsDestination
The Google Cloud Storage location where the output will be written to.
GcsSource
The Google Cloud Storage location where the input will be read from.
GetOperationRequest
API documentation for vision_v1.types.GetOperationRequest
class.
GetProductRequest
Request message for the GetProduct
method.
GetProductSetRequest
Request message for the GetProductSet
method.
GetReferenceImageRequest
Request message for the GetReferenceImage
method.
Image
Client image to perform Google Cloud Vision API tasks over.
Google Cloud Storage image location, or publicly-accessible
image URL. If both content
and source
are provided for
an image, content
takes precedence and is used to perform
the image annotation request.
ImageAnnotationContext
If an image was produced from a file (e.g. a PDF), this message gives information about the source of that image.
If the file was a PDF or TIFF, this field gives the page number within the file used to produce the image.
ImageContext
Image context and/or feature-specific parameters.
List of languages to use for TEXT_DETECTION. In most cases,
an empty value yields the best results since it enables
automatic language detection. For languages based on the Latin
alphabet, setting language_hints
is not needed. In rare
cases, when the language of the text in the image is known,
setting a hint will help get better results (although it will
be a significant hindrance if the hint is wrong). Text
detection returns an error if one or more of the specified
languages is not one of the supported languages
</vision/docs/languages>
__.
Parameters for product search.
ImageProperties
Stores image properties, such as dominant colors.
ImageSource
External image source (Google Cloud Storage or web URL image location).
The URI of the source image. Can be either: 1. A Google Cloud
Storage URI of the form gs://bucket_name/object_name
.
Object versioning is not supported. See Google Cloud
Storage Request URIs
<https://cloud.google.com/storage/docs/reference-uris>
__ for
more info. 2. A publicly-accessible image HTTP/HTTPS URL.
When fetching images from HTTP/HTTPS URLs, Google cannot
guarantee that the request will be completed. Your request
may fail if the specified host denies the request (e.g. due
to request throttling or DOS prevention), or if Google
throttles requests to the site for abuse prevention. You
should not depend on externally-hosted images for production
applications. When both gcs_image_uri
and image_uri
are specified, image_uri
takes precedence.
ImportProductSetsGcsSource
The Google Cloud Storage location for a csv file which preserves a list of ImportProductSetRequests in each line.
ImportProductSetsInputConfig
The input content for the ImportProductSets
method.
The Google Cloud Storage location for a csv file which preserves a list of ImportProductSetRequests in each line.
ImportProductSetsRequest
Request message for the ImportProductSets
method.
Required. The input content for the list of requests.
ImportProductSetsResponse
Response message for the ImportProductSets
method.
This message is returned by the
google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation]
method in the returned
google.longrunning.Operation.response][google.longrunning.Operation.response]
field.
The rpc status for each ImportProductSet request, including both successes and errors. The number of statuses here matches the number of lines in the csv file, and statuses[i] stores the success or failure status of processing the i-th line of the csv, starting from line 0.
InputConfig
The desired input location and metadata.
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.
Int32Value
API documentation for vision_v1.types.Int32Value
class.
Int64Value
API documentation for vision_v1.types.Int64Value
class.
LatLng
API documentation for vision_v1.types.LatLng
class.
LatLongRect
Rectangle determined by min and max LatLng
pairs.
Max lat/long pair.
ListOperationsRequest
API documentation for vision_v1.types.ListOperationsRequest
class.
ListOperationsResponse
API documentation for vision_v1.types.ListOperationsResponse
class.
ListProductSetsRequest
Request message for the ListProductSets
method.
The maximum number of items to return. Default 10, maximum 100.
ListProductSetsResponse
Response message for the ListProductSets
method.
Token to retrieve the next page of results, or empty if there are no more results in the list.
ListProductsInProductSetRequest
Request message for the ListProductsInProductSet
method.
The maximum number of items to return. Default 10, maximum 100.
ListProductsInProductSetResponse
Response message for the ListProductsInProductSet
method.
Token to retrieve the next page of results, or empty if there are no more results in the list.
ListProductsRequest
Request message for the ListProducts
method.
The maximum number of items to return. Default 10, maximum 100.
ListProductsResponse
Response message for the ListProducts
method.
Token to retrieve the next page of results, or empty if there are no more results in the list.
ListReferenceImagesRequest
Request message for the ListReferenceImages
method.
The maximum number of items to return. Default 10, maximum 100.
ListReferenceImagesResponse
Response message for the ListReferenceImages
method.
The maximum number of items to return. Default 10, maximum 100.
LocalizedObjectAnnotation
Set of detected objects with bounding boxes.
The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see http://www.unicode.org/reports/tr35/#Uni code_locale_identifier.
Score of the result. Range [0, 1].
LocationInfo
Detected entity location information.
NormalizedVertex
X coordinate.
Operation
API documentation for vision_v1.types.Operation
class.
OperationInfo
API documentation for vision_v1.types.OperationInfo
class.
OperationMetadata
Contains metadata for the BatchAnnotateImages operation.
The time when the batch request was received.
OutputConfig
The desired output location and metadata.
The max number of response protos to put into each output JSON
file on Google Cloud Storage. The valid range is [1, 100]. If
not specified, the default value is 20. For example, for one
pdf file with 100 pages, 100 response protos will be
generated. If batch_size
= 20, then 5 json files each
containing 20 response protos will be written under the prefix
gcs_destination
.\ uri
. Currently, batch_size only
applies to GcsDestination, with potential future support for
other output configurations.
Page
Detected page from OCR.
Page width. For PDFs the unit is points. For images (including TIFFs) the unit is pixels.
List of blocks of text, images etc on this page.
Paragraph
Structural unit of text representing a number of words in certain order.
The bounding box for the paragraph. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3 ----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
Confidence of the OCR results for the paragraph. Range [0, 1].
Position
A 3D position in the image, used primarily for Face detection landmarks. A valid Position must have both x and y coordinates. The position coordinates are in the same scale as the original image.
Y coordinate.
Product
A Product contains ReferenceImages.
The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.
Immutable. The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products.
ProductSearchParams
Parameters for a product search request.
The resource name of a
ProductSet to be searched
for similar images. Format is: projects/PROJECT_ID/location
s/LOC_ID/productSets/PRODUCT_SET_ID
.
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 '='.
ProductSearchResults
Results for a product search request.
List of results, one for each product match.
ProductSet
A ProductSet contains Products. A ProductSet can contain a maximum of 1 million reference images. If the limit is exceeded, periodic indexing will fail.
The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 characters long.
Output only. If there was an error with indexing the product set, the field is populated. This field is ignored when creating a ProductSet.
ProductSetPurgeConfig
Config to control which ProductSet contains the Products to be deleted.
Property
A Property
consists of a user-supplied name/value
pair.
Value of the property.
PurgeProductsRequest
Request message for the PurgeProducts
method.
Specify which ProductSet contains the Products to be deleted.
Required. The project and location in which the Products
should be deleted. Format is
projects/PROJECT_ID/locations/LOC_ID
.
ReferenceImage
A ReferenceImage
represents a product image and its
associated metadata, such as bounding boxes.
Required. The Google Cloud Storage URI of the reference image.
The URI must start with gs://
.
RemoveProductFromProductSetRequest
Request message for the RemoveProductFromProductSet
method.
Required. The resource name for the Product to be removed from
this ProductSet. Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
SafeSearchAnnotation
Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence).
Spoof likelihood. The likelihood that an modification was made to the image's canonical version to make it appear funny or offensive.
Likelihood that this image contains violent content.
Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means very confident.
Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means very confident.
Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very confident.
Status
API documentation for vision_v1.types.Status
class.
StringValue
API documentation for vision_v1.types.StringValue
class.
Symbol
A single symbol representation.
The bounding box for the symbol. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3 ----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
Confidence of the OCR results for the symbol. Range [0, 1].
TextAnnotation
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.
UTF-8 text detected on the pages.
Timestamp
API documentation for vision_v1.types.Timestamp
class.
UInt32Value
API documentation for vision_v1.types.UInt32Value
class.
UInt64Value
API documentation for vision_v1.types.UInt64Value
class.
UpdateProductRequest
Request message for the UpdateProduct
method.
The FieldMask][google.protobuf.FieldMask]
that specifies
which fields to update. If update_mask isn't specified, all
mutable fields are to be updated. Valid mask paths include
product_labels
, display_name
, and description
.
UpdateProductSetRequest
Request message for the UpdateProductSet
method.
The FieldMask][google.protobuf.FieldMask]
that specifies
which fields to update. If update_mask isn't specified, all
mutable fields are to be updated. Valid mask path is
display_name
.
Vertex
X coordinate.
WaitOperationRequest
API documentation for vision_v1.types.WaitOperationRequest
class.
WebDetection
Relevant information for the image from the Internet.
Fully matching images from the Internet. Can include resized copies of the query image.
Web pages containing the matching images from the Internet.
The service's best guess as to the topic of the request image. Inferred from similar images on the open web.
WebDetectionParams
Parameters for web detection request.
Word
A word representation.
The bounding box for the word. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the 'natural' orientation. For example: * when the text is horizontal it might look like: 0----1 | | 3 ----2 * when it's rotated 180 degrees around the top-left corner it becomes: 2----3 | | 1----0 and the vertex order will still be (0, 1, 2, 3).
Confidence of the OCR results for the word. Range [0, 1].