Vision Feature#

Feature#

Feature represenging various types of annotating.

class google.cloud.vision.feature.Feature(feature_type, max_results=1)[source]#

Bases: object

Feature object specifying the annotation type and maximum results.

Parameters:
  • feature_type (str) – String representation of FeatureType.
  • max_results (int) – Number of results to return for the specified feature type.

See: https://cloud.google.com/vision/reference/rest/v1/images/annotate#Feature

as_dict()[source]#

Generate dictionary for Feature request format.

Return type:dict
Returns:Dictionary representation of a FeatureType.
feature_type#

“Feature type string.

Return type:FeatureTypes
Returns:Instance of FeatureTypes
max_results#

Maximum number of results for feature type.

Return type:int
Returns:Maxium results to be returned.
class google.cloud.vision.feature.FeatureTypes[source]#

Bases: object

Feature Types to indication which annotations to perform.

See: https://cloud.google.com/vision/reference/rest/v1/images/annotate#Type

FACE_DETECTION = 'FACE_DETECTION'#
IMAGE_PROPERTIES = 'IMAGE_PROPERTIES'#
LABEL_DETECTION = 'LABEL_DETECTION'#
LANDMARK_DETECTION = 'LANDMARK_DETECTION'#
LOGO_DETECTION = 'LOGO_DETECTION'#
SAFE_SEARCH_DETECTION = 'SAFE_SEARCH_DETECTION'#
TEXT_DETECTION = 'TEXT_DETECTION'#