google.cloud.vision.v1.image_annotator_api¶
Accesses the google.cloud.vision.v1 ImageAnnotator API.
Classes
ImageAnnotatorApi ([service_path, port, ...]) |
Service that performs Google Cloud Vision API detection tasks, such as face, landmark, logo, label, and text detection, over client images, and returns detected entities from the images. |
-
class
google.cloud.vision.v1.image_annotator_api.
ImageAnnotatorApi
(service_path='vision.googleapis.com', port=443, channel=None, metadata_transformer=None, ssl_creds=None, scopes=None, client_config=None, app_name='gax', app_version='0.12.5')[source]¶ Service that performs Google Cloud Vision API detection tasks, such as face, landmark, logo, label, and text detection, over client images, and returns detected entities from the images.
Constructor.
Parameters: - service_path (string) – The domain name of the API remote host.
- port (int) – The port on which to connect to the remote host.
- channel (
grpc.beta.implementations.Channel
) – AChannel
object through which to make calls. - ssl_creds (
grpc.beta.implementations.ClientCredentials
) – A ClientCredentials for use with an SSL-enabled channel. - client_config (dict) – A dictionary for call options for each method. See
google.gax.construct_settings()
for the structure of this data. Falls back to the default config if not specified or the specified config is missing data points. - metadata_transformer (Callable[[], list]) – A function that creates the metadata for requests.
- app_name (string) – The codename of the calling service.
- app_version (string) – The version of the calling service.
Returns: A ImageAnnotatorApi object.
-
DEFAULT_SERVICE_PORT
= 443¶ The default port of the service.
-
SERVICE_ADDRESS
= 'vision.googleapis.com'¶ The default address of the service.
-
batch_annotate_images
(requests, options=None)[source]¶ Run image detection and annotation for a batch of images.
Example
>>> from google.cloud.vision.v1.image_annotator_api import ImageAnnotatorApi >>> from google.cloud.vision.v1 import image_annotator_pb2 >>> api = ImageAnnotatorApi() >>> requests = [] >>> response = api.batch_annotate_images(requests)
Parameters: - requests (list[
google.cloud.vision.v1.image_annotator_pb2.AnnotateImageRequest
]) – Individual image annotation requests for this batch. - options (
google.gax.CallOptions
) – Overrides the default settings for this call, e.g, timeout, retries etc.
Returns: A
google.cloud.vision.v1.image_annotator_pb2.BatchAnnotateImagesResponse
instance.Raises: google.gax.errors.GaxError
if the RPC is aborted.- requests (list[