1515"""Face class representing the Vision API's face detection response."""
1616
1717
18- from gcloud .vision .geometry import BoundsBase
19- from gcloud .vision .likelihood import Likelihood
20- from gcloud .vision .geometry import Position
18+ from google . cloud .vision .geometry import BoundsBase
19+ from google . cloud .vision .likelihood import Likelihood
20+ from google . cloud .vision .geometry import Position
2121
2222
2323class Angles (object ):
@@ -31,7 +31,7 @@ def __init__(self, roll, pan, tilt):
3131 def from_api_repr (cls , response ):
3232 """Factory: construct the angles from an Vision API response.
3333
34- :rtype: :class:`gcloud .vision.face.Angles`
34+ :rtype: :class:`google.cloud .vision.face.Angles`
3535 :returns: An `Angles` instance with data parsed from `response`.
3636 """
3737 roll = response ['rollAngle' ]
@@ -88,7 +88,7 @@ def from_api_repr(cls, response):
8888 :type response: dict
8989 :param response: Response dictionary representing a face.
9090
91- :rtype: :class:`gcloud .vision.face.Emotions`
91+ :rtype: :class:`google.cloud .vision.face.Emotions`
9292 :returns: Populated instance of `Emotions`.
9393 """
9494 joy_likelihood = getattr (Likelihood , response ['joyLikelihood' ])
@@ -105,7 +105,8 @@ def joy_likelihood(self):
105105 """Likelihood of joy in detected face.
106106
107107 :rtype: str
108- :returns: String derived from :class:`gcloud.vision.face.Likelihood`.
108+ :returns: String derived from
109+ :class:`google.cloud.vision.face.Likelihood`.
109110 """
110111 return self ._joy_likelihood
111112
@@ -114,7 +115,8 @@ def sorrow_likelihood(self):
114115 """Likelihood of sorrow in detected face.
115116
116117 :rtype: str
117- :returns: String derived from :class:`gcloud.vision.face.Likelihood`.
118+ :returns: String derived from
119+ :class:`google.cloud.vision.face.Likelihood`.
118120 """
119121 return self ._sorrow_likelihood
120122
@@ -123,7 +125,8 @@ def surprise_likelihood(self):
123125 """Likelihood of surprise in detected face.
124126
125127 :rtype: str
126- :returns: String derived from :class:`gcloud.vision.face.Likelihood`.
128+ :returns: String derived from
129+ :class:`google.cloud.vision.face.Likelihood`.
127130 """
128131 return self ._surprise_likelihood
129132
@@ -132,7 +135,8 @@ def anger_likelihood(self):
132135 """Likelihood of anger in detected face.
133136
134137 :rtype: str
135- :returns: String derived from :class:`gcloud.vision.face.Likelihood`.
138+ :returns: String derived from
139+ :class:`google.cloud.vision.face.Likelihood`.
136140 """
137141 return self ._anger_likelihood
138142
@@ -160,7 +164,7 @@ def from_api_repr(cls, response):
160164 :type response: dict
161165 :param response: Face annotation dict returned from the Vision API.
162166
163- :rtype: :class:`gcloud .vision.face.Face`
167+ :rtype: :class:`google.cloud .vision.face.Face`
164168 :returns: A instance of `Face` with data parsed from `response`.
165169 """
166170 angles = Angles .from_api_repr (response )
@@ -182,7 +186,7 @@ def from_api_repr(cls, response):
182186 def angles (self ):
183187 """Accessor to the pan, tilt and roll angles of a Face.
184188
185- :rtype: :class:`gcloud .vision.face.Angles`
189+ :rtype: :class:`google.cloud .vision.face.Angles`
186190 :returns: Pan, tilt and roll angles of the detected face.
187191 """
188192
@@ -192,7 +196,7 @@ def angles(self):
192196 def bounds (self ):
193197 """Accessor to the bounding poly information of the detected face.
194198
195- :rtype: :class:`gcloud .vision.face.Bounds`
199+ :rtype: :class:`google.cloud .vision.face.Bounds`
196200 :returns: An instance of ``Bounds`` which has a list of vertices.
197201 """
198202 return self ._bounds
@@ -210,7 +214,7 @@ def detection_confidence(self):
210214 def emotions (self ):
211215 """Accessor to the possible emotions expressed in the detected face.
212216
213- :rtype: :class:`gcloud .vision.face.Emotions`
217+ :rtype: :class:`google.cloud .vision.face.Emotions`
214218 :returns: An instance of ``Emotions`` with joy, sorrow, anger, surprise
215219 likelihood.
216220 """
@@ -220,7 +224,7 @@ def emotions(self):
220224 def fd_bounds (self ):
221225 """Accessor to the skin area bounding poly of the detected face.
222226
223- :rtype: :class:`gcloud .vision.image.FDBounds`
227+ :rtype: :class:`google.cloud .vision.image.FDBounds`
224228 :returns: An instance of ``FDBounds`` which has a list of vertices.
225229 """
226230 return self ._fd_bounds
@@ -229,17 +233,17 @@ def fd_bounds(self):
229233 def headwear_likelihood (self ):
230234 """Headwear likelihood.
231235
232- :rtype: :class:`gcloud .vision.face.Likelihood`
236+ :rtype: :class:`google.cloud .vision.face.Likelihood`
233237 :returns: String representing the likelihood based on
234- :class:`gcloud .vision.face.Likelihood`
238+ :class:`google.cloud .vision.face.Likelihood`
235239 """
236240 return self ._headwear_likelihood
237241
238242 @property
239243 def image_properties (self ):
240244 """Image properties from imaged used in face detection.
241245
242- :rtype: :class:`gcloud .vision.face.FaceImageProperties`
246+ :rtype: :class:`google.cloud .vision.face.FaceImageProperties`
243247 :returns: ``FaceImageProperties`` object with image properties.
244248 """
245249 return self ._image_properties
@@ -248,7 +252,7 @@ def image_properties(self):
248252 def landmarks (self ):
249253 """Accessor to the facial landmarks detected in a face.
250254
251- :rtype: :class:`gcloud .vision.face.Landmarks`
255+ :rtype: :class:`google.cloud .vision.face.Landmarks`
252256 :returns: ``Landmarks`` object with facial landmarks as properies.
253257 """
254258 return self ._landmarks
@@ -274,7 +278,7 @@ def __init__(self, blurred_likelihood, underexposed_likelihood):
274278 def from_api_repr (cls , response ):
275279 """Factory: construct image properties from image.
276280
277- :rtype: :class:`gcloud .vision.face.FaceImageProperties`
281+ :rtype: :class:`google.cloud .vision.face.FaceImageProperties`
278282 :returns: Instance populated with image property data.
279283 """
280284 blurred_likelihood = getattr (Likelihood ,
@@ -290,7 +294,7 @@ def blurred_likelihood(self):
290294
291295 :rtype: str
292296 :returns: String representation derived from
293- :class:`gcloud .vision.face.Position`.
297+ :class:`google.cloud .vision.face.Position`.
294298 """
295299 return self ._blurred_likelihood
296300
@@ -300,7 +304,7 @@ def underexposed_likelihood(self):
300304
301305 :rtype: str
302306 :returns: String representation derived from
303- :class:`gcloud .vision.face.Position`.
307+ :class:`google.cloud .vision.face.Position`.
304308 """
305309 return self ._underexposed_likelihood
306310
@@ -365,7 +369,7 @@ def from_api_repr(cls, response_landmark):
365369 :type response_landmark: dict
366370 :param response_landmark: Landmark representation from Vision API.
367371
368- :rtype: :class:`gcloud .vision.face.Landmark`
372+ :rtype: :class:`google.cloud .vision.face.Landmark`
369373 :returns: Populated instance of `Landmark`.
370374 """
371375 position = Position .from_api_repr (response_landmark ['position' ])
@@ -376,7 +380,7 @@ def from_api_repr(cls, response_landmark):
376380 def position (self ):
377381 """Landmark position on face.
378382
379- :rtype: :class:`gcloud .vision.face.Position`
383+ :rtype: :class:`google.cloud .vision.face.Position`
380384 :returns: Instance of `Position` with landmark coordinates.
381385 """
382386 return self ._position
0 commit comments