Vision Crop Hint#

Crop Hint#

Representation of Vision API’s crop hints.

class google.cloud.vision.crop_hint.CropHint(bounds, confidence, importance_fraction)[source]#

Bases: object

Representation of a crop hint returned from the Vision API.

Parameters:
  • bounds (dict) – Dictionary of boundary information of detected entity.
  • confidence (float) – Confidence of this being a salient region.
  • importance_fraction (float) – Fraction of importance of this region.
bounds#

Bounding polygon of crop hints.

Return type:Bounds
Returns:Instance of Bounds with populated vertices.
confidence#

Confidence of this being a salient region. Range [0, 1].

Return type:float
Returns:float between 0 and 1, inclusive.
classmethod from_api_repr(response)[source]#

Factory: construct CropHint from Vision API response.

Parameters:response (dict) – Dictionary response from Vision API with entity data.
Return type:CropHint
Returns:Instance of CropHint.
classmethod from_pb(response)[source]#

Factory: construct CropHint from Vision gRPC response.

Parameters:response (google.cloud.proto.vision.v1.                        image_annotator_pb2.CropHint) – gRPC response from Vision API with entity data.
Return type:CropHint
Returns:Instance of CropHint.
importance_fraction#

Fraction of importance of this salient region with respect to the original image.

Return type:float
Returns:float