Go to file
MaleNurse 6ba72afc3a
Update Dockerfile
2021-03-01 09:23:23 -08:00
.github/workflows Update docker-image-deploy.yml 2021-01-21 03:57:32 +00:00
app add debug mode 2021-01-21 04:28:58 +00:00
.gitignore add utils and const 2020-06-06 09:09:00 +01:00
Dockerfile Update Dockerfile 2021-03-01 09:23:23 -08:00
Dockerfile.arm64 Update Dockerfile.arm64 2021-03-01 07:12:10 -08:00
LICENSE Initial commit 2019-09-17 05:26:27 +01:00
README.md Update README.md 2021-03-01 07:08:39 -08:00
docker-compose.yml fix compose 2021-01-26 19:38:52 +00:00
requirements.txt Update requirements.txt 2020-12-18 14:17:22 +00:00
usage.png Update usage.png 2020-11-01 10:37:12 +00:00

README.md

deepstack-ui

UI for working with Deepstack. Allows uploading an image and performing object detection or face recognition with Deepstack. Also faces can be registered with Deepstack. The effect of various parameters can be explored, including filtering objects by confidence, type and location in the image.

Run deepstack

Run deepstack object detection:

docker run -e VISION-DETECTION=True -p 80:5000 deepquestai/deepstack:latest

You will need the ip address of the machine running deepstack, which in my case is 192.168.1.133.

Run deepstack-ui with Docker

The deepstack-ui is designed to be run in a docker container. The UI picks up the information about your deepstack instance from environment variables which are passed into the container using the -e VARIABLE=value approach. All environment variables that can be passed are listed below:

- DEEPSTACK_IP : the IP address of your deepstack instance, default "localhost"
- DEEPSTACK_PORT : the PORT of your deepstack instance, default 80
- DEEPSTACK_API_KEY : the API key of your deepstack instance, if you have set one
- DEEPSTACK_TIMEOUT : the timeout to wait for deepstack, default 30 seconds
- DEEPSTACK_CUSTOM_MODEL : the name of a custom model, if you wish to use one
- DEEPSTACK_UI_DEBUG_MODE : options `True` or `False` (default). Lowers the minimum confidence threshold to 1%

From the root dir, either build the deepstack-ui container from source or pull from Docker Hub: and

For x86-64 architecture

    docker build -t deepstack-ui . -f Dockerfile
    OR
    docker pull robmarkcole/deepstack-ui:latest

Or for arm64 architecture (e.g. Raspberry Pi, Apple M1 chips)

    docker build -t deepstack-ui . -f Dockerfile.arm64
    OR
    docker pull robmarkcole/deepstack-ui:arm64

Then run the UI, passing the DEEPSTACK_IP environment variable:

docker run -p 8501:8501 -e DEEPSTACK_IP='192.168.1.133' deepstack-ui

The UI is now viewable at http://localhost:8501 (not whatever ip address is shown in the logs, this is the internal docker ip)

Alternatively if you are running deepstack with non default parameters, an example would be:

docker run -p 8501:8501 \
-e DEEPSTACK_IP='192.168.1.133' \
-e DEEPSTACK_PORT=80 \
-e DEEPSTACK_TIMEOUT=20 \
-e DEEPSTACK_CUSTOM_MODEL=mask \
deepstack-ui

Docker-compose

An example docker-compose file is provided. For run commands see here but the main one you need is docker-compose up.

FAQ

Q1: I get the error: TypeError: cannot unpack non-iterable DeepstackException object

A1: You probably didn't pass the required environment variables (DEEPSTACK_IP etc.)


Development

  • Create and activate a venv: python3 -m venv venv and source venv/bin/activate
  • Install requirements: pip3 install -r requirements.txt
  • Export required environment variables: export DEEPSTACK_CUSTOM_MODEL='mask'
  • Run streamlit from app folder: streamlit run deepstack-ui.py