From c11035189c3f63d147d59e6511add16a0d79b59f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot <44816363+yoshi-automation@users.noreply.github.com> Date: Mon, 6 May 2019 16:20:14 -0700 Subject: [PATCH] Add batch annotation for images and files, reorder methods (via synth). (#7845) --- .../google/cloud/vision_v1/__init__.py | 12 +- .../vision_v1/gapic/image_annotator_client.py | 167 +++- .../gapic/image_annotator_client_config.py | 10 + .../vision_v1/gapic/product_search_client.py | 790 +++++++++--------- .../gapic/product_search_client_config.py | 36 +- .../image_annotator_grpc_transport.py | 41 + .../product_search_grpc_transport.py | 234 +++--- .../cloud/vision_v1/proto/geometry.proto | 2 +- .../vision_v1/proto/image_annotator.proto | 173 +++- .../vision_v1/proto/image_annotator_pb2.py | 590 +++++++++++-- .../proto/image_annotator_pb2_grpc.py | 48 ++ .../vision_v1/proto/product_search.proto | 13 +- .../vision_v1/proto/product_search_pb2.py | 13 +- .../proto/product_search_service.proto | 21 +- .../proto/product_search_service_pb2.py | 5 +- .../proto/product_search_service_pb2_grpc.py | 16 - .../vision_v1/proto/text_annotation.proto | 2 +- .../cloud/vision_v1/proto/web_detection.proto | 24 +- .../vision_v1/proto/web_detection_pb2.py | 162 ++-- packages/google-cloud-vision/synth.metadata | 6 +- .../v1/test_image_annotator_client_v1.py | 97 +++ .../gapic/v1/test_product_search_client_v1.py | 434 +++++----- 22 files changed, 1894 insertions(+), 1002 deletions(-) diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py index 2db8ad45fa07..07f399730bb9 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/__init__.py @@ -25,15 +25,15 @@ from google.cloud.vision_v1.gapic import product_search_client -class ProductSearchClient(product_search_client.ProductSearchClient): - __doc__ = product_search_client.ProductSearchClient.__doc__ - enums = enums - - @add_single_feature_methods class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient): __doc__ = iac.ImageAnnotatorClient.__doc__ enums = enums -__all__ = ("enums", "types", "ProductSearchClient", "ImageAnnotatorClient") +class ProductSearchClient(product_search_client.ProductSearchClient): + __doc__ = product_search_client.ProductSearchClient.__doc__ + enums = enums + + +__all__ = ("enums", "types", "ImageAnnotatorClient", "ProductSearchClient") diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client.py index afcbb4fb6d37..f86f8eea26cc 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client.py @@ -32,11 +32,7 @@ from google.cloud.vision_v1.gapic.transports import image_annotator_grpc_transport from google.cloud.vision_v1.proto import image_annotator_pb2 from google.cloud.vision_v1.proto import image_annotator_pb2_grpc -from google.cloud.vision_v1.proto import product_search_service_pb2 -from google.cloud.vision_v1.proto import product_search_service_pb2_grpc from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version @@ -234,6 +230,169 @@ def batch_annotate_images( request, retry=retry, timeout=timeout, metadata=metadata ) + def batch_annotate_files( + self, + requests, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + 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. + + Example: + >>> from google.cloud import vision_v1 + >>> + >>> client = vision_v1.ImageAnnotatorClient() + >>> + >>> # TODO: Initialize `requests`: + >>> requests = [] + >>> + >>> response = client.batch_annotate_files(requests) + + Args: + requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateFileRequest]]): The list of file annotation requests. Right now we support only one + AnnotateFileRequest in BatchAnnotateFilesRequest. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.AnnotateFileRequest` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.vision_v1.types.BatchAnnotateFilesResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "batch_annotate_files" not in self._inner_api_calls: + self._inner_api_calls[ + "batch_annotate_files" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.batch_annotate_files, + default_retry=self._method_configs["BatchAnnotateFiles"].retry, + default_timeout=self._method_configs["BatchAnnotateFiles"].timeout, + client_info=self._client_info, + ) + + request = image_annotator_pb2.BatchAnnotateFilesRequest(requests=requests) + return self._inner_api_calls["batch_annotate_files"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def async_batch_annotate_images( + self, + requests, + output_config, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Run asynchronous image detection and annotation for a list of images. + + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). + + This service will write image annotation outputs to json files in + customer GCS bucket, each json file containing + BatchAnnotateImagesResponse proto. + + Example: + >>> from google.cloud import vision_v1 + >>> + >>> client = vision_v1.ImageAnnotatorClient() + >>> + >>> # TODO: Initialize `requests`: + >>> requests = [] + >>> + >>> # TODO: Initialize `output_config`: + >>> output_config = {} + >>> + >>> response = client.async_batch_annotate_images(requests, output_config) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateImageRequest]]): Individual image annotation requests for this batch. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.AnnotateImageRequest` + output_config (Union[dict, ~google.cloud.vision_v1.types.OutputConfig]): Required. The desired output location and metadata (e.g. format). + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.OutputConfig` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.vision_v1.types._OperationFuture` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "async_batch_annotate_images" not in self._inner_api_calls: + self._inner_api_calls[ + "async_batch_annotate_images" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.async_batch_annotate_images, + default_retry=self._method_configs["AsyncBatchAnnotateImages"].retry, + default_timeout=self._method_configs[ + "AsyncBatchAnnotateImages" + ].timeout, + client_info=self._client_info, + ) + + request = image_annotator_pb2.AsyncBatchAnnotateImagesRequest( + requests=requests, output_config=output_config + ) + operation = self._inner_api_calls["async_batch_annotate_images"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + return google.api_core.operation.from_gapic( + operation, + self.transport._operations_client, + image_annotator_pb2.AsyncBatchAnnotateImagesResponse, + metadata_type=image_annotator_pb2.OperationMetadata, + ) + def async_batch_annotate_files( self, requests, diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py index dc43ed99fcd6..f533bb7187f6 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py @@ -22,6 +22,16 @@ "retry_codes_name": "idempotent", "retry_params_name": "default", }, + "BatchAnnotateFiles": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "AsyncBatchAnnotateImages": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, "AsyncBatchAnnotateFiles": { "timeout_millis": 60000, "retry_codes_name": "idempotent", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client.py index 7c6cef259e0c..9d84091c84cd 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client.py @@ -34,6 +34,8 @@ from google.cloud.vision_v1.gapic import enums from google.cloud.vision_v1.gapic import product_search_client_config from google.cloud.vision_v1.gapic.transports import product_search_grpc_transport +from google.cloud.vision_v1.proto import image_annotator_pb2 +from google.cloud.vision_v1.proto import image_annotator_pb2_grpc from google.cloud.vision_v1.proto import product_search_service_pb2 from google.cloud.vision_v1.proto import product_search_service_pb2_grpc from google.longrunning import operations_pb2 @@ -227,25 +229,22 @@ def __init__( self._inner_api_calls = {} # Service calls - def create_product( + def create_product_set( self, parent, - product, - product_id=None, + product_set, + product_set_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates and returns a new product resource. + Creates and returns a new ProductSet resource. Possible errors: - - Returns INVALID\_ARGUMENT if display\_name is missing or longer than - 4096 characters. - - Returns INVALID\_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID\_ARGUMENT if product\_category is missing or invalid. + - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer + than 4096 characters. Example: >>> from google.cloud import vision_v1 @@ -254,20 +253,20 @@ def create_product( >>> >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> - >>> # TODO: Initialize `product`: - >>> product = {} + >>> # TODO: Initialize `product_set`: + >>> product_set = {} >>> - >>> response = client.create_product(parent, product) + >>> response = client.create_product_set(parent, product_set) Args: - parent (str): The project in which the Product should be created. + parent (str): The project in which the ProductSet should be created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product (Union[dict, ~google.cloud.vision_v1.types.Product]): The product to create. + product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): The ProductSet to create. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.Product` - product_id (str): A user-supplied resource id for this Product. If set, the server will + message :class:`~google.cloud.vision_v1.types.ProductSet` + product_set_id (str): A user-supplied resource id for this ProductSet. 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 ``/``. @@ -281,7 +280,7 @@ def create_product( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. + A :class:`~google.cloud.vision_v1.types.ProductSet` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -291,18 +290,18 @@ def create_product( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_product" not in self._inner_api_calls: + if "create_product_set" not in self._inner_api_calls: self._inner_api_calls[ - "create_product" + "create_product_set" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product, - default_retry=self._method_configs["CreateProduct"].retry, - default_timeout=self._method_configs["CreateProduct"].timeout, + self.transport.create_product_set, + default_retry=self._method_configs["CreateProductSet"].retry, + default_timeout=self._method_configs["CreateProductSet"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id + request = product_search_service_pb2.CreateProductSetRequest( + parent=parent, product_set=product_set, product_set_id=product_set_id ) if metadata is None: metadata = [] @@ -317,11 +316,11 @@ def create_product( ) metadata.append(routing_metadata) - return self._inner_api_calls["create_product"]( + return self._inner_api_calls["create_product_set"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def list_products( + def list_product_sets( self, parent, page_size=None, @@ -330,11 +329,11 @@ def list_products( metadata=None, ): """ - Lists products in an unspecified order. + Lists ProductSets in an unspecified order. Possible errors: - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less + - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less than 1. Example: @@ -345,7 +344,7 @@ def list_products( >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> >>> # Iterate over all results - >>> for element in client.list_products(parent): + >>> for element in client.list_product_sets(parent): ... # process element ... pass >>> @@ -353,15 +352,15 @@ def list_products( >>> # Alternatively: >>> >>> # Iterate over results one page at a time - >>> for page in client.list_products(parent).pages: + >>> for page in client.list_product_sets(parent).pages: ... for element in page: ... # process element ... pass Args: - parent (str): The project OR ProductSet from which Products should be listed. + parent (str): The project from which ProductSets should be listed. - Format: ``projects/PROJECT_ID/locations/LOC_ID`` + Format is ``projects/PROJECT_ID/locations/LOC_ID``. page_size (int): The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page @@ -378,7 +377,7 @@ def list_products( Returns: A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.vision_v1.types.Product` instances. + is an iterable of :class:`~google.cloud.vision_v1.types.ProductSet` instances. This object can also be configured to iterate over the pages of the response through the `options` parameter. @@ -390,17 +389,17 @@ def list_products( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_products" not in self._inner_api_calls: + if "list_product_sets" not in self._inner_api_calls: self._inner_api_calls[ - "list_products" + "list_product_sets" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products, - default_retry=self._method_configs["ListProducts"].retry, - default_timeout=self._method_configs["ListProducts"].timeout, + self.transport.list_product_sets, + default_retry=self._method_configs["ListProductSets"].retry, + default_timeout=self._method_configs["ListProductSets"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.ListProductsRequest( + request = product_search_service_pb2.ListProductSetsRequest( parent=parent, page_size=page_size ) if metadata is None: @@ -419,19 +418,19 @@ def list_products( iterator = google.api_core.page_iterator.GRPCIterator( client=None, method=functools.partial( - self._inner_api_calls["list_products"], + self._inner_api_calls["list_product_sets"], retry=retry, timeout=timeout, metadata=metadata, ), request=request, - items_field="products", + items_field="product_sets", request_token_field="page_token", response_token_field="next_page_token", ) return iterator - def get_product( + def get_product_set( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -439,25 +438,26 @@ def get_product( metadata=None, ): """ - Gets information associated with a Product. + Gets information associated with a ProductSet. Possible errors: - - Returns NOT\_FOUND if the Product does not exist. + - Returns NOT\_FOUND if the ProductSet does not exist. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') + >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') >>> - >>> response = client.get_product(name) + >>> response = client.get_product_set(name) Args: - name (str): Resource name of the Product to get. + name (str): Resource name of the ProductSet to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: + ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -468,7 +468,7 @@ def get_product( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. + A :class:`~google.cloud.vision_v1.types.ProductSet` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -478,17 +478,17 @@ def get_product( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_product" not in self._inner_api_calls: + if "get_product_set" not in self._inner_api_calls: self._inner_api_calls[ - "get_product" + "get_product_set" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product, - default_retry=self._method_configs["GetProduct"].retry, - default_timeout=self._method_configs["GetProduct"].timeout, + self.transport.get_product_set, + default_retry=self._method_configs["GetProductSet"].retry, + default_timeout=self._method_configs["GetProductSet"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.GetProductRequest(name=name) + request = product_search_service_pb2.GetProductSetRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) @@ -502,54 +502,46 @@ def get_product( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_product"]( + return self._inner_api_calls["get_product_set"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def update_product( + def update_product_set( self, - product, + product_set, update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. - - If labels are updated, the change will not be reflected in queries until - the next index time. + Makes changes to a ProductSet resource. Only display\_name can be + updated currently. Possible errors: - - Returns NOT\_FOUND if the Product does not exist. + - Returns NOT\_FOUND if the ProductSet does not exist. - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask - but is missing from the request or longer than 4096 characters. - - Returns INVALID\_ARGUMENT if description is present in update\_mask - but is longer than 4096 characters. - - Returns INVALID\_ARGUMENT if product\_category is present in - update\_mask. + but missing from the request or longer than 4096 characters. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> # TODO: Initialize `product`: - >>> product = {} + >>> # TODO: Initialize `product_set`: + >>> product_set = {} >>> - >>> response = client.update_product(product) + >>> response = client.update_product_set(product_set) Args: - product (Union[dict, ~google.cloud.vision_v1.types.Product]): The Product resource which replaces the one on the server. - product.name is immutable. + product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): The ProductSet resource which replaces the one on the server. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.Product` + message :class:`~google.cloud.vision_v1.types.ProductSet` update_mask (Union[dict, ~google.cloud.vision_v1.types.FieldMask]): The ``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``. + isn't specified, all mutable fields are to be updated. Valid mask path + is ``display_name``. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.vision_v1.types.FieldMask` @@ -563,7 +555,7 @@ def update_product( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. + A :class:`~google.cloud.vision_v1.types.ProductSet` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -573,24 +565,24 @@ def update_product( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "update_product" not in self._inner_api_calls: + if "update_product_set" not in self._inner_api_calls: self._inner_api_calls[ - "update_product" + "update_product_set" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product, - default_retry=self._method_configs["UpdateProduct"].retry, - default_timeout=self._method_configs["UpdateProduct"].timeout, + self.transport.update_product_set, + default_retry=self._method_configs["UpdateProductSet"].retry, + default_timeout=self._method_configs["UpdateProductSet"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask + request = product_search_service_pb2.UpdateProductSetRequest( + product_set=product_set, update_mask=update_mask ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("product.name", product.name)] + routing_header = [("product_set.name", product_set.name)] except AttributeError: pass else: @@ -599,11 +591,11 @@ def update_product( ) metadata.append(routing_metadata) - return self._inner_api_calls["update_product"]( + return self._inner_api_calls["update_product_set"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def delete_product( + def delete_product_set( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -611,29 +603,25 @@ def delete_product( metadata=None, ): """ - Permanently deletes a product and its reference images. - - Metadata of the product and all its images will be deleted right away, - but search queries against ProductSets containing the product may still - work until all related caches are refreshed. - - Possible errors: + Permanently deletes a ProductSet. Products and ReferenceImages in the + ProductSet are not deleted. - - Returns NOT\_FOUND if the product does not exist. + The actual image files are not deleted from Google Cloud Storage. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') + >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') >>> - >>> client.delete_product(name) + >>> client.delete_product_set(name) Args: - name (str): Resource name of product to delete. + name (str): Resource name of the ProductSet to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` + Format is: + ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -651,17 +639,17 @@ def delete_product( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "delete_product" not in self._inner_api_calls: + if "delete_product_set" not in self._inner_api_calls: self._inner_api_calls[ - "delete_product" + "delete_product_set" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product, - default_retry=self._method_configs["DeleteProduct"].retry, - default_timeout=self._method_configs["DeleteProduct"].timeout, + self.transport.delete_product_set, + default_retry=self._method_configs["DeleteProductSet"].retry, + default_timeout=self._method_configs["DeleteProductSet"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.DeleteProductRequest(name=name) + request = product_search_service_pb2.DeleteProductSetRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) @@ -675,57 +663,54 @@ def delete_product( ) metadata.append(routing_metadata) - self._inner_api_calls["delete_product"]( + self._inner_api_calls["delete_product_set"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def list_reference_images( + def create_product( self, parent, - page_size=None, + product, + product_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Lists reference images. + Creates and returns a new product resource. Possible errors: - - Returns NOT\_FOUND if the parent product does not exist. - - Returns INVALID\_ARGUMENT if the page\_size is greater than 100, or - less than 1. + - Returns INVALID\_ARGUMENT if display\_name is missing or longer than + 4096 characters. + - Returns INVALID\_ARGUMENT if description is longer than 4096 + characters. + - Returns INVALID\_ARGUMENT if product\_category is missing or invalid. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_reference_images(parent): - ... # process element - ... pass - >>> + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> - >>> # Alternatively: + >>> # TODO: Initialize `product`: + >>> product = {} >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_reference_images(parent).pages: - ... for element in page: - ... # process element - ... pass + >>> response = client.create_product(parent, product) Args: - parent (str): Resource name of the product containing the reference images. + parent (str): The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. + Format is ``projects/PROJECT_ID/locations/LOC_ID``. + product (Union[dict, ~google.cloud.vision_v1.types.Product]): The product to create. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.Product` + product_id (str): A user-supplied resource id for this Product. 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 ``/``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -736,10 +721,7 @@ def list_reference_images( that is provided to the method. Returns: - A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.vision_v1.types.ReferenceImage` instances. - This object can also be configured to iterate over the pages - of the response through the `options` parameter. + A :class:`~google.cloud.vision_v1.types.Product` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -749,18 +731,18 @@ def list_reference_images( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_reference_images" not in self._inner_api_calls: + if "create_product" not in self._inner_api_calls: self._inner_api_calls[ - "list_reference_images" + "create_product" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_reference_images, - default_retry=self._method_configs["ListReferenceImages"].retry, - default_timeout=self._method_configs["ListReferenceImages"].timeout, + self.transport.create_product, + default_retry=self._method_configs["CreateProduct"].retry, + default_timeout=self._method_configs["CreateProduct"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent, page_size=page_size + request = product_search_service_pb2.CreateProductRequest( + parent=parent, product=product, product_id=product_id ) if metadata is None: metadata = [] @@ -775,50 +757,56 @@ def list_reference_images( ) metadata.append(routing_metadata) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_reference_images"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="reference_images", - request_token_field="page_token", - response_token_field="next_page_token", + return self._inner_api_calls["create_product"]( + request, retry=retry, timeout=timeout, metadata=metadata ) - return iterator - def get_reference_image( + def list_products( self, - name, + parent, + page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Gets information associated with a ReferenceImage. + Lists products in an unspecified order. Possible errors: - - Returns NOT\_FOUND if the specified image does not exist. + - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less + than 1. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') >>> - >>> response = client.get_reference_image(name) + >>> # Iterate over all results + >>> for element in client.list_products(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_products(parent).pages: + ... for element in page: + ... # process element + ... pass Args: - name (str): The resource name of the ReferenceImage to get. - - Format is: + parent (str): The project OR ProductSet from which Products should be listed. - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. + Format: ``projects/PROJECT_ID/locations/LOC_ID`` + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -829,7 +817,10 @@ def get_reference_image( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.vision_v1.types.Product` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -839,22 +830,24 @@ def get_reference_image( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_reference_image" not in self._inner_api_calls: + if "list_products" not in self._inner_api_calls: self._inner_api_calls[ - "get_reference_image" + "list_products" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_reference_image, - default_retry=self._method_configs["GetReferenceImage"].retry, - default_timeout=self._method_configs["GetReferenceImage"].timeout, + self.transport.list_products, + default_retry=self._method_configs["ListProducts"].retry, + default_timeout=self._method_configs["ListProducts"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.GetReferenceImageRequest(name=name) + request = product_search_service_pb2.ListProductsRequest( + parent=parent, page_size=page_size + ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("name", name)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -863,11 +856,22 @@ def get_reference_image( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_products"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="products", + request_token_field="page_token", + response_token_field="next_page_token", ) + return iterator - def delete_reference_image( + def get_product( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -875,33 +879,25 @@ def delete_reference_image( metadata=None, ): """ - Permanently deletes a reference image. - - The image metadata will be deleted right away, but search queries - against ProductSets containing the image may still work until all - related caches are refreshed. - - The actual image files are not deleted from Google Cloud Storage. + Gets information associated with a Product. Possible errors: - - Returns NOT\_FOUND if the reference image does not exist. + - Returns NOT\_FOUND if the Product does not exist. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') + >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') >>> - >>> client.delete_reference_image(name) + >>> response = client.get_product(name) Args: - name (str): The resource name of the reference image to delete. - - Format is: + name (str): Resource name of the Product to get. - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -911,6 +907,9 @@ def delete_reference_image( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. + Returns: + A :class:`~google.cloud.vision_v1.types.Product` instance. + Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -919,17 +918,17 @@ def delete_reference_image( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "delete_reference_image" not in self._inner_api_calls: + if "get_product" not in self._inner_api_calls: self._inner_api_calls[ - "delete_reference_image" + "get_product" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_reference_image, - default_retry=self._method_configs["DeleteReferenceImage"].retry, - default_timeout=self._method_configs["DeleteReferenceImage"].timeout, + self.transport.get_product, + default_retry=self._method_configs["GetProduct"].retry, + default_timeout=self._method_configs["GetProduct"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.DeleteReferenceImageRequest(name=name) + request = product_search_service_pb2.GetProductRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) @@ -943,67 +942,57 @@ def delete_reference_image( ) metadata.append(routing_metadata) - self._inner_api_calls["delete_reference_image"]( + return self._inner_api_calls["get_product"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def create_reference_image( + def update_product( self, - parent, - reference_image, - reference_image_id=None, + product, + update_mask=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates and returns a new ReferenceImage resource. - - The ``bounding_poly`` field is optional. If ``bounding_poly`` is not - specified, the system will try to detect regions of interest in the - image that are compatible with the product\_category on the parent - product. If it is specified, detection is ALWAYS skipped. The system - converts polygons into non-rotated rectangles. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. - Note that the pipeline will resize the image if the image resolution is - too large to process (above 50MP). + If labels are updated, the change will not be reflected in queries until + the next index time. Possible errors: - - Returns INVALID\_ARGUMENT if the image\_uri is missing or longer than - 4096 characters. - - Returns INVALID\_ARGUMENT if the product does not exist. - - Returns INVALID\_ARGUMENT if bounding\_poly is not provided, and - nothing compatible with the parent product's product\_category is - detected. - - Returns INVALID\_ARGUMENT if bounding\_poly contains more than 10 - polygons. + - Returns NOT\_FOUND if the Product does not exist. + - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask + but is missing from the request or longer than 4096 characters. + - Returns INVALID\_ARGUMENT if description is present in update\_mask + but is longer than 4096 characters. + - Returns INVALID\_ARGUMENT if product\_category is present in + update\_mask. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # TODO: Initialize `reference_image`: - >>> reference_image = {} + >>> # TODO: Initialize `product`: + >>> product = {} >>> - >>> response = client.create_reference_image(parent, reference_image) + >>> response = client.update_product(product) Args: - parent (str): Resource name of the product in which to create the reference image. + product (Union[dict, ~google.cloud.vision_v1.types.Product]): The Product resource which replaces the one on the server. + product.name is immutable. - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image (Union[dict, ~google.cloud.vision_v1.types.ReferenceImage]): The reference image to create. - If an image ID is specified, it is ignored. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.Product` + update_mask (Union[dict, ~google.cloud.vision_v1.types.FieldMask]): The ``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``. If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ReferenceImage` - reference_image_id (str): 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 ``/``. + message :class:`~google.cloud.vision_v1.types.FieldMask` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1014,7 +1003,7 @@ def create_reference_image( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. + A :class:`~google.cloud.vision_v1.types.Product` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1024,26 +1013,24 @@ def create_reference_image( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_reference_image" not in self._inner_api_calls: + if "update_product" not in self._inner_api_calls: self._inner_api_calls[ - "create_reference_image" + "update_product" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_reference_image, - default_retry=self._method_configs["CreateReferenceImage"].retry, - default_timeout=self._method_configs["CreateReferenceImage"].timeout, + self.transport.update_product, + default_retry=self._method_configs["UpdateProduct"].retry, + default_timeout=self._method_configs["UpdateProduct"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, + request = product_search_service_pb2.UpdateProductRequest( + product=product, update_mask=update_mask ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("product.name", product.name)] except AttributeError: pass else: @@ -1052,51 +1039,37 @@ def create_reference_image( ) metadata.append(routing_metadata) - return self._inner_api_calls["create_reference_image"]( + return self._inner_api_calls["update_product"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def create_product_set( + def delete_product( self, - parent, - product_set, - product_set_id=None, + name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates and returns a new ProductSet resource. - - Possible errors: + Permanently deletes a product and its reference images. - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. + Metadata of the product and all its images will be deleted right away, but + search queries against ProductSets containing the product may still work + until all related caches are refreshed. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} + >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') >>> - >>> response = client.create_product_set(parent, product_set) + >>> client.delete_product(name) Args: - parent (str): The project in which the ProductSet should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): The ProductSet to create. + name (str): Resource name of product to delete. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ProductSet` - product_set_id (str): A user-supplied resource id for this ProductSet. 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 ``/``. + Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1106,9 +1079,6 @@ def create_product_set( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. - Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. - Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -1117,24 +1087,22 @@ def create_product_set( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_product_set" not in self._inner_api_calls: + if "delete_product" not in self._inner_api_calls: self._inner_api_calls[ - "create_product_set" + "delete_product" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product_set, - default_retry=self._method_configs["CreateProductSet"].retry, - default_timeout=self._method_configs["CreateProductSet"].timeout, + self.transport.delete_product, + default_retry=self._method_configs["DeleteProduct"].retry, + default_timeout=self._method_configs["DeleteProduct"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) + request = product_search_service_pb2.DeleteProductRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("name", name)] except AttributeError: pass else: @@ -1143,56 +1111,67 @@ def create_product_set( ) metadata.append(routing_metadata) - return self._inner_api_calls["create_product_set"]( + self._inner_api_calls["delete_product"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def list_product_sets( + def create_reference_image( self, parent, - page_size=None, + reference_image, + reference_image_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Lists ProductSets in an unspecified order. + Creates and returns a new ReferenceImage resource. + + The ``bounding_poly`` field is optional. If ``bounding_poly`` is not + specified, the system will try to detect regions of interest in the + image that are compatible with the product\_category on the parent + product. If it is specified, detection is ALWAYS skipped. The system + converts polygons into non-rotated rectangles. + + Note that the pipeline will resize the image if the image resolution is + too large to process (above 50MP). Possible errors: - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. + - Returns INVALID\_ARGUMENT if the image\_uri is missing or longer than + 4096 characters. + - Returns INVALID\_ARGUMENT if the product does not exist. + - Returns INVALID\_ARGUMENT if bounding\_poly is not provided, and + nothing compatible with the parent product's product\_category is + detected. + - Returns INVALID\_ARGUMENT if bounding\_poly contains more than 10 + polygons. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_product_sets(parent): - ... # process element - ... pass - >>> + >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') >>> - >>> # Alternatively: + >>> # TODO: Initialize `reference_image`: + >>> reference_image = {} >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_product_sets(parent).pages: - ... for element in page: - ... # process element - ... pass + >>> response = client.create_reference_image(parent, reference_image) Args: - parent (str): The project from which ProductSets should be listed. + parent (str): Resource name of the product in which to create the reference image. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + reference_image (Union[dict, ~google.cloud.vision_v1.types.ReferenceImage]): The reference image to create. + If an image ID is specified, it is ignored. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.vision_v1.types.ReferenceImage` + reference_image_id (str): 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 ``/``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1203,10 +1182,7 @@ def list_product_sets( that is provided to the method. Returns: - A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.vision_v1.types.ProductSet` instances. - This object can also be configured to iterate over the pages - of the response through the `options` parameter. + A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1216,18 +1192,20 @@ def list_product_sets( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "list_product_sets" not in self._inner_api_calls: + if "create_reference_image" not in self._inner_api_calls: self._inner_api_calls[ - "list_product_sets" + "create_reference_image" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_product_sets, - default_retry=self._method_configs["ListProductSets"].retry, - default_timeout=self._method_configs["ListProductSets"].timeout, + self.transport.create_reference_image, + default_retry=self._method_configs["CreateReferenceImage"].retry, + default_timeout=self._method_configs["CreateReferenceImage"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.ListProductSetsRequest( - parent=parent, page_size=page_size + request = product_search_service_pb2.CreateReferenceImageRequest( + parent=parent, + reference_image=reference_image, + reference_image_id=reference_image_id, ) if metadata is None: metadata = [] @@ -1242,22 +1220,11 @@ def list_product_sets( ) metadata.append(routing_metadata) - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_product_sets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="product_sets", - request_token_field="page_token", - response_token_field="next_page_token", + return self._inner_api_calls["create_reference_image"]( + request, retry=retry, timeout=timeout, metadata=metadata ) - return iterator - def get_product_set( + def delete_reference_image( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -1265,26 +1232,29 @@ def get_product_set( metadata=None, ): """ - Gets information associated with a ProductSet. + Permanently deletes a reference image. - Possible errors: + The image metadata will be deleted right away, but search queries + against ProductSets containing the image may still work until all related + caches are refreshed. - - Returns NOT\_FOUND if the ProductSet does not exist. + The actual image files are not deleted from Google Cloud Storage. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') + >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') >>> - >>> response = client.get_product_set(name) + >>> client.delete_reference_image(name) Args: - name (str): Resource name of the ProductSet to get. + name (str): The resource name of the reference image to delete. Format is: - ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` + + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1294,9 +1264,6 @@ def get_product_set( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. - Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. - Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -1305,17 +1272,17 @@ def get_product_set( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_product_set" not in self._inner_api_calls: + if "delete_reference_image" not in self._inner_api_calls: self._inner_api_calls[ - "get_product_set" + "delete_reference_image" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product_set, - default_retry=self._method_configs["GetProductSet"].retry, - default_timeout=self._method_configs["GetProductSet"].timeout, + self.transport.delete_reference_image, + default_retry=self._method_configs["DeleteReferenceImage"].retry, + default_timeout=self._method_configs["DeleteReferenceImage"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.GetProductSetRequest(name=name) + request = product_search_service_pb2.DeleteReferenceImageRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) @@ -1329,49 +1296,57 @@ def get_product_set( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_product_set"]( + self._inner_api_calls["delete_reference_image"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def update_product_set( + def list_reference_images( self, - product_set, - update_mask=None, + parent, + page_size=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Makes changes to a ProductSet resource. Only display\_name can be - updated currently. + Lists reference images. Possible errors: - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask - but missing from the request or longer than 4096 characters. + - Returns NOT\_FOUND if the parent product does not exist. + - Returns INVALID\_ARGUMENT if the page\_size is greater than 100, or + less than 1. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} + >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') >>> - >>> response = client.update_product_set(product_set) + >>> # Iterate over all results + >>> for element in client.list_reference_images(parent): + ... # process element + ... pass + >>> + >>> + >>> # Alternatively: + >>> + >>> # Iterate over results one page at a time + >>> for page in client.list_reference_images(parent).pages: + ... for element in page: + ... # process element + ... pass Args: - product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): The ProductSet resource which replaces the one on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ProductSet` - update_mask (Union[dict, ~google.cloud.vision_v1.types.FieldMask]): The ``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``. + parent (str): Resource name of the product containing the reference images. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.FieldMask` + Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1382,7 +1357,10 @@ def update_product_set( that is provided to the method. Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. + A :class:`~google.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.vision_v1.types.ReferenceImage` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1392,24 +1370,24 @@ def update_product_set( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "update_product_set" not in self._inner_api_calls: + if "list_reference_images" not in self._inner_api_calls: self._inner_api_calls[ - "update_product_set" + "list_reference_images" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product_set, - default_retry=self._method_configs["UpdateProductSet"].retry, - default_timeout=self._method_configs["UpdateProductSet"].timeout, + self.transport.list_reference_images, + default_retry=self._method_configs["ListReferenceImages"].retry, + default_timeout=self._method_configs["ListReferenceImages"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask + request = product_search_service_pb2.ListReferenceImagesRequest( + parent=parent, page_size=page_size ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("product_set.name", product_set.name)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -1418,11 +1396,22 @@ def update_product_set( ) metadata.append(routing_metadata) - return self._inner_api_calls["update_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._inner_api_calls["list_reference_images"], + retry=retry, + timeout=timeout, + metadata=metadata, + ), + request=request, + items_field="reference_images", + request_token_field="page_token", + response_token_field="next_page_token", ) + return iterator - def delete_product_set( + def get_reference_image( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -1430,29 +1419,27 @@ def delete_product_set( metadata=None, ): """ - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. + Gets information associated with a ReferenceImage. Possible errors: - - Returns NOT\_FOUND if the ProductSet does not exist. + - Returns NOT\_FOUND if the specified image does not exist. Example: >>> from google.cloud import vision_v1 >>> >>> client = vision_v1.ProductSearchClient() >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') + >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') >>> - >>> client.delete_product_set(name) + >>> response = client.get_reference_image(name) Args: - name (str): Resource name of the ProductSet to delete. + name (str): The resource name of the ReferenceImage to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` + + ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. @@ -1462,6 +1449,9 @@ def delete_product_set( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. + Returns: + A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. + Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -1470,17 +1460,17 @@ def delete_product_set( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "delete_product_set" not in self._inner_api_calls: + if "get_reference_image" not in self._inner_api_calls: self._inner_api_calls[ - "delete_product_set" + "get_reference_image" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product_set, - default_retry=self._method_configs["DeleteProductSet"].retry, - default_timeout=self._method_configs["DeleteProductSet"].timeout, + self.transport.get_reference_image, + default_retry=self._method_configs["GetReferenceImage"].retry, + default_timeout=self._method_configs["GetReferenceImage"].timeout, client_info=self._client_info, ) - request = product_search_service_pb2.DeleteProductSetRequest(name=name) + request = product_search_service_pb2.GetReferenceImageRequest(name=name) if metadata is None: metadata = [] metadata = list(metadata) @@ -1494,7 +1484,7 @@ def delete_product_set( ) metadata.append(routing_metadata) - self._inner_api_calls["delete_product_set"]( + return self._inner_api_calls["get_reference_image"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -1592,10 +1582,6 @@ def remove_product_from_product_set( """ Removes a Product from the specified ProductSet. - Possible errors: - - - Returns NOT\_FOUND If the Product is not found under the ProductSet. - Example: >>> from google.cloud import vision_v1 >>> diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client_config.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client_config.py index ff598f4004ea..0d2f50f2d5bb 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client_config.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/product_search_client_config.py @@ -17,72 +17,72 @@ } }, "methods": { - "CreateProduct": { + "CreateProductSet": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "ListProducts": { + "ListProductSets": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "GetProduct": { + "GetProductSet": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "UpdateProduct": { + "UpdateProductSet": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "DeleteProduct": { + "DeleteProductSet": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "ListReferenceImages": { + "CreateProduct": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "GetReferenceImage": { + "ListProducts": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "DeleteReferenceImage": { + "GetProduct": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "CreateReferenceImage": { + "UpdateProduct": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "CreateProductSet": { + "DeleteProduct": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "ListProductSets": { + "CreateReferenceImage": { "timeout_millis": 60000, - "retry_codes_name": "idempotent", + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "GetProductSet": { + "DeleteReferenceImage": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "UpdateProductSet": { + "ListReferenceImages": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "DeleteProductSet": { + "GetReferenceImage": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py index 99f958558011..4845089335d8 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py @@ -119,6 +119,47 @@ def batch_annotate_images(self): """ return self._stubs["image_annotator_stub"].BatchAnnotateImages + @property + def batch_annotate_files(self): + """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_files`. + + 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. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["image_annotator_stub"].BatchAnnotateFiles + + @property + def async_batch_annotate_images(self): + """Return the gRPC stub for :meth:`ImageAnnotatorClient.async_batch_annotate_images`. + + Run asynchronous image detection and annotation for a list of images. + + Progress and results can be retrieved through the + ``google.longrunning.Operations`` interface. ``Operation.metadata`` + contains ``OperationMetadata`` (metadata). ``Operation.response`` + contains ``AsyncBatchAnnotateImagesResponse`` (results). + + This service will write image annotation outputs to json files in + customer GCS bucket, each json file containing + BatchAnnotateImagesResponse proto. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["image_annotator_stub"].AsyncBatchAnnotateImages + @property def async_batch_annotate_files(self): """Return the gRPC stub for :meth:`ImageAnnotatorClient.async_batch_annotate_files`. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py index 2b400357318a..799a3b1b929d 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py @@ -109,35 +109,32 @@ def channel(self): return self._channel @property - def create_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product`. + def create_product_set(self): + """Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`. - Creates and returns a new product resource. + Creates and returns a new ProductSet resource. Possible errors: - - Returns INVALID\_ARGUMENT if display\_name is missing or longer than - 4096 characters. - - Returns INVALID\_ARGUMENT if description is longer than 4096 - characters. - - Returns INVALID\_ARGUMENT if product\_category is missing or invalid. + - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer + than 4096 characters. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].CreateProduct + return self._stubs["product_search_stub"].CreateProductSet @property - def list_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_products`. + def list_product_sets(self): + """Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`. - Lists products in an unspecified order. + Lists ProductSets in an unspecified order. Possible errors: - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less + - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less than 1. Returns: @@ -145,131 +142,160 @@ def list_products(self): deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].ListProducts + return self._stubs["product_search_stub"].ListProductSets @property - def get_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product`. + def get_product_set(self): + """Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`. - Gets information associated with a Product. + Gets information associated with a ProductSet. Possible errors: - - Returns NOT\_FOUND if the Product does not exist. + - Returns NOT\_FOUND if the ProductSet does not exist. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].GetProduct + return self._stubs["product_search_stub"].GetProductSet @property - def update_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product`. - - Makes changes to a Product resource. Only the ``display_name``, - ``description``, and ``labels`` fields can be updated right now. + def update_product_set(self): + """Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`. - If labels are updated, the change will not be reflected in queries until - the next index time. + Makes changes to a ProductSet resource. Only display\_name can be + updated currently. Possible errors: - - Returns NOT\_FOUND if the Product does not exist. + - Returns NOT\_FOUND if the ProductSet does not exist. - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask - but is missing from the request or longer than 4096 characters. - - Returns INVALID\_ARGUMENT if description is present in update\_mask - but is longer than 4096 characters. - - Returns INVALID\_ARGUMENT if product\_category is present in - update\_mask. + but missing from the request or longer than 4096 characters. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].UpdateProduct + return self._stubs["product_search_stub"].UpdateProductSet @property - def delete_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product`. + def delete_product_set(self): + """Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`. - Permanently deletes a product and its reference images. + Permanently deletes a ProductSet. Products and ReferenceImages in the + ProductSet are not deleted. + + The actual image files are not deleted from Google Cloud Storage. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["product_search_stub"].DeleteProductSet - Metadata of the product and all its images will be deleted right away, - but search queries against ProductSets containing the product may still - work until all related caches are refreshed. + @property + def create_product(self): + """Return the gRPC stub for :meth:`ProductSearchClient.create_product`. + + Creates and returns a new product resource. Possible errors: - - Returns NOT\_FOUND if the product does not exist. + - Returns INVALID\_ARGUMENT if display\_name is missing or longer than + 4096 characters. + - Returns INVALID\_ARGUMENT if description is longer than 4096 + characters. + - Returns INVALID\_ARGUMENT if product\_category is missing or invalid. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].DeleteProduct + return self._stubs["product_search_stub"].CreateProduct @property - def list_reference_images(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`. + def list_products(self): + """Return the gRPC stub for :meth:`ProductSearchClient.list_products`. - Lists reference images. + Lists products in an unspecified order. Possible errors: - - Returns NOT\_FOUND if the parent product does not exist. - - Returns INVALID\_ARGUMENT if the page\_size is greater than 100, or - less than 1. + - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less + than 1. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].ListReferenceImages + return self._stubs["product_search_stub"].ListProducts @property - def get_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`. + def get_product(self): + """Return the gRPC stub for :meth:`ProductSearchClient.get_product`. - Gets information associated with a ReferenceImage. + Gets information associated with a Product. Possible errors: - - Returns NOT\_FOUND if the specified image does not exist. + - Returns NOT\_FOUND if the Product does not exist. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].GetReferenceImage + return self._stubs["product_search_stub"].GetProduct @property - def delete_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`. - - Permanently deletes a reference image. + def update_product(self): + """Return the gRPC stub for :meth:`ProductSearchClient.update_product`. - The image metadata will be deleted right away, but search queries - against ProductSets containing the image may still work until all - related caches are refreshed. + Makes changes to a Product resource. Only the ``display_name``, + ``description``, and ``labels`` fields can be updated right now. - The actual image files are not deleted from Google Cloud Storage. + If labels are updated, the change will not be reflected in queries until + the next index time. Possible errors: - - Returns NOT\_FOUND if the reference image does not exist. + - Returns NOT\_FOUND if the Product does not exist. + - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask + but is missing from the request or longer than 4096 characters. + - Returns INVALID\_ARGUMENT if description is present in update\_mask + but is longer than 4096 characters. + - Returns INVALID\_ARGUMENT if product\_category is present in + update\_mask. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].DeleteReferenceImage + return self._stubs["product_search_stub"].UpdateProduct + + @property + def delete_product(self): + """Return the gRPC stub for :meth:`ProductSearchClient.delete_product`. + + Permanently deletes a product and its reference images. + + Metadata of the product and all its images will be deleted right away, but + search queries against ProductSets containing the product may still work + until all related caches are refreshed. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["product_search_stub"].DeleteProduct @property def create_reference_image(self): @@ -305,97 +331,59 @@ def create_reference_image(self): return self._stubs["product_search_stub"].CreateReferenceImage @property - def create_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`. - - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProductSet - - @property - def list_product_sets(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`. - - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductSets - - @property - def get_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`. + def delete_reference_image(self): + """Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`. - Gets information associated with a ProductSet. + Permanently deletes a reference image. - Possible errors: + The image metadata will be deleted right away, but search queries + against ProductSets containing the image may still work until all related + caches are refreshed. - - Returns NOT\_FOUND if the ProductSet does not exist. + The actual image files are not deleted from Google Cloud Storage. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].GetProductSet + return self._stubs["product_search_stub"].DeleteReferenceImage @property - def update_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`. + def list_reference_images(self): + """Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`. - Makes changes to a ProductSet resource. Only display\_name can be - updated currently. + Lists reference images. Possible errors: - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns INVALID\_ARGUMENT if display\_name is present in update\_mask - but missing from the request or longer than 4096 characters. + - Returns NOT\_FOUND if the parent product does not exist. + - Returns INVALID\_ARGUMENT if the page\_size is greater than 100, or + less than 1. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].UpdateProductSet + return self._stubs["product_search_stub"].ListReferenceImages @property - def delete_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`. - - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. + def get_reference_image(self): + """Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`. - The actual image files are not deleted from Google Cloud Storage. + Gets information associated with a ReferenceImage. Possible errors: - - Returns NOT\_FOUND if the ProductSet does not exist. + - Returns NOT\_FOUND if the specified image does not exist. Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a deserialized response object. """ - return self._stubs["product_search_stub"].DeleteProductSet + return self._stubs["product_search_stub"].GetReferenceImage @property def add_product_to_product_set(self): @@ -423,10 +411,6 @@ def remove_product_from_product_set(self): Removes a Product from the specified ProductSet. - Possible errors: - - - Returns NOT\_FOUND If the Product is not found under the ProductSet. - Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/proto/geometry.proto b/packages/google-cloud-vision/google/cloud/vision_v1/proto/geometry.proto index f3ba8b773f51..881c8f84edee 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/proto/geometry.proto +++ b/packages/google-cloud-vision/google/cloud/vision_v1/proto/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator.proto b/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator.proto index abaf1bd756ac..ad9087213ac3 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator.proto +++ b/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,6 +49,38 @@ service ImageAnnotator { }; } + // 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. + rpc BatchAnnotateFiles(BatchAnnotateFilesRequest) + returns (BatchAnnotateFilesResponse) { + option (google.api.http) = { + post: "/v1/files:annotate" + body: "*" + }; + } + + // Run asynchronous image detection and annotation for a list of images. + // + // Progress and results can be retrieved through the + // `google.longrunning.Operations` interface. + // `Operation.metadata` contains `OperationMetadata` (metadata). + // `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + // + // This service will write image annotation outputs to json files in customer + // GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + rpc AsyncBatchAnnotateImages(AsyncBatchAnnotateImagesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/images:asyncBatchAnnotate" + body: "*" + }; + } + // Run asynchronous image detection and annotation for a list of generic // files, such as PDF files, which may contain multiple pages and multiple // images per page. Progress and results can be retrieved through the @@ -128,6 +160,28 @@ message Feature { string model = 3; } +// A bucketized representation of likelihood, which is intended to give clients +// highly stable results across model upgrades. +enum Likelihood { + // Unknown likelihood. + UNKNOWN = 0; + + // It is very unlikely that the image belongs to the specified vertical. + VERY_UNLIKELY = 1; + + // It is unlikely that the image belongs to the specified vertical. + UNLIKELY = 2; + + // It is possible that the image belongs to the specified vertical. + POSSIBLE = 3; + + // It is likely that the image belongs to the specified vertical. + LIKELY = 4; + + // It is very likely that the image belongs to the specified vertical. + VERY_LIKELY = 5; +} + // External image source (Google Cloud Storage or web URL image location). message ImageSource { // **Use `image_uri` instead.** @@ -294,7 +348,7 @@ message FaceAnnotation { } // The bounding polygon around the face. The coordinates of the bounding box - // are in the original image's scale, as returned in `ImageParams`. + // 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 @@ -505,7 +559,7 @@ message ImageProperties { // Single crop hint that is used to generate a new crop when serving an image. message CropHint { // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale, as returned in `ImageParams`. + // box are in the original image's scale. BoundingPoly bounding_poly = 1; // Confidence of this being a salient region. Range [0, 1]. @@ -565,7 +619,7 @@ message ImageContext { } // Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features. +// image, with user-requested features, and with context information. message AnnotateImageRequest { // The image to be processed. Image image = 1; @@ -648,6 +702,9 @@ message AnnotateFileResponse { // Individual responses to images found within the file. repeated AnnotateImageResponse responses = 2; + + // This field gives the total number of pages in the file. + int32 total_pages = 3; } // Multiple image annotation requests are batched into a single service call. @@ -662,6 +719,48 @@ message BatchAnnotateImagesResponse { repeated AnnotateImageResponse responses = 1; } +// A request to annotate one single file, e.g. a PDF, TIFF or GIF file. +message AnnotateFileRequest { + // Required. Information about the input file. + InputConfig input_config = 1; + + // Required. Requested features. + repeated Feature features = 2; + + // Additional context that may accompany the image(s) in the file. + ImageContext image_context = 3; + + // 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. + repeated int32 pages = 4; +} + +// A list of requests to annotate files using the BatchAnnotateFiles API. +message BatchAnnotateFilesRequest { + // The list of file annotation requests. Right now we support only one + // AnnotateFileRequest in BatchAnnotateFilesRequest. + repeated AnnotateFileRequest requests = 1; +} + +// A list of file annotation responses. +message BatchAnnotateFilesResponse { + // The list of file annotation responses, each response corresponding to each + // AnnotateFileRequest in BatchAnnotateFilesRequest. + repeated AnnotateFileResponse responses = 1; +} + // An offline file annotation request. message AsyncAnnotateFileRequest { // Required. Information about the input file. @@ -683,6 +782,21 @@ message AsyncAnnotateFileResponse { OutputConfig output_config = 1; } +// Request for async image annotation for a list of images. +message AsyncBatchAnnotateImagesRequest { + // Individual image annotation requests for this batch. + repeated AnnotateImageRequest requests = 1; + + // Required. The desired output location and metadata (e.g. format). + OutputConfig output_config = 2; +} + +// Response to an async batch image annotation request. +message AsyncBatchAnnotateImagesResponse { + // The output location and metadata from AsyncBatchAnnotateImagesRequest. + OutputConfig output_config = 1; +} + // Multiple async file annotation requests are batched into a single service // call. message AsyncBatchAnnotateFilesRequest { @@ -702,6 +816,14 @@ message InputConfig { // The Google Cloud Storage location to read the input from. GcsSource gcs_source = 1; + // 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. + bytes content = 3; + // The type of the file. Currently only "application/pdf" and "image/tiff" // are supported. Wildcards are not supported. string mime_type = 2; @@ -735,16 +857,23 @@ message GcsSource { // The Google Cloud Storage location where the output will be written to. message GcsDestination { - // Google Cloud Storage URI where the results will be stored. Results will - // be in JSON format and preceded by its corresponding input URI. This field - // can either represent a single file, or a prefix for multiple outputs. - // Prefixes must end in a `/`. + // 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: gs://bucket-name/filename.json - // * Prefix: gs://bucket-name/prefix/here/ - // * File: gs://bucket-name/prefix/here + // * 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. @@ -782,25 +911,3 @@ message OperationMetadata { // The time when the operation result was last updated. google.protobuf.Timestamp update_time = 6; } - -// A bucketized representation of likelihood, which is intended to give clients -// highly stable results across model upgrades. -enum Likelihood { - // Unknown likelihood. - UNKNOWN = 0; - - // It is very unlikely that the image belongs to the specified vertical. - VERY_UNLIKELY = 1; - - // It is unlikely that the image belongs to the specified vertical. - UNLIKELY = 2; - - // It is possible that the image belongs to the specified vertical. - POSSIBLE = 3; - - // It is likely that the image belongs to the specified vertical. - LIKELY = 4; - - // It is very likely that the image belongs to the specified vertical. - VERY_LIKELY = 5; -} diff --git a/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator_pb2.py b/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator_pb2.py index ec3b16112130..e3433a001e10 100644 --- a/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator_pb2.py +++ b/packages/google-cloud-vision/google/cloud/vision_v1/proto/image_annotator_pb2.py @@ -46,7 +46,7 @@ "\n\032com.google.cloud.vision.v1B\023ImageAnnotatorProtoP\001Z\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x42\n\tlandmarks\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12:\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12=\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12<\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x44\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12>\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x1a\xb9\x07\n\x08Landmark\x12\x42\n\x04type\x18\x03 \x01(\x0e\x32\x34.google.cloud.vision.v1.FaceAnnotation.Landmark.Type\x12\x32\n\x08position\x18\x04 \x01(\x0b\x32 .google.cloud.vision.v1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xab\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12;\n\rbounding_poly\x18\x07 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x37\n\tlocations\x18\x08 \x03(\x0b\x32$.google.cloud.vision.v1.LocationInfo\x12\x34\n\nproperties\x18\t \x03(\x0b\x32 .google.cloud.vision.v1.Property"\x99\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12;\n\rbounding_poly\x18\x05 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly"\x99\x02\n\x14SafeSearchAnnotation\x12\x31\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x31\n\x05spoof\x18\x02 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x33\n\x07medical\x18\x03 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x34\n\x08violence\x18\x04 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x30\n\x04racy\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"M\n\x18\x44ominantColorsAnnotation\x12\x31\n\x06\x63olors\x18\x01 \x03(\x0b\x32!.google.cloud.vision.v1.ColorInfo"\\\n\x0fImageProperties\x12I\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x30.google.cloud.vision.v1.DominantColorsAnnotation"x\n\x08\x43ropHint\x12;\n\rbounding_poly\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"K\n\x13\x43ropHintsAnnotation\x12\x34\n\ncrop_hints\x18\x01 \x03(\x0b\x32 .google.cloud.vision.v1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\xbc\x02\n\x0cImageContext\x12:\n\rlat_long_rect\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12\x42\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1.CropHintsParams\x12J\n\x15product_search_params\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1.ProductSearchParams\x12H\n\x14web_detection_params\x18\x06 \x01(\x0b\x32*.google.cloud.vision.v1.WebDetectionParams"\xb4\x01\n\x14\x41nnotateImageRequest\x12,\n\x05image\x18\x01 \x01(\x0b\x32\x1d.google.cloud.vision.v1.Image\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\xe4\x07\n\x15\x41nnotateImageResponse\x12@\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1.FaceAnnotation\x12\x46\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x42\n\x10logo_annotations\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x43\n\x11label_annotations\x18\x04 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12W\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x31.google.cloud.vision.v1.LocalizedObjectAnnotation\x12\x42\n\x10text_annotations\x18\x05 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x44\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32&.google.cloud.vision.v1.TextAnnotation\x12L\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32,.google.cloud.vision.v1.SafeSearchAnnotation\x12L\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32\'.google.cloud.vision.v1.ImageProperties\x12J\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32+.google.cloud.vision.v1.CropHintsAnnotation\x12;\n\rweb_detection\x18\r \x01(\x0b\x32$.google.cloud.vision.v1.WebDetection\x12L\n\x16product_search_results\x18\x0e \x01(\x0b\x32,.google.cloud.vision.v1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12?\n\x07\x63ontext\x18\x15 \x01(\x0b\x32..google.cloud.vision.v1.ImageAnnotationContext"\x93\x01\n\x14\x41nnotateFileResponse\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12@\n\tresponses\x18\x02 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse"\\\n\x1a\x42\x61tchAnnotateImagesRequest\x12>\n\x08requests\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateImageRequest"_\n\x1b\x42\x61tchAnnotateImagesResponse\x12@\n\tresponses\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse"\x82\x02\n\x18\x41syncAnnotateFileRequest\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext\x12;\n\routput_config\x18\x04 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"X\n\x19\x41syncAnnotateFileResponse\x12;\n\routput_config\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"d\n\x1e\x41syncBatchAnnotateFilesRequest\x12\x42\n\x08requests\x18\x01 \x03(\x0b\x32\x30.google.cloud.vision.v1.AsyncAnnotateFileRequest"g\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x44\n\tresponses\x18\x01 \x03(\x0b\x32\x31.google.cloud.vision.v1.AsyncAnnotateFileResponse"W\n\x0bInputConfig\x12\x35\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.vision.v1.GcsSource\x12\x11\n\tmime_type\x18\x02 \x01(\t"c\n\x0cOutputConfig\x12?\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x88\x02\n\x11OperationMetadata\x12>\n\x05state\x18\x01 \x01(\x0e\x32/.google.cloud.vision.v1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xcd\x02\n\x0eImageAnnotator\x12\x9e\x01\n\x13\x42\x61tchAnnotateImages\x12\x32.google.cloud.vision.v1.BatchAnnotateImagesRequest\x1a\x33.google.cloud.vision.v1.BatchAnnotateImagesResponse"\x1e\x82\xd3\xe4\x93\x02\x18"\x13/v1/images:annotate:\x01*\x12\x99\x01\n\x17\x41syncBatchAnnotateFiles\x12\x36.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation"\'\x82\xd3\xe4\x93\x02!"\x1c/v1/files:asyncBatchAnnotate:\x01*B{\n\x1a\x63om.google.cloud.vision.v1B\x13ImageAnnotatorProtoP\x01Z\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x42\n\tlandmarks\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12:\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12=\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12<\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x44\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12>\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x1a\xb9\x07\n\x08Landmark\x12\x42\n\x04type\x18\x03 \x01(\x0e\x32\x34.google.cloud.vision.v1.FaceAnnotation.Landmark.Type\x12\x32\n\x08position\x18\x04 \x01(\x0b\x32 .google.cloud.vision.v1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xab\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12;\n\rbounding_poly\x18\x07 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x37\n\tlocations\x18\x08 \x03(\x0b\x32$.google.cloud.vision.v1.LocationInfo\x12\x34\n\nproperties\x18\t \x03(\x0b\x32 .google.cloud.vision.v1.Property"\x99\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12;\n\rbounding_poly\x18\x05 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly"\x99\x02\n\x14SafeSearchAnnotation\x12\x31\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x31\n\x05spoof\x18\x02 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x33\n\x07medical\x18\x03 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x34\n\x08violence\x18\x04 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x30\n\x04racy\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"M\n\x18\x44ominantColorsAnnotation\x12\x31\n\x06\x63olors\x18\x01 \x03(\x0b\x32!.google.cloud.vision.v1.ColorInfo"\\\n\x0fImageProperties\x12I\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x30.google.cloud.vision.v1.DominantColorsAnnotation"x\n\x08\x43ropHint\x12;\n\rbounding_poly\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"K\n\x13\x43ropHintsAnnotation\x12\x34\n\ncrop_hints\x18\x01 \x03(\x0b\x32 .google.cloud.vision.v1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\xbc\x02\n\x0cImageContext\x12:\n\rlat_long_rect\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12\x42\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1.CropHintsParams\x12J\n\x15product_search_params\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1.ProductSearchParams\x12H\n\x14web_detection_params\x18\x06 \x01(\x0b\x32*.google.cloud.vision.v1.WebDetectionParams"\xb4\x01\n\x14\x41nnotateImageRequest\x12,\n\x05image\x18\x01 \x01(\x0b\x32\x1d.google.cloud.vision.v1.Image\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\xe4\x07\n\x15\x41nnotateImageResponse\x12@\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1.FaceAnnotation\x12\x46\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x42\n\x10logo_annotations\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x43\n\x11label_annotations\x18\x04 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12W\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x31.google.cloud.vision.v1.LocalizedObjectAnnotation\x12\x42\n\x10text_annotations\x18\x05 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x44\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32&.google.cloud.vision.v1.TextAnnotation\x12L\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32,.google.cloud.vision.v1.SafeSearchAnnotation\x12L\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32\'.google.cloud.vision.v1.ImageProperties\x12J\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32+.google.cloud.vision.v1.CropHintsAnnotation\x12;\n\rweb_detection\x18\r \x01(\x0b\x32$.google.cloud.vision.v1.WebDetection\x12L\n\x16product_search_results\x18\x0e \x01(\x0b\x32,.google.cloud.vision.v1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12?\n\x07\x63ontext\x18\x15 \x01(\x0b\x32..google.cloud.vision.v1.ImageAnnotationContext"\xa8\x01\n\x14\x41nnotateFileResponse\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12@\n\tresponses\x18\x02 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse\x12\x13\n\x0btotal_pages\x18\x03 \x01(\x05"\\\n\x1a\x42\x61tchAnnotateImagesRequest\x12>\n\x08requests\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateImageRequest"_\n\x1b\x42\x61tchAnnotateImagesResponse\x12@\n\tresponses\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse"\xcf\x01\n\x13\x41nnotateFileRequest\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext\x12\r\n\x05pages\x18\x04 \x03(\x05"Z\n\x19\x42\x61tchAnnotateFilesRequest\x12=\n\x08requests\x18\x01 \x03(\x0b\x32+.google.cloud.vision.v1.AnnotateFileRequest"]\n\x1a\x42\x61tchAnnotateFilesResponse\x12?\n\tresponses\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateFileResponse"\x82\x02\n\x18\x41syncAnnotateFileRequest\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext\x12;\n\routput_config\x18\x04 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"X\n\x19\x41syncAnnotateFileResponse\x12;\n\routput_config\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"\x9e\x01\n\x1f\x41syncBatchAnnotateImagesRequest\x12>\n\x08requests\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateImageRequest\x12;\n\routput_config\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"_\n AsyncBatchAnnotateImagesResponse\x12;\n\routput_config\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"d\n\x1e\x41syncBatchAnnotateFilesRequest\x12\x42\n\x08requests\x18\x01 \x03(\x0b\x32\x30.google.cloud.vision.v1.AsyncAnnotateFileRequest"g\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x44\n\tresponses\x18\x01 \x03(\x0b\x32\x31.google.cloud.vision.v1.AsyncAnnotateFileResponse"h\n\x0bInputConfig\x12\x35\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.vision.v1.GcsSource\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t"c\n\x0cOutputConfig\x12?\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x88\x02\n\x11OperationMetadata\x12>\n\x05state\x18\x01 \x01(\x0e\x32/.google.cloud.vision.v1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\x89\x05\n\x0eImageAnnotator\x12\x9e\x01\n\x13\x42\x61tchAnnotateImages\x12\x32.google.cloud.vision.v1.BatchAnnotateImagesRequest\x1a\x33.google.cloud.vision.v1.BatchAnnotateImagesResponse"\x1e\x82\xd3\xe4\x93\x02\x18"\x13/v1/images:annotate:\x01*\x12\x9a\x01\n\x12\x42\x61tchAnnotateFiles\x12\x31.google.cloud.vision.v1.BatchAnnotateFilesRequest\x1a\x32.google.cloud.vision.v1.BatchAnnotateFilesResponse"\x1d\x82\xd3\xe4\x93\x02\x17"\x12/v1/files:annotate:\x01*\x12\x9c\x01\n\x18\x41syncBatchAnnotateImages\x12\x37.google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest\x1a\x1d.google.longrunning.Operation"(\x82\xd3\xe4\x93\x02""\x1d/v1/images:asyncBatchAnnotate:\x01*\x12\x99\x01\n\x17\x41syncBatchAnnotateFiles\x12\x36.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation"\'\x82\xd3\xe4\x93\x02!"\x1c/v1/files:asyncBatchAnnotate:\x01*B{\n\x1a\x63om.google.cloud.vision.v1B\x13ImageAnnotatorProtoP\x01Z