Hi guys.
I’ve made a simple automation that scan camera repeatly, I’ve notice the deep stack processing time is really fast on the Jetson Nano. It’s about 150ms for a half hd resolution.
However, the total processing of Home Assistant is very high. All the process of capture camera frame, send post request to deepstack wait until return result take total 3 seconds.
What is the best way to improve image processing service interference time?
This is the automation
- id: "1618637076001"
alias: DeepStack Scan Camera 1
description: Scan All Camera
mode: restart
trigger:
- platform: homeassistant
event: start
- platform: state
entity_id: automation.deepstack_scan_camera_1
to: "on"
condition: []
action:
- service: image_processing.scan
data: {}
target:
entity_id:
- image_processing.camera_1
- service: system_log.write
data:
level: warning
message: "Cameras 1 scan interval {{ (as_timestamp(now()) - as_timestamp(states.input_text.deepstack_camera_1_last_scan.state)) | float | round(2) }} seconds"
- service: input_text.set_value
entity_id: input_text.deepstack_camera_1_last_scan
data:
value: "{{ now() }}"
- service: automation.trigger
target:
entity_id: automation.deepstack_scan_camera_1
Deepstack Docker Console: process image take 150 ms
[GIN] 2021/04/22 - 10:40:47 | 200 | 158.901916ms | 192.168.1.122 | POST /v1/vision/detection
Home Assistant Log: The loop take more than 2 second
[homeassistant.components.system_log.external] Cameras 1 scan interval 2.34 seconds