Vision Client#


Client for interacting with the Google Cloud Vision API.

class, credentials=None, http=None, use_gax=None)[source]#


Client to bundle configuration needed for API requests.

  • project (str) – the project which the client acts on behalf of. If not passed, falls back to the default inferred from the environment.
  • credentials (Credentials) – (Optional) The OAuth2 Credentials to use for this client. If not passed (and if no http object is passed), falls back to the default inferred from the environment.
  • http (Http) – (Optional) HTTP object to make requests. Can be any object that defines request() with the same interface as request(). If not passed, an http object is created that is bound to the credentials for the current object.
  • use_gax (bool) – (Optional) Explicitly specifies whether to use the gRPC transport (via GAX) or HTTP. If unset, falls back to the GOOGLE_CLOUD_DISABLE_GRPC environment variable
SCOPE = ('',)#

The scopes required for authenticating as a Cloud Vision consumer.


Batch multiple images into a single API request.

Returns:Instance of Batch.
image(content=None, filename=None, source_uri=None)[source]#

Get instance of Image using current client.

  • content (bytes) – Byte stream of an image.
  • filename (str) – Filename to image.
  • source_uri (str) – URL or Google Cloud Storage URI of image.
Return type:



Image instance with the current client attached.