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

Custom Model Usage? How? #70

Closed
Protheus23 opened this issue Jan 27, 2022 · 2 comments
Closed

Custom Model Usage? How? #70

Protheus23 opened this issue Jan 27, 2022 · 2 comments

Comments

@Protheus23
Copy link

Hi,

every time i want to use custom models i get the following error on the web page:

File "/usr/local/lib/python3.8/site-packages/streamlit/script_runner.py", line 332, in _run_script
    exec(code, module.__dict__)
File "/app/deepstack-ui.py", line 205, in <module>
    predictions = process_image_object(pil_image, dsobject)
File "/usr/local/lib/python3.8/site-packages/streamlit/caching.py", line 604, in wrapped_func
    return get_or_create_cached_value()
File "/usr/local/lib/python3.8/site-packages/streamlit/caching.py", line 588, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
File "/app/deepstack-ui.py", line 50, in process_image_object
    predictions = dsobject.detect(image_bytes)
File "/usr/local/lib/python3.8/site-packages/deepstack/core.py", line 197, in detect
    response = process_image(
File "/usr/local/lib/python3.8/site-packages/deepstack/core.py", line 128, in process_image
    raise DeepstackException(f"Bad url supplied, url {url} raised error {BAD_URL}")

Since the default Deepstack Docker didn't recognize a full size cat 2m away from cam i wanted to try custom models.
But with that deepstack didn't recognized anything/animal/person/car or whatever.

So i wanted to try the custom models from here https://github.com/MikeLud/DeepStack-Security-Camera-Models/tree/main/Models with a picture.

This is my docker compose for deepstack_ui

deepstack_ui:
    container_name: deepstack_ui
    restart: unless-stopped
    image: robmarkcole/deepstack-ui
    ports:
      - '8501:8501'
    environment: 
      - DEEPSTACK_IP=10.10.80.3
      - DEEPSTACK_PORT=82
      - DEEPSTACK_CUSTOM_MODEL=cat
      - DEEPSTACK_UI_DEBUG_MODE=False

I added the custom models into deepstack and i can see them if i get into the container in /modelstore/detection
They are in the following format

animal.pt  
combined.pt  
dark.pt  
general.pt  
licence-plate.pt  
openlogo.pt

Do i write
- DEEPSTACK_CUSTOM_MODEL=cat
or
- DEEPSTACK_CUSTOM_MODEL=animal.pt

If i fully remove the DEEPSTACK_CUSTOM_MODEL line everything is working.
Please help.

Greetings

@robmarkcole
Copy link
Owner

Looks like you aren't running the model on deepstack, or the URL would be live and the error different

@robmarkcole
Copy link
Owner

stale

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants