robmarkcole/HASS-Deepstack-object

KeyError: 'predictions'

ruangdet-p opened this issue · 7 comments

configuration.yaml

image_processing:

  • platform: deepstack_object
    ip_address: 192.168.10.13
    port: 5000
    save_file_folder: /config/www/snapshot/
    scan_interval: 5
    save_file_format: jpg
    save_timestamped_file: false
    always_save_latest_file: true
    scale: 0.75

    roi_x_min: 0.35

    roi_x_max: 0.8
    #roi_y_min: 0.4
    roi_y_max: 0.8
    targets:
    • target: person
    • target: car
      source:
    • entity_id: camera.livingroom_camera
      name: LivingRoom Person Detector

error log

This error originated from a custom integration.

Logger: homeassistant.helpers.entity
Source: custom_components/deepstack_object/image_processing.py:350
Integration: deepstack_object (documentation)
First occurred: 9:57:35 AM (1 occurrences)
Last logged: 9:57:35 AM

Update for image_processing.livingroom_person_detector fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 316, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 524, in async_device_update
raise exc
File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 138, in async_update
await self.async_process_image(image.content)
File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 118, in async_process_image
return await self.hass.async_add_executor_job(self.process_image, image)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/deepstack_object/image_processing.py", line 350, in process_image
predictions = self._dsobject.detect(image)
File "/usr/local/lib/python3.8/site-packages/deepstack/core.py", line 204, in detect
return response["predictions"]
KeyError: 'predictions'

How do I fix it?

Thank you

Same error here:

Logger: homeassistant.helpers.entity
Source: custom_components/deepstack_object/image_processing.py:350
Integration: deepstack_object (documentation)
First occurred: 11:22:09 AM (1 occurrences)
Last logged: 11:22:09 AM

Update for image_processing.anna_persoane_camera_3 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 558, in async_device_update
raise exc
File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 138, in async_update
await self.async_process_image(image.content)
File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 118, in async_process_image
return await self.hass.async_add_executor_job(self.process_image, image)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/deepstack_object/image_processing.py", line 350, in process_image
predictions = self._dsobject.detect(image)
File "/usr/local/lib/python3.8/site-packages/deepstack/core.py", line 204, in detect
return response["predictions"]
KeyError: 'predictions'

Enviroment:

  • deepstack object custom integration - 4.3.0

  • Core
    Version
    core-2021.6.3
    Newest Version
    core-2021.6.3

  • Supervisor
    Version
    supervisor-2021.05.4
    Newest Version
    supervisor-2021.05.4

YAML:

  • platform: deepstack_object
    ip_address: localhost
    port: 80
    api_key: ##########################################
    save_file_folder: /config/www/deepstack/
    always_save_latest_file: true
    save_timestamped_file: false
    roi_x_min: 0.6 # optional, range 0-1, must be less than roi_x_max
    roi_x_max: 0.95 # optional, range 0-1, must be more than roi_x_min
    roi_y_min: 0.04 # optional, range 0-1, must be less than roi_y_max
    roi_y_max: 1 # optional, range 0-1, must be more than roi_y_min
    targets:
    • target: person
      confidence: 81
      source:
    • entity_id: camera.camera_3_mainstream
      name: Anna Persoane Camera 3

Is there a fix for this kind of error?

Thank you!

strange, what version of deepstack?

i am getting the same error:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 401, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 609, in async_device_update raise exc File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 138, in async_update await self.async_process_image(image.content) File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 118, in async_process_image return await self.hass.async_add_executor_job(self.process_image, image) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/deepstack_object/image_processing.py", line 350, in process_image predictions = self._dsobject.detect(image) File "/usr/local/lib/python3.9/site-packages/deepstack/core.py", line 204, in detect return response["predictions"] KeyError: 'prediction

using deepstack on rapsberry pi3 with inte NCS2.

strange, what version of deepstack?

@ovimano Can you please specify the Deepstack version?

strange, what version of deepstack?

@ovimano Can you please specify the Deepstack version?

Yeap.
Deepstack v1.0

I am starting to see the same since 15th Dec. I've not changed anything except update HA and the Deepstack-object integration and it's suddently stopped working

2021-12-22 23:15:05 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.deepstack_doorcam fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 487, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 691, in async_device_update raise exc File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 138, in async_update await self.async_process_image(image.content) File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 118, in async_process_image return await self.hass.async_add_executor_job(self.process_image, image) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/deepstack_object/image_processing.py", line 347, in process_image predictions = self._dsobject.detect(image) File "/usr/local/lib/python3.9/site-packages/deepstack/core.py", line 204, in detect return response["predictions"] KeyError: 'predictions'

Turns out my deepstack API key had expired. Deepstack all updated now :)