Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from robmarkcole/add-docker-env-var
Browse files Browse the repository at this point in the history
adds vars
  • Loading branch information
robmarkcole authored Jun 7, 2020
2 parents f90259c + 68c04d4 commit 1de7b30
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ UI for working with [Deepstack](https://python.deepstack.cc/). Allows uploading
Run deepstack object detection:

```
docker run -e VISION-DETECTION=True \
docker run \
-e VISION-DETECTION=True \
-v localstorage:/datastore \
-p 5000:5000 \
-e API-KEY="" \
Expand All @@ -30,5 +31,21 @@ Alternatively run the [pre-built](https://hub.docker.com/repository/docker/robma
```
docker run -p 8501:8501 -e DEEPSTACK_IP='192.168.1.133' robmarkcole/deepstack-ui:latest`
```
Or 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='5000' \
-e DEEPSTACK_API_KEY='my_key' \
-e DEEPSTACK_TIMEOUT='20' \
robmarkcole/deepstack-ui:latest`
```

Then visit [localhost:8501](http://localhost:8501/) (not whatever ip address is shown in the logs, this is the internal docker ip)

### 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.)

Then visit [localhost:8501](http://localhost:8501/) (not whatever ip address is shown in the logs, this is the internal docker ip)
------
6 changes: 3 additions & 3 deletions app/streamlit-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

## Depstack setup
DEEPSTACK_IP = os.getenv("DEEPSTACK_IP", "set-your-deepstack-ip")
DEEPSTACK_PORT = "5000"
DEEPSTACK_API_KEY = ""
DEEPSTACK_TIMEOUT = 20 # Default is 10
DEEPSTACK_PORT = os.getenv("DEEPSTACK_PORT", "5000")
DEEPSTACK_API_KEY = os.getenv("DEEPSTACK_API_KEY", "")
DEEPSTACK_TIMEOUT = os.getenv("DEEPSTACK_TIMEOUT", "10")

DEFAULT_CONFIDENCE_THRESHOLD = 80
TEST_IMAGE = "street.jpg"
Expand Down

0 comments on commit 1de7b30

Please sign in to comment.