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
434 stars 97 forks source link

The image processing stops working without any reason #239

Closed CarpeDiemRo closed 3 years ago

CarpeDiemRo commented 3 years ago

Environment

  1. RPI 4B, 8GB
  2. NCS2
  3. HA core-2021.3.4
  4. HA installed in Docker, Deepstack installed in Docker
  5. Six analogic cameras 1920x1080

Automation

  1. Trigger when movement and /2 seconds during movement = true

Actual results

  1. Unknown status is displayed instead of the value
  2. All the camera image_processing.xxx.yyy fails and shows Unknown status

What I tried

  1. Trigger manually all the cameras
  2. No effect
  3. sudo reboot -> the service is running again.

OBS I am unable to reproduce manually and I didn't identify a root cause Unfortunately, I lost the logs, but as far as I remember showed something related to prediction

robmarkcole commented 3 years ago

This is an issue on the deepstack side, please report there, although without logs this is a dead end for a maintainer

CarpeDiemRo commented 3 years ago

Here are the logs

Logger: homeassistant.helpers.entity
Source: custom_components/deepstack_object/image_processing.py:350
First occurred: 12:40:22 PM (4781 occurrences)
Last logged: 3:31:45 PM

Update for image_processing.anna_persoane_camera_3 fails
Update for image_processing.anna_persoane_camera_5 fails
Update for image_processing.anna_persoane_camera_6 fails
Update for image_processing.anna_persoane_camera_1 fails
Update for image_processing.anna_persoane_camera_2 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 277, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 473, in async_device_update
    raise exc
  File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 137, in async_update
    await self.async_process_image(image.content)
  File "/usr/src/homeassistant/homeassistant/components/image_processing/__init__.py", line 117, 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'
CarpeDiemRo commented 3 years ago

Related https://github.com/robmarkcole/HASS-Deepstack-object/issues/240