Skip to content

Commit d329fb2

Browse files
committed
Adds face class
1 parent 63f224f commit d329fb2

File tree

6 files changed

+218
-7
lines changed

6 files changed

+218
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![build status](http://img.shields.io/travis/robmarkcole/deepstack-python/master.svg?style=flat)](https://travis-ci.org/robmarkcole/deepstack-python)
44

55
# deepstack-python
6-
Unofficial python API for [DeepStack](https://python.deepstack.cc/). Provides class for making requests to the object detection endpoint, and functions for processing the result. See the `usage.ipynb` notebook for usage.
6+
Unofficial python API for [DeepStack](https://python.deepstack.cc/). Provides class for making requests to the object detection endpoint, and functions for processing the result. See the Jupyter notebooks for usage.
77

88
## Services
99
Face and object detection endpoints return bounding boxes of faces and objects respectively.

deepstack/core.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,17 @@ def __init__(
131131
super().__init__(
132132
ip_address, port, api_key, timeout, url_detection=URL_OBJECT_DETECTION
133133
)
134+
135+
class DeepstackFace(Deepstack):
136+
"""Work with objects"""
137+
138+
def __init__(
139+
self,
140+
ip_address: str,
141+
port: str,
142+
api_key: str = "",
143+
timeout: int = DEFAULT_TIMEOUT,
144+
):
145+
super().__init__(
146+
ip_address, port, api_key, timeout, url_detection=URL_FACE_DETECTION
147+
)

tests/images/couple.jpg

1.29 MB
Loading

tests/images/idris.jpg

205 KB
Loading

usage-face-recognition.ipynb

Lines changed: 194 additions & 0 deletions
Large diffs are not rendered by default.

usage.ipynb renamed to usage-object-detection.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"This package provides convenience classes and functions for working with deepstack object detection API. \n",
8-
"Pull the latest image for noavx:\n",
9-
"```\n",
10-
"docker pull deepquestai/deepstack:noavx\n",
11-
"```\n",
7+
"This package provides convenience classes and functions for working with deepstack object detection API.\n",
128
"\n",
139
"Run deepstack with:\n",
1410
"```\n",
15-
"docker run -e VISION-DETECTION=True -e VISION-FACE=True -e MODE=High -d \\\n",
11+
"docker run -e VISION-DETECTION=True -e MODE=High -d \\\n",
1612
" -v localstorage:/datastore -p 5000:5000 \\\n",
1713
" -e API-KEY=\"Mysecretkey\" \\\n",
1814
" --name deepstack deepquestai/deepstack:noavx\n",
@@ -46,6 +42,13 @@
4642
"TIMEOUT = 8"
4743
]
4844
},
45+
{
46+
"cell_type": "markdown",
47+
"metadata": {},
48+
"source": [
49+
"## Object detection"
50+
]
51+
},
4952
{
5053
"cell_type": "code",
5154
"execution_count": 3,

0 commit comments

Comments
 (0)