Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 98353f1

Browse files
Fixes some stuff
1 parent 01cdd01 commit 98353f1

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

openrobot/api_wrapper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
from . import _async, _sync, translate, results, error, speech
99

10-
__version__ = '0.3.0.2'
10+
__version__ = '0.3.0.3'

openrobot/api_wrapper/_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ async def celebrity(self, url: str) -> typing.List[CelebrityResult]:
267267
"""
268268

269269
js = await self._request('GET', '/api/celebrity', params={'url': url})
270-
return [CelebrityResult(data) for data in js]
270+
return [CelebrityResult(data) for data in js['detectedFaces']]
271271

272272
async def ocr(self, source: typing.Union[str, io.BytesIO]) -> OCRResult:
273273
"""|coro|

openrobot/api_wrapper/_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def celebrity(self, url: str) -> typing.List[CelebrityResult]:
215215
"""
216216

217217
js = self._request('GET', '/api/celebrity', params={'url': url})
218-
return [CelebrityResult(data) for data in js]
218+
return [CelebrityResult(data) for data in js['detectedFaces']]
219219

220220
def ocr(self, source: typing.Union[str, io.BytesIO]) -> OCRResult:
221221
"""

openrobot/api_wrapper/results.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ class CelebrityFaceQuality:
183183

184184
def __init__(self, js):
185185
self.brightness: typing.Union[int, float] = js['Brightess']
186-
self.sharpnes: typing.Union[int, float] = js['Sharpness']
186+
self.sharpness: typing.Union[int, float] = js['Sharpness']
187187

188188
class CelebrityFaceEmotion:
189189
"""
@@ -237,7 +237,7 @@ class CelebrityFaceProperty:
237237
The pose of the celebrity.
238238
quality: :class:`CelebrityFaceQuality`
239239
The quality of the face
240-
emotion: List[:class:`CelebrityFaceEmotion`]
240+
emotions: List[:class:`CelebrityFaceEmotion`]
241241
The emotions of the face.
242242
smile: :class:`CelebrityFaceSmile`
243243
Represents the smile that the celebrity is having.
@@ -249,7 +249,7 @@ def __init__(self, js):
249249
self.landmarks: typing.List[CelebrityFaceLandmarksProperty] = [CelebrityFaceLandmarksProperty(landmark) for landmark in js['Landmarks']]
250250
self.pose: CelebrityFacePose = CelebrityFacePose(js['Pose'])
251251
self.quality: CelebrityFaceQuality = CelebrityFaceQuality(js['Quality'])
252-
self.emotion: typing.List[CelebrityFaceEmotion] = [CelebrityFaceEmotion(emotion) for emotion in sorted(js['Emotions'], key=lambda d: d['Confidence'])]
252+
self.emotions: typing.List[CelebrityFaceEmotion] = [CelebrityFaceEmotion(emotion) for emotion in sorted(js['Emotions'], key=lambda d: d['Confidence'])]
253253
self.smile: CelebrityFaceSmile = CelebrityFaceSmile(js['Smile'])
254254

255255
class CelebrityResult(OpenRobotAPIBaseResult):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "OpenRobot-API-Wrapper"
3-
version = "0.3.0.2"
3+
version = "0.3.0.3"
44
description = "A API Wrapper for the official OpenRobot API (https://api.openrobot.xyz)."
55
authors = ["OpenRobot Packages <openrobot@openrobot.xyz>", "proguy914629 <proguy914629@openrobot.xyz>"]
66
license = "MIT"

0 commit comments

Comments
 (0)