Skip to content

Commit 48d3519

Browse files
committed
Update scene
1 parent d2f6c7c commit 48d3519

File tree

4 files changed

+37
-58
lines changed

4 files changed

+37
-58
lines changed

deepstack/core.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
URL_FACE_DETECTION = "/face"
2323
URL_FACE_REGISTER = "/face/register"
2424
URL_FACE_RECOGNIZE = "/face/recognize"
25-
URL_SCENE_DETECTION = "/scene"
25+
URL_SCENE_RECOGNIZE = "/scene"
2626

2727

2828
class DeepstackException(Exception):
@@ -215,17 +215,18 @@ def __init__(
215215
port=port,
216216
api_key=api_key,
217217
timeout=timeout,
218-
url_detect=URL_SCENE_DETECTION,
218+
url_recognize=URL_SCENE_RECOGNIZE,
219219
)
220220

221-
def detect(self, image_bytes: bytes):
221+
def recognize(self, image_bytes: bytes):
222222
"""Process image_bytes and detect."""
223223
response = process_image(
224-
url=self._url_detect,
224+
url=self._url_recognize,
225225
image_bytes=image_bytes,
226226
api_key=self._api_key,
227227
timeout=self._timeout,
228228
)
229+
del response["success"]
229230
return response
230231

231232

usage-face-recognition.ipynb

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,6 @@
5353
"dsface = ds.DeepstackFace(IP, PORT, API_KEY, TIMEOUT)"
5454
]
5555
},
56-
{
57-
"cell_type": "code",
58-
"execution_count": 4,
59-
"metadata": {},
60-
"outputs": [
61-
{
62-
"data": {
63-
"text/plain": [
64-
"'http://localhost:80/v1/vision'"
65-
]
66-
},
67-
"execution_count": 4,
68-
"metadata": {},
69-
"output_type": "execute_result"
70-
}
71-
],
72-
"source": [
73-
"dsface._url_base"
74-
]
75-
},
7656
{
7757
"cell_type": "code",
7858
"execution_count": 5,
@@ -114,8 +94,8 @@
11494
"name": "stdout",
11595
"output_type": "stream",
11696
"text": [
117-
"CPU times: user 11.9 ms, sys: 11.7 ms, total: 23.6 ms\n",
118-
"Wall time: 755 ms\n"
97+
"CPU times: user 11.7 ms, sys: 10.4 ms, total: 22.1 ms\n",
98+
"Wall time: 793 ms\n"
11999
]
120100
}
121101
],
@@ -187,16 +167,16 @@
187167
},
188168
{
189169
"cell_type": "code",
190-
"execution_count": 13,
170+
"execution_count": 9,
191171
"metadata": {},
192172
"outputs": [
193173
{
194174
"name": "stdout",
195175
"output_type": "stream",
196176
"text": [
197177
"face updated\n",
198-
"CPU times: user 5.13 ms, sys: 2.73 ms, total: 7.86 ms\n",
199-
"Wall time: 537 ms\n"
178+
"CPU times: user 6.61 ms, sys: 4.41 ms, total: 11 ms\n",
179+
"Wall time: 703 ms\n"
200180
]
201181
}
202182
],
@@ -227,8 +207,8 @@
227207
"name": "stdout",
228208
"output_type": "stream",
229209
"text": [
230-
"CPU times: user 3.93 ms, sys: 2.59 ms, total: 6.52 ms\n",
231-
"Wall time: 1.25 s\n"
210+
"CPU times: user 4.9 ms, sys: 3 ms, total: 7.91 ms\n",
211+
"Wall time: 1.56 s\n"
232212
]
233213
}
234214
],
@@ -284,7 +264,7 @@
284264
},
285265
{
286266
"cell_type": "code",
287-
"execution_count": 15,
267+
"execution_count": 12,
288268
"metadata": {},
289269
"outputs": [
290270
{
@@ -293,7 +273,7 @@
293273
"{'Idris Elba': 73.3}"
294274
]
295275
},
296-
"execution_count": 15,
276+
"execution_count": 12,
297277
"metadata": {},
298278
"output_type": "execute_result"
299279
}

usage-object-detection.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@
9393
"name": "stdout",
9494
"output_type": "stream",
9595
"text": [
96-
"CPU times: user 7.69 ms, sys: 4.41 ms, total: 12.1 ms\n",
97-
"Wall time: 2.44 s\n"
96+
"CPU times: user 7.74 ms, sys: 3.7 ms, total: 11.4 ms\n",
97+
"Wall time: 411 ms\n"
9898
]
9999
}
100100
],
@@ -316,8 +316,8 @@
316316
"name": "stdout",
317317
"output_type": "stream",
318318
"text": [
319-
"CPU times: user 5.27 ms, sys: 2.31 ms, total: 7.58 ms\n",
320-
"Wall time: 785 ms\n"
319+
"CPU times: user 3.92 ms, sys: 2.3 ms, total: 6.22 ms\n",
320+
"Wall time: 228 ms\n"
321321
]
322322
}
323323
],

usage-scene-detection.ipynb

Lines changed: 19 additions & 21 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)