Go to file
Robin Cole fb4c820c06 set min confidence low 2020-12-18 15:10:52 +00:00
app set min confidence low 2020-12-18 15:10:52 +00:00
.gitignore add utils and const 2020-06-06 09:09:00 +01:00
Dockerfile rename app and bump dependencies 2020-12-16 08:18:59 +00:00
LICENSE Initial commit 2019-09-17 05:26:27 +01:00
README.md support custom models 2020-12-16 08:59:26 +00:00
docker-compose.yml support custom models 2020-12-16 08:59:26 +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 with Deepstack. The effect of various parameters can be explored, including filtering the classes of object detected, filtering by minimum confidence (%), and spatial filtering using a region of interest (ROI).

Run deepstack

Run deepstack object detection:

docker run -e VISION-DETECTION=True -p 5000:5000 -e API-KEY="" -e MODE=High deepquestai/deepstack:latest

You will need the ip address of the machine running deepstack, which is passed to the Streamlit app using an environment variable.

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 10 seconds
- DEEPSTACK_CUSTOM_MODEL : the name of a custom model, if you wish to use one

From the root dir, build the deepstack-ui container from source and then run the UI, passing the DEEPSTACK_IP environment variable:

    docker build -t deepstack-ui .
    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

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