robmarkcole / HASS-Deepstack-object

Home Assistant custom component for using Deepstack object detection
https://community.home-assistant.io/t/face-and-person-detection-with-deepstack-local-and-free/92041
MIT License
438 stars 98 forks source link

Example in README.md not working. Unable to find referenced entities #249

Closed Draxter closed 3 years ago

Draxter commented 3 years ago

Versions: Home Assistant: 2021.8.8 hass-deepstack-object: 4.3.1

I have installed HASS-Deepstack-object using HACS in my Home Assistant and followed your example in README.md. Here is my configuration in docker:

  deepstack:
    image: deepquestai/deepstack:latest
    container_name: deepstack
    ports:
      - 5000
    volumes:
      - /home/draxter/homeserver/deepstack:/datastore
    environment:
      - VISION-DETECTION=True
    networks:
      docker_network:
        ipv4_address: 10.0.0.23
    restart: unless-stopped
  homeassistant:
    image: homeassistant/home-assistant:latest
    container_name: homeassistant
    ports:
      - 8123
    volumes:
      - /home/draxter/homeserver/homeassistant/:/config
    restart: unless-stopped
    networks:
      docker_network:
        ipv4_address: 10.0.0.5

configuration.yml:

camera:
  - platform: local_file
    file_path: /media/usb/people.jpg

image_processing:
  - platform: deepstack_object
    ip_address: "10.0.0.23"
    port: 5000
    targets:
      - target: person
      - target: kite
      - target: car
    source:
      - entity_id: camera.local_file

The camera.local_file works fine and shows my image, however the image_processing.deepstack_object_local_file entity looks like this

I have also tried to run image processing as service, but it had no effect:

service: image_processing.scan
target:
  entity_id: camera.local_file

HA does however produce this bizzare error: WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities camera.local_file Which makes no sense, as the entity definitely exists and shows the image when i press the cog icon. I also tried giving the entity a different name, but the result is the same. Deepstack container doesn’t log anything, so no connection is made at this point.

For debugging purposes I tried using your deepstack-ui tool to connect to my deepstack container, like so: docker run -p 8501:8501 -e DEEPSTACK_IP='10.0.0.23' -e DEEPSTACK_PORT=5000 --network homeserver_docker_network robmarkcole/deepstack-ui:latest This worked just fine, and I was able to connect and run through some images

Draxter commented 3 years ago

I figured it out. My service call was wrong, it should have been:

service: image_processing.scan
target:
  entity_id: image_processing.deepstack_object_local_file