Skip to content

Commit 2238202

Browse files
committed
Update usage-object-detection.ipynb
1 parent b569a02 commit 2238202

File tree

1 file changed

+16
-45
lines changed

1 file changed

+16
-45
lines changed

usage-object-detection.ipynb

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@
8888
"name": "stdout",
8989
"output_type": "stream",
9090
"text": [
91-
"<Response [200]>\n",
92-
"CPU times: user 7.06 ms, sys: 3.84 ms, total: 10.9 ms\n",
93-
"Wall time: 367 ms\n"
91+
"CPU times: user 8.26 ms, sys: 4.79 ms, total: 13 ms\n",
92+
"Wall time: 701 ms\n"
9493
]
9594
}
9695
],
@@ -299,7 +298,7 @@
299298
"## Custom model\n",
300299
"I have mounted a custom model, run with:\n",
301300
"```\n",
302-
"docker run -v /Users/robin/Data/pytorch-models:/modelstore/detection -p 80:5000 deepquestai/deepstack:cpu-x6-beta\n",
301+
"docker run -v /Users/robin/Data/pytorch-models:/modelstore/detection -p 80:5000 deepquestai/deepstack:latest\n",
303302
"```"
304303
]
305304
},
@@ -320,7 +319,7 @@
320319
{
321320
"data": {
322321
"text/plain": [
323-
"<deepstack.core.DeepstackObject at 0x7fca7b874c50>"
322+
"<deepstack.core.DeepstackObject at 0x7fd5060369e8>"
324323
]
325324
},
326325
"execution_count": 13,
@@ -358,17 +357,15 @@
358357
},
359358
{
360359
"cell_type": "code",
361-
"execution_count": 15,
360+
"execution_count": 17,
362361
"metadata": {},
363362
"outputs": [
364363
{
365364
"name": "stdout",
366365
"output_type": "stream",
367366
"text": [
368-
"<Response [404]>\n",
369-
"Error from request, status code: 404\n",
370-
"CPU times: user 4.66 ms, sys: 2.03 ms, total: 6.69 ms\n",
371-
"Wall time: 22.5 ms\n"
367+
"CPU times: user 5 ms, sys: 2.83 ms, total: 7.83 ms\n",
368+
"Wall time: 548 ms\n"
372369
]
373370
}
374371
],
@@ -383,53 +380,27 @@
383380
},
384381
{
385382
"cell_type": "code",
386-
"execution_count": 16,
387-
"metadata": {},
388-
"outputs": [
389-
{
390-
"ename": "TypeError",
391-
"evalue": "'NoneType' object is not subscriptable",
392-
"output_type": "error",
393-
"traceback": [
394-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
395-
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
396-
"\u001b[0;32m<ipython-input-16-9840dd4da3cd>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmask_model\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpredictions\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
397-
"\u001b[0;32m~/Github/deepstack-python/deepstack/core.py\u001b[0m in \u001b[0;36mpredictions\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 153\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mpredictions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 154\u001b[0m \u001b[0;34m\"\"\"Return the predictions.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 155\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_response\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m\"predictions\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 156\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 157\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
398-
"\u001b[0;31mTypeError\u001b[0m: 'NoneType' object is not subscriptable"
399-
]
400-
}
401-
],
402-
"source": [
403-
"mask_model.predictions"
404-
]
405-
},
406-
{
407-
"cell_type": "code",
408-
"execution_count": null,
409-
"metadata": {},
410-
"outputs": [],
411-
"source": [
412-
"mask_model._response"
413-
]
414-
},
415-
{
416-
"cell_type": "code",
417-
"execution_count": 17,
383+
"execution_count": 18,
418384
"metadata": {},
419385
"outputs": [
420386
{
421387
"data": {
422388
"text/plain": [
423-
"'http://localhost:80/v1/vision/custom/mask'"
389+
"[{'confidence': 0.94608647,\n",
390+
" 'label': 'mask',\n",
391+
" 'y_min': 111,\n",
392+
" 'x_min': 248,\n",
393+
" 'y_max': 177,\n",
394+
" 'x_max': 332}]"
424395
]
425396
},
426-
"execution_count": 17,
397+
"execution_count": 18,
427398
"metadata": {},
428399
"output_type": "execute_result"
429400
}
430401
],
431402
"source": [
432-
"mask_model._url_detect"
403+
"mask_model.predictions"
433404
]
434405
},
435406
{

0 commit comments

Comments
 (0)