robmarkcole / deepstack-python

Unofficial python API for DeepStack
https://deepstack.cc/
GNU General Public License v3.0
12 stars 11 forks source link

KeyError: 'predictions' #38

Open robmarkcole opened 3 years ago

robmarkcole commented 3 years ago

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

maumi commented 1 year ago

Any change that this could be fixed? I have a camera (esp32-cam) which nearly almost triggers this issue.

If you need more input or tests, just tell me. (It is no failure with python 3.11 because it was also raised with 3.10)

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.helpers.entity Source: custom_components/deepstack_object/image_processing.py:369 Integration: deepstack_object (documentation) First occurred: 15:18:02 (1 occurrences) Last logged: 15:18:02

Update for image_processing.deepstack_object_192_168_1_86 fails Traceback (most recent call last): File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 541, in async_update_ha_state await self.async_device_update() File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/helpers/entity.py", line 739, in async_device_update raise exc File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/image_processing/init.py", line 193, in async_update await self.async_process_image(image.content) File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/components/image_processing/init.py", line 174, in async_process_image return await self.hass.async_add_executor_job(self.process_image, image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.pyenv/versions/3.11.1/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.homeassistant/custom_components/deepstack_object/image_processing.py", line 369, in process_image predictions = self._dsobject.detect(image) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/srv/homeassistant/lib/python3.11/site-packages/deepstack/core.py", line 204, in detect return response["predictions"]


KeyError: 'predictions'
robmarkcole commented 1 year ago

I've no time but invite a PR. Thanks