Vision Image#
Image#
Image represented by either a URI or byte stream.
-
class
google.cloud.vision.image.Image(client, content=None, source_uri=None)[source]# Bases:
objectImage representation containing information to be annotate.
Parameters: -
as_dict()[source]# Generate dictionary structure for request.
Return type: dict Returns: Dictionary with source information for image.
-
detect_faces(limit=10)[source]# Detect faces in image.
Parameters: limit (int) – The number of faces to try and detect. Return type: list Returns: List of Face.
-
detect_labels(limit=10)[source]# Detect labels that describe objects in an image.
Parameters: limit (int) – The maximum number of labels to try and detect. Return type: list Returns: List of EntityAnnotation
-
detect_landmarks(limit=10)[source]# Detect landmarks in an image.
Parameters: limit (int) – The maximum number of landmarks to find. Return type: list Returns: List of EntityAnnotation.
-
detect_logos(limit=10)[source]# Detect logos in an image.
Parameters: limit (int) – The maximum number of logos to find. Return type: list Returns: List of EntityAnnotation.
-
detect_properties(limit=10)[source]# Detect the color properties of an image.
Parameters: limit (int) – The maximum number of image properties to find. Return type: list Returns: List of ImagePropertiesAnnotation.
-
detect_safe_search(limit=10)[source]# Retreive safe search properties from an image.
Parameters: limit (int) – The number of faces to try and detect. Return type: list Returns: List of SafeSearchAnnotation.
-
detect_text(limit=10)[source]# Detect text in an image.
Parameters: limit (int) – The maximum instances of text to find. Return type: list Returns: List of EntityAnnotation.
-
Geometry#
Geometry and other generic classes used by the Vision API.
-
class
google.cloud.vision.geometry.Bounds(vertices)[source]# Bases:
google.cloud.vision.geometry.BoundsBaseA polygon boundry of the detected feature.
-
class
google.cloud.vision.geometry.BoundsBase(vertices)[source]# Bases:
objectBase class for handling bounds with vertices.
Parameters: vertices (list of Vertex) – List of vertcies describing points on an image.-
classmethod
from_api_repr(response_vertices)[source]# Factory: construct BoundsBase instance from Vision API response.
Parameters: response_vertices (dict) – List of vertices. Return type: BoundsBaseor NoneReturns: Instance of BoundsBase with populated verticies or None.
-
classmethod
-
class
google.cloud.vision.geometry.FDBounds(vertices)[source]# Bases:
google.cloud.vision.geometry.BoundsBaseThe bounding polygon of just the skin portion of the face.
-
class
google.cloud.vision.geometry.LocationInformation(latitude, longitude)[source]# Bases:
objectRepresentation of location information returned by the Vision API.
Parameters: -
classmethod
from_api_repr(response)[source]# Factory: construct location information from Vision API response.
Parameters: response (dict) – Dictionary response of locations. Return type: LocationInformationReturns: LocationInformationwith populated latitude and longitude.
-
classmethod
-
class
google.cloud.vision.geometry.Position(x_coordinate, y_coordinate, z_coordinate)[source]# Bases:
objectA 3D position in the image.
See: https://cloud.google.com/vision/reference/rest/v1/images/annotate#Position
Parameters:
-
class
google.cloud.vision.geometry.Vertex(x_coordinate, y_coordinate)[source]# Bases:
objectA vertex represents a 2D point in the image.
See: https://cloud.google.com/vision/reference/rest/v1/images/annotate#Vertex
Parameters:
Likelihood#
Likelihood constants returned from Vision API.
-
class
google.cloud.vision.likelihood.Likelihood[source]# Bases:
objectA representation of likelihood to give stable results across upgrades.
See: https://cloud.google.com/vision/reference/rest/v1/images/annotate#likelihood
-
LIKELY= 'LIKELY'#
-
POSSIBLE= 'POSSIBLE'#
-
UNKNOWN= 'UNKNOWN'#
-
UNLIKELY= 'UNLIKELY'#
-
VERY_LIKELY= 'VERY_LIKELY'#
-
VERY_UNLIKELY= 'VERY_UNLIKELY'#
-