|
3 | 3 | [](https://travis-ci.org/robmarkcole/deepstack-python)
|
4 | 4 |
|
5 | 5 | # 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 Jupyter notebooks for usage. |
7 |
| -Run deepstack (CPU, noAVX mode): |
| 6 | +Unofficial python API for [DeepStack](https://python.deepstack.cc/). Provides classes for making requests to the object detection & face detection/recognition endpoints. Also includes some helper functions for processing the results. See the Jupyter notebooks for usage. |
| 7 | + |
| 8 | +Run deepstack with all three endpoints active (CPU, noAVX mode): |
| 9 | +``` |
| 10 | +docker run \ |
| 11 | + -e VISION-SCENE=True \ |
| 12 | + -e VISION-DETECTION=True \ |
| 13 | + -e VISION-FACE=True \ |
| 14 | + -v localstorage:/datastore \ |
| 15 | + -p 5000:5000 \ |
| 16 | + -e API-KEY="" \ |
| 17 | + --name deepstack deepquestai/deepstack:noavx |
| 18 | +``` |
| 19 | +Check deepstack is running using curl (from root of this repo): |
| 20 | +``` |
| 21 | +curl -X POST -F image=@tests/images/test-image3.jpg 'http://localhost:5000/v1/vision/detection' |
8 | 22 | ```
|
9 |
| -docker run -e VISION-DETECTION=True -e VISION-FACE=True -e MODE=High -d \ |
10 |
| - -v localstorage:/datastore -p 5000:5000 \ |
11 |
| - -e API-KEY="Mysecretkey" \ |
12 |
| - --name deepstack deepquestai/deepstack:noavx |
| 23 | +If all goes well you should see the following returned: |
| 24 | +``` |
| 25 | +{"success":true,"predictions":[{"confidence":0.9998661,"label":"person","y_min":0,"x_min":258,"y_max":676,"x_max":485},{"confidence":0.9996547,"label":"person","y_min":0,"x_min":405,"y_max":652,"x_max":639},{"confidence":0.99745613,"label":"dog","y_min":311,"x_min":624,"y_max":591,"x_max":825}]} |
13 | 26 | ```
|
14 | 27 |
|
15 | 28 | ## Development
|
16 |
| -* Use `venv` -> `source venv/bin/activate` |
17 |
| -* `pip install -r requirements-dev.txt` |
| 29 | +* Create venv -> `python3.7 -m venv venv` |
| 30 | +* Use venv -> `source venv/bin/activate` |
| 31 | +* `pip3 install -r requirements.txt` and `pip3 install -r requirements-dev.txt` |
18 | 32 | * Run tests with `venv/bin/pytest tests/*`
|
19 | 33 | * Black format with `venv/bin/black deepstack/core.py` and `venv/bin/black tests/test_deepstack.py`
|
| 34 | + |
| 35 | +## Jupyter |
| 36 | +* Docs are created using Jupyter notebooks |
| 37 | +* Install in venv with -> `pip3 install jupyterlab` |
| 38 | +* Run -> `venv/bin/jupyter lab` |
| 39 | + |
| 40 | +## Deployment to pypi |
| 41 | +* Generate requirements with -> `pip3 freeze > requirements.txt` |
| 42 | +* Create a distribution with -> `python3 setup.py sdist` (creates dist) |
| 43 | +* Upload packages with twine with -> `twine upload dist/*` |
0 commit comments