@@ -84,15 +84,14 @@ You can call the detection method manually.
84
84
>> > features = [Feature(FeatureTypes.FACE_DETECTION , 5 ),
85
85
... Feature(FeatureTypes.LOGO_DETECTION , 3 )]
86
86
>> > annotations = image.detect(features)
87
- >> > len (annotations.faces )
87
+ >> > len (annotations)
88
88
2
89
- >> > for face in annotations.faces:
90
- ... print (face.joy_likelihood)
91
- 0.94099093
92
- 0.54453093
93
- >> > len (annotations.logos)
94
- 2
95
- >> > for logo in annotations.logos:
89
+ >> > for face in annotations[0 ].faces:
90
+ ... print (face.joy)
91
+ Likelihood.VERY_LIKELY
92
+ Likelihood.VERY_LIKELY
93
+ Likelihood.VERY_LIKELY
94
+ >> > for logo in annotations[0 ].logos:
96
95
... print (logo.description)
97
96
' google'
98
97
' github'
@@ -140,15 +139,15 @@ was detected.
140
139
>> > faces = image.detect_faces(limit = 10 )
141
140
>> > first_face = faces[0 ]
142
141
>> > first_face.landmarks.left_eye.landmark_type
143
- < LandmarkTypes.LEFT_EYE : ' LEFT_EYE ' >
142
+ LandmarkTypes.LEFT_EYE
144
143
>> > first_face.landmarks.left_eye.position.x_coordinate
145
144
1301.2404
146
145
>> > first_face.detection_confidence
147
146
0.9863683
148
147
>> > first_face.joy
149
- < Likelihood.VERY_LIKELY : ' VERY_LIKELY ' >
148
+ Likelihood.VERY_UNLIKELY
150
149
>> > first_face.anger
151
- < Likelihood.VERY_UNLIKELY : ' VERY_UNLIKELY ' >
150
+ Likelihood.VERY_UNLIKELY
152
151
153
152
154
153
***************
@@ -250,13 +249,13 @@ categorize the entire contents of the image under four categories.
250
249
... image = client.image(content = image_file.read())
251
250
>> > safe_search = image.detect_safe_search()
252
251
>> > safe_search.adult
253
- < Likelihood.VERY_UNLIKELY : ' VERY_UNLIKELY ' >
252
+ Likelihood.VERY_UNLIKELY
254
253
>> > safe_search.spoof
255
- < Likelihood.POSSIBLE : ' POSSIBLE ' >
254
+ Likelihood.POSSIBLE
256
255
>> > safe_search.medical
257
- < Likelihood.VERY_LIKELY : ' VERY_LIKELY ' >
256
+ Likelihood.VERY_LIKELY
258
257
>> > safe_search.violence
259
- < Likelihood.LIKELY : ' LIKELY ' >
258
+ Likelihood.LIKELY
260
259
261
260
262
261
**************
@@ -297,9 +296,9 @@ image and determine the dominant colors in the image.
297
296
>> > properties = image.detect_properties()
298
297
>> > colors = properties.colors
299
298
>> > first_color = colors[0 ]
300
- >> > first_color.red
299
+ >> > first_color.color. red
301
300
244.0
302
- >> > first_color.blue
301
+ >> > first_color.color. blue
303
302
134.0
304
303
>> > first_color.score
305
304
0.65519291
0 commit comments