ImageAnnotatorAsyncClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Union[str, google.cloud.vision_v1p2beta1.services.image_annotator.transports.base.ImageAnnotatorTransport] = 'grpc_asyncio', client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)
Service that performs Google Cloud Vision API detection tasks over client images, such as face, landmark, logo, label, and text detection. The ImageAnnotator service returns detected entities from the images.
Properties
transport
Returns the transport used by the client instance.
Returns | |
---|---|
Type | Description |
ImageAnnotatorTransport | The transport used by the client instance. |
Methods
ImageAnnotatorAsyncClient
ImageAnnotatorAsyncClient(*, credentials: Optional[google.auth.credentials.Credentials] = None, transport: Union[str, google.cloud.vision_v1p2beta1.services.image_annotator.transports.base.ImageAnnotatorTransport] = 'grpc_asyncio', client_options: Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)
Instantiates the image annotator client.
Parameters | |
---|---|
Name | Description |
credentials |
Optional[google.auth.credentials.Credentials]
The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. |
transport |
Union[str,
The transport to use. If set to None, a transport is chosen automatically. |
client_options |
ClientOptions
Custom options for the client. It won't take effect if a |
Exceptions | |
---|---|
Type | Description |
google.auth.exceptions.MutualTlsChannelError | If mutual TLS transport creation failed for any reason. |
async_batch_annotate_files
async_batch_annotate_files(request: Optional[Union[google.cloud.vision_v1p2beta1.types.image_annotator.AsyncBatchAnnotateFilesRequest, dict]] = None, *, requests: Optional[MutableSequence[google.cloud.vision_v1p2beta1.types.image_annotator.AsyncAnnotateFileRequest]] = None, retry: Union[google.api_core.retry.Retry, google.api_core.gapic_v1.method._MethodDefault] = <_MethodDefault._DEFAULT_VALUE: <object object>>, timeout: Union[float, object] = <_MethodDefault._DEFAULT_VALUE: <object object>>, metadata: Sequence[Tuple[str, str]] = ())
Run async image detection and annotation for a list of generic
files (e.g. PDF) which may contain multiple pages and multiple
images per page. Progress and results can be retrieved through
the google.longrunning.Operations
interface.
Operation.metadata
contains OperationMetadata
(metadata). Operation.response
contains
AsyncBatchAnnotateFilesResponse
(results).
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import vision_v1p2beta1
async def sample_async_batch_annotate_files():
# Create a client