Face Detect: command_line sensor timeout

I’m trying to get face detection to work using dlib face detect combining it with a camera entity which stores only a jpg of the last movement recorded. I think it already works, because I can see state changes in the logbook (but I have not enough data yet to be sure yet).

The reason why i opened this topic is that I have those error messages in the logfile since activating the image_processing component:

2019-12-12 10:59:27 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:01
2019-12-12 10:59:38 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:01
2019-12-12 10:59:49 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:01
2019-12-12 11:00:00 WARNING (MainThread) [homeassistant.components.sensor] Updating command_line sensor took longer than the scheduled update interval 0:00:01

As you can see those events occur ~11 seconds. As all of my command line sensors are working this event must be triggered by the image_processing component, but I don’t know why. Running the logger component with debug severity does not give me any clues. Here’s the relevant config:

camera entity:

camera:
  - platform: local_file
    name: letzte_bewegung_img
    file_path: /data/images/recent.jpg

face detection:

image_processing:
  - platform: dlib_face_detect
    source:
      - entity_id: camera.letzte_bewegung_img
        name: face_detect

logger config:

logger:
  default: warn
  logs:
    homeassistant.components.sensor: debug
    homeassistant.components.image_processing: debug

You need to call the image_processing.scan service to trigger detection analysis
By default image_processing.scan runs every 10 sec.
The “better” way is to set the scan_interval to 10000 and the manually call image_processing.scan when required (like by using a motion sensor as a trigger)
See example here from tensorflow:

I personally don’t use dlib_face_detect, so can’t really comment on it. I do however use facebox and tensorflow

Thank you, good advise! But that does that also explain the command line sensor timeouts?

No it does not, but then it’s also only a warning, so not really something to worry about too much if things work as expected.
I get that same warning with Tensorflow and Facebox upon HA startup. Then it doesn’t come up again.