snowzach / doods

DOODS - Dedicated Open Object Detection Service
MIT License
304 stars 31 forks source link

Issues with saving output files #13

Closed wordblind closed 4 years ago

wordblind commented 4 years ago

So I have everything up and running, and it seams to work great, except when it comes to saving files.

Log output

`2020-01-03 13:43:50 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.doods_door fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 177, in async_update await self.async_process_image(image.content) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 375, in process_image self._save_image(image, matches, paths) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 273, in _save_image img.save(path) File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2081, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/hass/.homeassistant/image/door_latest.jpg' 2020-01-03 13:43:53 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:43:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.doods_door fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 177, in async_update await self.async_process_image(image.content) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, *self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 375, in process_image self._save_image(image, matches, paths) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 273, in _save_image img.save(path) File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2081, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/hass/.homeassistant/image/door_latest.jpg' 2020-01-03 13:43:56 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:43:57 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:00 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:03 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:07 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:10 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.doods_driveway fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 177, in async_update await self.async_process_image(image.content) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(self.args, self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 375, in process_image self._save_image(image, matches, paths) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 273, in _save_image img.save(path) File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2081, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/hass/.homeassistant/image/driveway_latest.jpg' 2020-01-03 13:44:11 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:14 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:15 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.doods_garden_2 fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 177, in async_update await self.async_process_image(image.content) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, *self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 375, in process_image self._save_image(image, matches, paths) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 273, in _save_image img.save(path) File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2081, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/hass/.homeassistant/image/garden_latest.jpg' 2020-01-03 13:44:19 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:22 WARNING (MainThread) [homeassistant.components.image_processing] Updating doods image_processing took longer than the scheduled update interval 0:00:01 2020-01-03 13:44:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for image_processing.doods_garden_2 fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 448, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/image_processing/init.py", line 177, in async_update await self.async_process_image(image.content) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 375, in process_image self._save_image(image, matches, paths) File "/usr/src/homeassistant/homeassistant/components/doods/image_processing.py", line 273, in _save_image img.save(path) File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2081, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/home/hass/.homeassistant/image/garden_latest.jpg'

Folder permission /home/hass/.homeasssistant/image drwxr-xr-x 2 hass hass 4.0K Jan 3 13:38 image

Folder permission /tmp/ drwxr-xr-x 2 hass hass 4.0K Jan 3 12:53 tmp

Config (i have the same but with /tmp/ as dir)

`image_processing:

wordblind commented 4 years ago

Turns out I'm not to smart! But for anyone ells that runs in to this issue, it's due to Dockers files system, so just create a folder in your Home Assistant config folder like mkdir /home/hass/homeassistant/images and in the config it will be named /config/images