Vision Image Properties#
Image Properties Annotation#
Image properties class representation derived from Vision API response.
-
class
google.cloud.vision.color.
Color
(red, green, blue, alpha)[source]# Bases:
object
Representation of RGBA color information.
Parameters: - red (int) – The amount of red in the color as a value in the interval [0, 255].
- green (int) – The amount of green in the color as a value in the interval [0, 255].
- blue (int) – The amount of blue in the color as a value in the interval [0, 255].
- alpha (float) – The fraction of this color that should be applied to the pixel.
-
class
google.cloud.vision.color.
ColorInformation
(color, score, pixel_fraction)[source]# Bases:
object
Representation of color information from API response.
Parameters: -
color
# RGB components of the color.
Return type: Color
Returns: Instance of Color
.
-
classmethod
from_api_repr
(response)[source]# Factory: construct
ColorInformation
for a color found.Parameters: response (dict) – Color data with extra meta information. Return type: ColorInformation
Returns: Instance of ColorInformation
.
-
-
class
google.cloud.vision.color.
ImagePropertiesAnnotation
(colors)[source]# Bases:
object
Representation of image properties
Parameters: colors (list) – List of ColorInformation
.-
colors
# Colors in an image.
Return type: list of ColorInformation
Returns: Populated list of ColorInformation
.
-
classmethod
from_api_repr
(response)[source]# Factory: construct
ImagePropertiesAnnotation
from a response.Parameters: response (dict) – Dictionary response from Vision API with image properties data. Return type: ImagePropertiesAnnotation
.Returns: Populated instance of ImagePropertiesAnnotation
.
-