Types for Google Cloud Vision v1 API¶
- class google.cloud.vision_v1.types.AddProductToProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
AddProductToProductSet
method.- name¶
Required. The resource name for the ProductSet to modify.
Format is:
projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
- Type
- class google.cloud.vision_v1.types.AnnotateFileRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A request to annotate one single file, e.g. a PDF, TIFF or GIF file.
- input_config¶
Required. Information about the input file.
- features¶
Required. Requested features.
- Type
MutableSequence[google.cloud.vision_v1.types.Feature]
- image_context¶
Additional context that may accompany the image(s) in the file.
- pages¶
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.
- Type
MutableSequence[int]
- class google.cloud.vision_v1.types.AnnotateFileResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to a single file annotation request. A file may contain one or more images, which individually have their own responses.
- input_config¶
Information about the file for which this response is generated.
- responses¶
Individual responses to images found within the file. This field will be empty if the
error
field is set.- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]
- error¶
If set, represents the error message for the failed request. The
responses
field will not be set in this case.- Type
google.rpc.status_pb2.Status
- class google.cloud.vision_v1.types.AnnotateImageRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for performing Google Cloud Vision API tasks over a user-provided image, with user-requested features, and with context information.
- image¶
The image to be processed.
- features¶
Requested features.
- Type
MutableSequence[google.cloud.vision_v1.types.Feature]
- image_context¶
Additional context that may accompany the image.
- class google.cloud.vision_v1.types.AnnotateImageResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to an image annotation request.
- face_annotations¶
If present, face detection has completed successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.FaceAnnotation]
- landmark_annotations¶
If present, landmark detection has completed successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.EntityAnnotation]
- logo_annotations¶
If present, logo detection has completed successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.EntityAnnotation]
- label_annotations¶
If present, label detection has completed successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.EntityAnnotation]
- localized_object_annotations¶
If present, localized object detection has completed successfully. This will be sorted descending by confidence score.
- Type
MutableSequence[google.cloud.vision_v1.types.LocalizedObjectAnnotation]
- text_annotations¶
If present, text (OCR) detection has completed successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.EntityAnnotation]
- full_text_annotation¶
If present, text (OCR) detection or document (OCR) text detection has completed successfully. This annotation provides the structural hierarchy for the OCR detected text.
- safe_search_annotation¶
If present, safe-search annotation has completed successfully.
- image_properties_annotation¶
If present, image properties were extracted successfully.
- crop_hints_annotation¶
If present, crop hints have completed successfully.
- web_detection¶
If present, web detection has completed successfully.
- product_search_results¶
If present, product search has completed successfully.
- error¶
If set, represents the error message for the operation. Note that filled-in image annotations are guaranteed to be correct, even when
error
is set.- Type
google.rpc.status_pb2.Status
- context¶
If present, contextual information is needed to understand where this image comes from.
- class google.cloud.vision_v1.types.AsyncAnnotateFileRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
An offline file annotation request.
- input_config¶
Required. Information about the input file.
- features¶
Required. Requested features.
- Type
MutableSequence[google.cloud.vision_v1.types.Feature]
- image_context¶
Additional context that may accompany the image(s) in the file.
- output_config¶
Required. The desired output location and metadata (e.g. format).
- class google.cloud.vision_v1.types.AsyncAnnotateFileResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The response for a single offline file annotation request.
- output_config¶
The output location and metadata from AsyncAnnotateFileRequest.
- class google.cloud.vision_v1.types.AsyncBatchAnnotateFilesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Multiple async file annotation requests are batched into a single service call.
- requests¶
Required. Individual async file annotation requests for this batch.
- Type
MutableSequence[google.cloud.vision_v1.types.AsyncAnnotateFileRequest]
- parent¶
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
.- Type
- class google.cloud.vision_v1.types.AsyncBatchAnnotateFilesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to an async batch file annotation request.
- responses¶
The list of file annotation responses, one for each request in AsyncBatchAnnotateFilesRequest.
- Type
MutableSequence[google.cloud.vision_v1.types.AsyncAnnotateFileResponse]
- class google.cloud.vision_v1.types.AsyncBatchAnnotateImagesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request for async image annotation for a list of images.
- requests¶
Required. Individual image annotation requests for this batch.
- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateImageRequest]
- output_config¶
Required. The desired output location and metadata (e.g. format).
- parent¶
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
.- Type
- class google.cloud.vision_v1.types.AsyncBatchAnnotateImagesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to an async batch image annotation request.
- output_config¶
The output location and metadata from AsyncBatchAnnotateImagesRequest.
- class google.cloud.vision_v1.types.BatchAnnotateFilesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A list of requests to annotate files using the BatchAnnotateFiles API.
- requests¶
Required. The list of file annotation requests. Right now we support only one AnnotateFileRequest in BatchAnnotateFilesRequest.
- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateFileRequest]
- parent¶
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
.- Type
- class google.cloud.vision_v1.types.BatchAnnotateFilesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A list of file annotation responses.
- responses¶
The list of file annotation responses, each response corresponding to each AnnotateFileRequest in BatchAnnotateFilesRequest.
- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateFileResponse]
- class google.cloud.vision_v1.types.BatchAnnotateImagesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Multiple image annotation requests are batched into a single service call.
- requests¶
Required. Individual image annotation requests for this batch.
- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateImageRequest]
- parent¶
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
.- Type
- class google.cloud.vision_v1.types.BatchAnnotateImagesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response to a batch image annotation request.
- responses¶
Individual responses to image annotation requests within the batch.
- Type
MutableSequence[google.cloud.vision_v1.types.AnnotateImageResponse]
- class google.cloud.vision_v1.types.BatchOperationMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata for the batch operations such as the current state.
This is included in the
metadata
field of theOperation
returned by theGetOperation
call of thegoogle::longrunning::Operations
service.- state¶
The current state of the batch operation.
- submit_time¶
The time when the batch request was submitted to the server.
- end_time¶
The time when the batch request is finished and [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true.
- class State(value)[source]¶
Bases:
proto.enums.Enum
Enumerates the possible states that the batch request can be in.
- Values:
- STATE_UNSPECIFIED (0):
Invalid.
- PROCESSING (1):
Request is actively being processed.
- SUCCESSFUL (2):
The request is done and at least one item has been successfully processed.
- FAILED (3):
The request is done and no item has been successfully processed.
- CANCELLED (4):
The request is done after the longrunning.Operations.CancelOperation has been called by the user. Any records that were processed before the cancel command are output as specified in the request.
- class google.cloud.vision_v1.types.Block(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Logical element on the page.
- property¶
Additional information detected for the block.
- bounding_box¶
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).
- paragraphs¶
List of paragraphs in this block (if this blocks is of type text).
- Type
MutableSequence[google.cloud.vision_v1.types.Paragraph]
- block_type¶
Detected block type (text, image etc) for this block.
- class BlockType(value)[source]¶
Bases:
proto.enums.Enum
Type of a block (text, image etc) as identified by OCR.
- Values:
- UNKNOWN (0):
Unknown block type.
- TEXT (1):
Regular text block.
- TABLE (2):
Table block.
- PICTURE (3):
Image block.
- RULER (4):
Horizontal/vertical line box.
- BARCODE (5):
Barcode block.
- class google.cloud.vision_v1.types.BoundingPoly(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A bounding polygon for the detected image annotation.
- vertices¶
The bounding polygon vertices.
- Type
MutableSequence[google.cloud.vision_v1.types.Vertex]
- normalized_vertices¶
The bounding polygon normalized vertices.
- Type
MutableSequence[google.cloud.vision_v1.types.NormalizedVertex]
- class google.cloud.vision_v1.types.ColorInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.
- color¶
RGB components of the color.
- Type
google.type.color_pb2.Color
- class google.cloud.vision_v1.types.CreateProductRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
CreateProduct
method.- parent¶
Required. The project in which the Product should be created.
Format is
projects/PROJECT_ID/locations/LOC_ID
.- Type
- product¶
Required. The product to create.
- class google.cloud.vision_v1.types.CreateProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
CreateProductSet
method.- parent¶
Required. The project in which the ProductSet should be created.
Format is
projects/PROJECT_ID/locations/LOC_ID
.- Type
- product_set¶
Required. The ProductSet to create.
- class google.cloud.vision_v1.types.CreateReferenceImageRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
CreateReferenceImage
method.- parent¶
Required. Resource name of the product in which to create the reference image.
Format is
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
.- Type
- reference_image¶
Required. The reference image to create. If an image ID is specified, it is ignored.
- reference_image_id¶
A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character
/
.- Type
- class google.cloud.vision_v1.types.CropHint(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Single crop hint that is used to generate a new crop when serving an image.
- bounding_poly¶
The bounding polygon for the crop region. The coordinates of the bounding box are in the original image’s scale.
- class google.cloud.vision_v1.types.CropHintsAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Set of crop hints that are used to generate new crops when serving images.
- crop_hints¶
Crop hint results.
- Type
MutableSequence[google.cloud.vision_v1.types.CropHint]
- class google.cloud.vision_v1.types.CropHintsParams(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Parameters for crop hints annotation request.
- aspect_ratios¶
Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.
- Type
MutableSequence[float]
- class google.cloud.vision_v1.types.DeleteProductRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
DeleteProduct
method.
- class google.cloud.vision_v1.types.DeleteProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
DeleteProductSet
method.
- class google.cloud.vision_v1.types.DeleteReferenceImageRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
DeleteReferenceImage
method.
- class google.cloud.vision_v1.types.DominantColorsAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Set of dominant colors and their corresponding scores.
- colors¶
RGB color values with their score and pixel fraction.
- Type
MutableSequence[google.cloud.vision_v1.types.ColorInfo]
- class google.cloud.vision_v1.types.EntityAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Set of detected entity features.
- mid¶
Opaque entity ID. Some IDs may be available in Google Knowledge Graph Search API.
- Type
- locale¶
The language code for the locale in which the entity textual
description
is expressed.- Type
- confidence¶
Deprecated. Use ``score`` instead. The accuracy of the entity detection in an image. For example, for an image in which the “Eiffel Tower” entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1].
- Type
- topicality¶
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].
- Type
- bounding_poly¶
Image region to which this entity belongs. Not produced for
LABEL_DETECTION
features.
- locations¶
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.- Type
MutableSequence[google.cloud.vision_v1.types.LocationInfo]
- properties¶
Some entities may have optional user-supplied
Property
(name/value) fields, such a score or string that qualifies the entity.- Type
MutableSequence[google.cloud.vision_v1.types.Property]
- class google.cloud.vision_v1.types.FaceAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A face annotation object contains the results of face detection.
- bounding_poly¶
The bounding polygon around the face. The coordinates of the bounding box are in the original image’s scale. The bounding box is computed to “frame” the face in accordance with human expectations. It is based on the landmarker results. Note that one or more x and/or y coordinates may not be generated in the
BoundingPoly
(the polygon will be unbounded) if only a partial face appears in the image to be annotated.
- fd_bounding_poly¶
The
fd_bounding_poly
bounding polygon is tighter than theboundingPoly
, 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.
- landmarks¶
Detected face landmarks.
- Type
MutableSequence[google.cloud.vision_v1.types.FaceAnnotation.Landmark]
- roll_angle¶
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].
- Type
- pan_angle¶
Yaw angle, which indicates the leftward/rightward angle that the face is pointing relative to the vertical plane perpendicular to the image. Range [-180,180].
- Type
- tilt_angle¶
Pitch angle, which indicates the upwards/downwards angle that the face is pointing relative to the image’s horizontal plane. Range [-180,180].
- Type
- joy_likelihood¶
Joy likelihood.
- sorrow_likelihood¶
Sorrow likelihood.
- anger_likelihood¶
Anger likelihood.
- surprise_likelihood¶
Surprise likelihood.
- under_exposed_likelihood¶
Under-exposed likelihood.
- blurred_likelihood¶
Blurred likelihood.
- headwear_likelihood¶
Headwear likelihood.
- class Landmark(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A face-specific landmark (for example, a face feature).
- type_¶
Face landmark type.
- position¶
Face landmark position.
- class Type(value)[source]¶
Bases:
proto.enums.Enum
Face landmark (feature) type. Left and right are defined from the vantage of the viewer of the image without considering mirror projections typical of photos. So,
LEFT_EYE
, typically, is the person’s right eye.- Values:
- UNKNOWN_LANDMARK (0):
Unknown face landmark detected. Should not be filled.
- LEFT_EYE (1):
Left eye.
- RIGHT_EYE (2):
Right eye.
- LEFT_OF_LEFT_EYEBROW (3):
Left of left eyebrow.
- RIGHT_OF_LEFT_EYEBROW (4):
Right of left eyebrow.
- LEFT_OF_RIGHT_EYEBROW (5):
Left of right eyebrow.
- RIGHT_OF_RIGHT_EYEBROW (6):
Right of right eyebrow.
- MIDPOINT_BETWEEN_EYES (7):
Midpoint between eyes.
- NOSE_TIP (8):
Nose tip.
- UPPER_LIP (9):
Upper lip.
- LOWER_LIP (10):
Lower lip.
- MOUTH_LEFT (11):
Mouth left.
- MOUTH_RIGHT (12):
Mouth right.
- MOUTH_CENTER (13):
Mouth center.
- NOSE_BOTTOM_RIGHT (14):
Nose, bottom right.
- NOSE_BOTTOM_LEFT (15):
Nose, bottom left.
- NOSE_BOTTOM_CENTER (16):
Nose, bottom center.
- LEFT_EYE_TOP_BOUNDARY (17):
Left eye, top boundary.
- LEFT_EYE_RIGHT_CORNER (18):
Left eye, right corner.
- LEFT_EYE_BOTTOM_BOUNDARY (19):
Left eye, bottom boundary.
- LEFT_EYE_LEFT_CORNER (20):
Left eye, left corner.
- RIGHT_EYE_TOP_BOUNDARY (21):
Right eye, top boundary.
- RIGHT_EYE_RIGHT_CORNER (22):
Right eye, right corner.
- RIGHT_EYE_BOTTOM_BOUNDARY (23):
Right eye, bottom boundary.
- RIGHT_EYE_LEFT_CORNER (24):
Right eye, left corner.
- LEFT_EYEBROW_UPPER_MIDPOINT (25):
Left eyebrow, upper midpoint.
- RIGHT_EYEBROW_UPPER_MIDPOINT (26):
Right eyebrow, upper midpoint.
- LEFT_EAR_TRAGION (27):
Left ear tragion.
- RIGHT_EAR_TRAGION (28):
Right ear tragion.
- LEFT_EYE_PUPIL (29):
Left eye pupil.
- RIGHT_EYE_PUPIL (30):
Right eye pupil.
- FOREHEAD_GLABELLA (31):
Forehead glabella.
- CHIN_GNATHION (32):
Chin gnathion.
- CHIN_LEFT_GONION (33):
Chin left gonion.
- CHIN_RIGHT_GONION (34):
Chin right gonion.
- LEFT_CHEEK_CENTER (35):
Left cheek center.
- RIGHT_CHEEK_CENTER (36):
Right cheek center.
- class google.cloud.vision_v1.types.Feature(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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 thefeatures
list.- type_¶
The feature type.
- max_results¶
Maximum number of results of this type. Does not apply to
TEXT_DETECTION
,DOCUMENT_TEXT_DETECTION
, orCROP_HINTS
.- Type
- model¶
Model to use for the feature. Supported values: “builtin/stable” (the default if unset) and “builtin/latest”.
DOCUMENT_TEXT_DETECTION
andTEXT_DETECTION
also support “builtin/weekly” for the bleeding edge release updated weekly.- Type
- class Type(value)[source]¶
Bases:
proto.enums.Enum
Type of Google Cloud Vision API feature to be extracted.
- Values:
- TYPE_UNSPECIFIED (0):
Unspecified feature type.
- FACE_DETECTION (1):
Run face detection.
- LANDMARK_DETECTION (2):
Run landmark detection.
- LOGO_DETECTION (3):
Run logo detection.
- LABEL_DETECTION (4):
Run label detection.
- TEXT_DETECTION (5):
Run text detection / optical character recognition (OCR). Text detection is optimized for areas of text within a larger image; if the image is a document, use
DOCUMENT_TEXT_DETECTION
instead.- DOCUMENT_TEXT_DETECTION (11):
Run dense text document OCR. Takes precedence when both
DOCUMENT_TEXT_DETECTION
andTEXT_DETECTION
are present.- SAFE_SEARCH_DETECTION (6):
Run Safe Search to detect potentially unsafe or undesirable content.
- IMAGE_PROPERTIES (7):
Compute a set of image properties, such as the image’s dominant colors.
- CROP_HINTS (9):
Run crop hints.
- WEB_DETECTION (10):
Run web detection.
- PRODUCT_SEARCH (12):
Run Product Search.
- OBJECT_LOCALIZATION (19):
Run localizer for object detection.
- class google.cloud.vision_v1.types.GcsDestination(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The Google Cloud Storage location where the output will be written to.
- uri¶
Google Cloud Storage URI prefix where the results will be stored. Results will be in JSON format and preceded by its corresponding input URI prefix. This field can either represent a gcs file prefix or gcs directory. In either case, the uri should be unique because in order to get all of the output files, you will need to do a wildcard gcs search on the uri prefix you provide.
Examples:
File Prefix: gs://bucket-name/here/filenameprefix The output files will be created in gs://bucket-name/here/ and the names of the output files will begin with “filenameprefix”.
Directory Prefix: gs://bucket-name/some/location/ The output files will be created in gs://bucket-name/some/location/ and the names of the output files could be anything because there was no filename prefix specified.
If multiple outputs, each response is still AnnotateFileResponse, each of which contains some subset of the full list of AnnotateImageResponse. Multiple outputs can happen if, for example, the output JSON is too large and overflows into multiple sharded files.
- Type
- class google.cloud.vision_v1.types.GcsSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The Google Cloud Storage location where the input will be read from.
- class google.cloud.vision_v1.types.GetProductRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
GetProduct
method.
- class google.cloud.vision_v1.types.GetProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
GetProductSet
method.
- class google.cloud.vision_v1.types.GetReferenceImageRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
GetReferenceImage
method.
- class google.cloud.vision_v1.types.Image(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Client image to perform Google Cloud Vision API tasks over.
- content¶
Image 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 BatchAnnotateImages requests. It does not work for AsyncBatchAnnotateImages requests.
- Type
- source¶
Google Cloud Storage image location, or publicly-accessible image URL. If both
content
andsource
are provided for an image,content
takes precedence and is used to perform the image annotation request.
- class google.cloud.vision_v1.types.ImageAnnotationContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
If an image was produced from a file (e.g. a PDF), this message gives information about the source of that image.
- class google.cloud.vision_v1.types.ImageContext(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Image context and/or feature-specific parameters.
- lat_long_rect¶
Not used.
- language_hints¶
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.- Type
MutableSequence[str]
- crop_hints_params¶
Parameters for crop hints annotation request.
- product_search_params¶
Parameters for product search.
- web_detection_params¶
Parameters for web detection.
- text_detection_params¶
Parameters for text detection and document text detection.
- class google.cloud.vision_v1.types.ImageProperties(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Stores image properties, such as dominant colors.
- dominant_colors¶
If present, dominant colors completed successfully.
- class google.cloud.vision_v1.types.ImageSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
External image source (Google Cloud Storage or web URL image location).
- gcs_image_uri¶
Use ``image_uri`` instead.
The Google Cloud Storage URI of the form
gs://bucket_name/object_name
. Object versioning is not supported. See Google Cloud Storage Request URIs for more info.- Type
- image_uri¶
The URI of the source image. Can be either:
A Google Cloud Storage URI of the form
gs://bucket_name/object_name
. Object versioning is not supported. See Google Cloud Storage Request URIs for more info.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
andimage_uri
are specified,image_uri
takes precedence.- Type
- class google.cloud.vision_v1.types.ImportProductSetsGcsSource(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The Google Cloud Storage location for a csv file which preserves a list of ImportProductSetRequests in each line.
- csv_file_uri¶
The Google Cloud Storage URI of the input csv file.
The URI must start with
gs://
.The format of the input csv file should be one image per line. In each line, there are 8 columns.
image-uri
image-id
product-set-id
product-id
product-category
product-display-name
labels
bounding-poly
The
image-uri
,product-set-id
,product-id
, andproduct-category
columns are required. All other columns are optional.If the
ProductSet
orProduct
specified by theproduct-set-id
andproduct-id
values does not exist, then the system will create a newProductSet
orProduct
for the image. In this case, theproduct-display-name
column refers to [display_name][google.cloud.vision.v1.Product.display_name], theproduct-category
column refers to [product_category][google.cloud.vision.v1.Product.product_category], and thelabels
column refers to [product_labels][google.cloud.vision.v1.Product.product_labels].The
image-id
column is optional but must be unique if provided. If it is empty, the system will automatically assign a unique id to the image.The
product-display-name
column is optional. If it is empty, the system sets the [display_name][google.cloud.vision.v1.Product.display_name] field for the product to a space (” “). You can update thedisplay_name
later by using the API.If a
Product
with the specifiedproduct-id
already exists, then the system ignores theproduct-display-name
,product-category
, andlabels
columns.The
labels
column (optional) is a line containing a list of comma-separated key-value pairs, in the following format:"key_1=value_1,key_2=value_2,...,key_n=value_n"
The
bounding-poly
column (optional) identifies one region of interest from the image in the same manner asCreateReferenceImage
. If you do not specify thebounding-poly
column, then the system will try to detect regions of interest automatically.At most one
bounding-poly
column is allowed per line. If the image contains multiple regions of interest, add a line to the CSV file that includes the same product information, and thebounding-poly
values for each region of interest.The
bounding-poly
column must contain an even number of comma-separated numbers, in the format “p1_x,p1_y,p2_x,p2_y,…,pn_x,pn_y”. Use non-negative integers for absolute bounding polygons, and float values in [0, 1] for normalized bounding polygons.The system will resize the image if the image resolution is too large to process (larger than 20MP).
- Type
- class google.cloud.vision_v1.types.ImportProductSetsInputConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The input content for the
ImportProductSets
method.
- class google.cloud.vision_v1.types.ImportProductSetsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
ImportProductSets
method.- parent¶
Required. The project in which the ProductSets should be imported.
Format is
projects/PROJECT_ID/locations/LOC_ID
.- Type
- input_config¶
Required. The input content for the list of requests.
- class google.cloud.vision_v1.types.ImportProductSetsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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.
- reference_images¶
The list of reference_images that are imported successfully.
- Type
MutableSequence[google.cloud.vision_v1.types.ReferenceImage]
- statuses¶
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.
- Type
MutableSequence[google.rpc.status_pb2.Status]
- class google.cloud.vision_v1.types.InputConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The desired input location and metadata.
- gcs_source¶
The Google Cloud Storage location to read the input from.
- content¶
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.
- Type
- class google.cloud.vision_v1.types.LatLongRect(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Rectangle determined by min and max
LatLng
pairs.- min_lat_lng¶
Min lat/long pair.
- Type
google.type.latlng_pb2.LatLng
- max_lat_lng¶
Max lat/long pair.
- Type
google.type.latlng_pb2.LatLng
- class google.cloud.vision_v1.types.Likelihood(value)[source]¶
Bases:
proto.enums.Enum
A bucketized representation of likelihood, which is intended to give clients highly stable results across model upgrades.
- Values:
- UNKNOWN (0):
Unknown likelihood.
- VERY_UNLIKELY (1):
It is very unlikely.
- UNLIKELY (2):
It is unlikely.
- POSSIBLE (3):
It is possible.
- LIKELY (4):
It is likely.
- VERY_LIKELY (5):
It is very likely.
- class google.cloud.vision_v1.types.ListProductSetsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
ListProductSets
method.- parent¶
Required. The project from which ProductSets should be listed.
Format is
projects/PROJECT_ID/locations/LOC_ID
.- Type
- class google.cloud.vision_v1.types.ListProductSetsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response message for the
ListProductSets
method.- product_sets¶
List of ProductSets.
- Type
MutableSequence[google.cloud.vision_v1.types.ProductSet]
- class google.cloud.vision_v1.types.ListProductsInProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
ListProductsInProductSet
method.- name¶
Required. The ProductSet resource for which to retrieve Products.
Format is:
projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
- Type
- class google.cloud.vision_v1.types.ListProductsInProductSetResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response message for the
ListProductsInProductSet
method.- products¶
The list of Products.
- Type
MutableSequence[google.cloud.vision_v1.types.Product]
- class google.cloud.vision_v1.types.ListProductsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
ListProducts
method.- parent¶
Required. The project OR ProductSet from which Products should be listed.
Format:
projects/PROJECT_ID/locations/LOC_ID
- Type
- class google.cloud.vision_v1.types.ListProductsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response message for the
ListProducts
method.- products¶
List of products.
- Type
MutableSequence[google.cloud.vision_v1.types.Product]
- class google.cloud.vision_v1.types.ListReferenceImagesRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
ListReferenceImages
method.- parent¶
Required. Resource name of the product containing the reference images.
Format is
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
.- Type
- class google.cloud.vision_v1.types.ListReferenceImagesResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Response message for the
ListReferenceImages
method.- reference_images¶
The list of reference images.
- Type
MutableSequence[google.cloud.vision_v1.types.ReferenceImage]
- class google.cloud.vision_v1.types.LocalizedObjectAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Set of detected objects with bounding boxes.
- language_code¶
The BCP-47 language code, such as “en-US” or “sr-Latn”. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
- Type
- bounding_poly¶
Image region to which this object belongs. This must be populated.
- class google.cloud.vision_v1.types.LocationInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Detected entity location information.
- lat_lng¶
lat/long location coordinates.
- Type
google.type.latlng_pb2.LatLng
- class google.cloud.vision_v1.types.NormalizedVertex(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
- class google.cloud.vision_v1.types.OperationMetadata(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Contains metadata for the BatchAnnotateImages operation.
- state¶
Current state of the batch operation.
- create_time¶
The time when the batch request was received.
- update_time¶
The time when the operation result was last updated.
- class State(value)[source]¶
Bases:
proto.enums.Enum
Batch operation states.
- Values:
- STATE_UNSPECIFIED (0):
Invalid.
- CREATED (1):
Request is received.
- RUNNING (2):
Request is actively being processed.
- DONE (3):
The batch processing is done.
- CANCELLED (4):
The batch processing was cancelled.
- class google.cloud.vision_v1.types.OutputConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
The desired output location and metadata.
- gcs_destination¶
The Google Cloud Storage location to write the output(s) to.
- batch_size¶
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 prefixgcs_destination
.uri
.Currently, batch_size only applies to GcsDestination, with potential future support for other output configurations.
- Type
- class google.cloud.vision_v1.types.Page(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Detected page from OCR.
- property¶
Additional information detected on the page.
- width¶
Page width. For PDFs the unit is points. For images (including TIFFs) the unit is pixels.
- Type
- height¶
Page height. For PDFs the unit is points. For images (including TIFFs) the unit is pixels.
- Type
- blocks¶
List of blocks of text, images etc on this page.
- Type
MutableSequence[google.cloud.vision_v1.types.Block]
- class google.cloud.vision_v1.types.Paragraph(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Structural unit of text representing a number of words in certain order.
- property¶
Additional information detected for the paragraph.
- bounding_box¶
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).
- words¶
List of all words in this paragraph.
- Type
MutableSequence[google.cloud.vision_v1.types.Word]
- class google.cloud.vision_v1.types.Position(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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.
- class google.cloud.vision_v1.types.Product(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A Product contains ReferenceImages.
- name¶
The resource name of the product.
Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
.This field is ignored when creating a product.
- Type
- display_name¶
The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.
- Type
- description¶
User-provided metadata to be stored with this product. Must be at most 4096 characters long.
- Type
- product_category¶
Immutable. The category for the product identified by the reference image. This should be one of “homegoods-v2”, “apparel-v2”, “toys-v2”, “packagedgoods-v1” or “general-v1”. The legacy categories “homegoods”, “apparel”, and “toys” are still supported, but these should not be used for new products.
- Type
- product_labels¶
Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.
Note that integer values can be provided as strings, e.g. “1199”. Only strings with integer values can match a range-based restriction which is to be supported soon.
Multiple values can be assigned to the same key. One product may have up to 500 product_labels.
Notice that the total number of distinct product_labels over all products in one ProductSet cannot exceed 1M, otherwise the product search pipeline will refuse to work for that ProductSet.
- Type
MutableSequence[google.cloud.vision_v1.types.Product.KeyValue]
- class KeyValue(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A product label represented as a key-value pair.
- key¶
The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes.
- Type
- class google.cloud.vision_v1.types.ProductSearchParams(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Parameters for a product search request.
- bounding_poly¶
The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.
- product_set¶
The resource name of a [ProductSet][google.cloud.vision.v1.ProductSet] to be searched for similar images.
Format is:
projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
.- Type
- product_categories¶
The list of product categories to search in. Currently, we only consider the first category, and either “homegoods-v2”, “apparel-v2”, “toys-v2”, “packagedgoods-v1”, or “general-v1” should be specified. The legacy categories “homegoods”, “apparel”, and “toys” are still supported but will be deprecated. For new products, please use “homegoods-v2”, “apparel-v2”, or “toys-v2” for better product search accuracy. It is recommended to migrate existing products to these categories as well.
- Type
MutableSequence[str]
- filter¶
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 ‘=’.
- Type
- class google.cloud.vision_v1.types.ProductSearchResults(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Results for a product search request.
- index_time¶
Timestamp of the index which provided these results. Products added to the product set and products removed from the product set after this time are not reflected in the current results.
- results¶
List of results, one for each product match.
- Type
MutableSequence[google.cloud.vision_v1.types.ProductSearchResults.Result]
- product_grouped_results¶
List of results grouped by products detected in the query image. Each entry corresponds to one bounding polygon in the query image, and contains the matching products specific to that region. There may be duplicate product matches in the union of all the per-product results.
- Type
MutableSequence[google.cloud.vision_v1.types.ProductSearchResults.GroupedResult]
- class GroupedResult(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about the products similar to a single product in a query image.
- bounding_poly¶
The bounding polygon around the product detected in the query image.
- results¶
List of results, one for each product match.
- Type
MutableSequence[google.cloud.vision_v1.types.ProductSearchResults.Result]
- object_annotations¶
List of generic predictions for the object in the bounding box.
- Type
MutableSequence[google.cloud.vision_v1.types.ProductSearchResults.ObjectAnnotation]
- class ObjectAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Prediction for what the object in the bounding box is.
- language_code¶
The BCP-47 language code, such as “en-US” or “sr-Latn”. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
- Type
- class Result(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Information about a product.
- product¶
The Product.
- score¶
A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence).
- Type
- class google.cloud.vision_v1.types.ProductSet(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A ProductSet contains Products. A ProductSet can contain a maximum of 1 million reference images. If the limit is exceeded, periodic indexing will fail.
- name¶
The resource name of the ProductSet.
Format is:
projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
.This field is ignored when creating a ProductSet.
- Type
- display_name¶
The user-provided name for this ProductSet. Must not be empty. Must be at most 4096 characters long.
- Type
- index_time¶
Output only. The time at which this ProductSet was last indexed. Query results will reflect all updates before this time. If this ProductSet has never been indexed, this timestamp is the default value “1970-01-01T00:00:00Z”.
This field is ignored when creating a ProductSet.
- index_error¶
Output only. If there was an error with indexing the product set, the field is populated.
This field is ignored when creating a ProductSet.
- Type
google.rpc.status_pb2.Status
- class google.cloud.vision_v1.types.ProductSetPurgeConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Config to control which ProductSet contains the Products to be deleted.
- class google.cloud.vision_v1.types.Property(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A
Property
consists of a user-supplied name/value pair.
- class google.cloud.vision_v1.types.PurgeProductsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
PurgeProducts
method.This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.
- product_set_purge_config¶
Specify which ProductSet contains the Products to be deleted.
This field is a member of oneof
target
.
- delete_orphan_products¶
If delete_orphan_products is true, all Products that are not in any ProductSet will be deleted.
This field is a member of oneof
target
.- Type
- parent¶
Required. The project and location in which the Products should be deleted.
Format is
projects/PROJECT_ID/locations/LOC_ID
.- Type
- class google.cloud.vision_v1.types.ReferenceImage(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A
ReferenceImage
represents a product image and its associated metadata, such as bounding boxes.- name¶
The resource name of the reference image.
Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
.This field is ignored when creating a reference image.
- Type
- uri¶
Required. The Google Cloud Storage URI of the reference image.
The URI must start with
gs://
.- Type
- bounding_polys¶
Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used.
The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not).
- Type
MutableSequence[google.cloud.vision_v1.types.BoundingPoly]
- class google.cloud.vision_v1.types.RemoveProductFromProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
RemoveProductFromProductSet
method.- name¶
Required. The resource name for the ProductSet to modify.
Format is:
projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
- Type
- class google.cloud.vision_v1.types.SafeSearchAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Set of features pertaining to the image, computed by computer vision methods over safe-search verticals (for example, adult, spoof, medical, violence).
- adult¶
Represents the adult content likelihood for the image. Adult content may contain elements such as nudity, pornographic images or cartoons, or sexual activities.
- spoof¶
Spoof likelihood. The likelihood that an modification was made to the image’s canonical version to make it appear funny or offensive.
- medical¶
Likelihood that this is a medical image.
- violence¶
Likelihood that this image contains violent content.
- racy¶
Likelihood that the request image contains racy content. Racy content may include (but is not limited to) skimpy or sheer clothing, strategically covered nudity, lewd or provocative poses, or close-ups of sensitive body areas.
- class google.cloud.vision_v1.types.Symbol(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A single symbol representation.
- property¶
Additional information detected for the symbol.
- bounding_box¶
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).
- class google.cloud.vision_v1.types.TextAnnotation(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
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][google.cloud.vision.v1.TextAnnotation.TextProperty] message definition below for more detail.
- pages¶
List of pages detected by OCR.
- Type
MutableSequence[google.cloud.vision_v1.types.Page]
- class DetectedBreak(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Detected start or end of a structural component.
- type_¶
Detected break type.
- class BreakType(value)[source]¶
Bases:
proto.enums.Enum
Enum to denote the type of break found. New line, space etc.
- Values:
- UNKNOWN (0):
Unknown break label type.
- SPACE (1):
Regular space.
- SURE_SPACE (2):
Sure space (very wide).
- EOL_SURE_SPACE (3):
Line-wrapping break.
- HYPHEN (4):
End-line hyphen that is not present in text; does not co-occur with
SPACE
,LEADER_SPACE
, orLINE_BREAK
.- LINE_BREAK (5):
Line break that ends a paragraph.
- class DetectedLanguage(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Detected language for a structural component.
- language_code¶
The BCP-47 language code, such as “en-US” or “sr-Latn”. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
- Type
- class TextProperty(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Additional information detected on the structural component.
- detected_languages¶
A list of detected languages together with confidence.
- Type
MutableSequence[google.cloud.vision_v1.types.TextAnnotation.DetectedLanguage]
- detected_break¶
Detected start or end of a text segment.
- class google.cloud.vision_v1.types.TextDetectionParams(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Parameters for text detections. This is used to control TEXT_DETECTION and DOCUMENT_TEXT_DETECTION features.
- enable_text_detection_confidence_score¶
By default, Cloud Vision API only includes confidence score for DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence score for TEXT_DETECTION as well.
- Type
- class google.cloud.vision_v1.types.UpdateProductRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
UpdateProduct
method.- product¶
Required. The Product resource which replaces the one on the server. product.name is immutable.
- update_mask¶
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
, anddescription
.
- class google.cloud.vision_v1.types.UpdateProductSetRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Request message for the
UpdateProductSet
method.- product_set¶
Required. The ProductSet resource which replaces the one on the server.
- update_mask¶
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
.
- class google.cloud.vision_v1.types.Vertex(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
- class google.cloud.vision_v1.types.WebDetection(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Relevant information for the image from the Internet.
- web_entities¶
Deduced entities from similar images on the Internet.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebEntity]
- full_matching_images¶
Fully matching images from the Internet. Can include resized copies of the query image.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebImage]
- partial_matching_images¶
Partial matching images from the Internet. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebImage]
- pages_with_matching_images¶
Web pages containing the matching images from the Internet.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebPage]
- visually_similar_images¶
The visually similar image results.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebImage]
- best_guess_labels¶
The service’s best guess as to the topic of the request image. Inferred from similar images on the open web.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebLabel]
- class WebEntity(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Entity deduced from similar images on the Internet.
- score¶
Overall relevancy score for the entity. Not normalized and not comparable across different image queries.
- Type
- class WebImage(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata for online images.
- class WebLabel(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Label to provide extra metadata for the web detection.
- language_code¶
The BCP-47 language code for
label
, such as “en-US” or “sr-Latn”. For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.- Type
- class WebPage(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Metadata for web pages.
- full_matching_images¶
Fully matching images on the page. Can include resized copies of the query image.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebImage]
- partial_matching_images¶
Partial matching images on the page. Those images are similar enough to share some key-point features. For example an original image will likely have partial matching for its crops.
- Type
MutableSequence[google.cloud.vision_v1.types.WebDetection.WebImage]
- class google.cloud.vision_v1.types.WebDetectionParams(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
Parameters for web detection request.
- class google.cloud.vision_v1.types.Word(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]¶
Bases:
proto.message.Message
A word representation.
- property¶
Additional information detected for the word.
- bounding_box¶
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).
- symbols¶
List of symbols in the word. The order of the symbols follows the natural reading order.
- Type
MutableSequence[google.cloud.vision_v1.types.Symbol]