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
439 stars 98 forks source link

KeyError on Face_Detection #5

Closed fluffykraken closed 5 years ago

fluffykraken commented 5 years ago

Using v0.4 i get the following error:

[homeassistant.helpers.entity] Update for image_processing.face_counter fails
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 347, in async_device_update
    await self.async_update()
  File "/usr/src/app/homeassistant/components/image_processing/__init__.py", line 138, in async_update
    await self.async_process_image(image.content)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/image_processing/deepstack_face.py", line 167, in process_image
    predictions_json = response.json()["predictions"]
KeyError: 'predictions'

I'm running HA 85.1

My Config:
  - platform: deepstack_face
    ip_address: my_ip
    port: 5000
    scan_interval: 30
    source:
      - entity_id: camera.local_file
        name: face_counter
robmarkcole commented 5 years ago

I need to be able to reproduce this. To rule out that it is to do with your setup could you setup a local_file camera with the adele_test.jpg image from the development folder, and try processing that with the component?

fluffykraken commented 5 years ago

Same error on the adele_test.jpg.


ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.face_counter fails
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/app/homeassistant/helpers/entity.py", line 347, in async_device_update
    await self.async_update()
  File "/usr/src/app/homeassistant/components/image_processing/__init__.py", line 138, in async_update
    await self.async_process_image(image.content)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/image_processing/deepstack_face.py", line 167, in process_image
    predictions_json = response.json()["predictions"]
KeyError: 'predictions'
robmarkcole commented 5 years ago

Well that will return predictions, so I think it must be an issue with your setup, perhaps port is not accessible?

fluffykraken commented 5 years ago

Do you mean the port on HA side or the Deepstack port? The deepstack container seems to get the image.. image

robmarkcole commented 5 years ago

Deepstack side. Can you confirm you had an earlier release (< 0.4) working?

Well I'm not sure how to reproduce your error. Are you happy to try using python to make a query to the server by following these instructions?

fluffykraken commented 5 years ago

No, never had a working version before. The object_detection is not working as well so there is something wrong. Will check the link and report back.....

fluffykraken commented 5 years ago

I can confirm it is my setup. Same error when using the code from your link.... Thanks for your help!

bsmeding commented 5 years ago

Same issue here, the object module works ok but face module give this error

itiberiu commented 1 year ago

image I'm trying to create an automation in hassio using the deeptrack integration and I can't pass this condition. I guess it's a syntax problem but I can't figure it out. In the attributes of the entity, the name is written the same. faces:

ty