Hi guys,
I am trying to set facial recognition in my HA setup. I prefer to do it with an add-on running on HA over using another docker or externally.
I got the initial setup working with one camera and one face to recognize. it work pretty good.
Now I wish to add more cameras and more faces but I have two problems:
- Having one camera and multiple faces, results in recognizing only the first one.
- If I add more cameras, HA core crash every time I try to do that. I think it’s spiking the CPU and HA keeps restarting.
The documentation is not so informative in the CPU excessive section (the sensor suggested just don’t work, maybe I got it wrong), so I come to you guys for help.
There are 3 parts in the config: the platform in configuration.yaml, the cameras and the faces.
When I try to have them all in the same platform declaration, HA crash and reboot every few minutes.
image_processing:
- platform: dlib_face_identify
scan_interval: 10000
source:
- entity_id: camera.camera5
name: DoorCamIdentify
- entity_id: camera.camera1
name: EntranceCamIdentify
- entity_id: camera.camera2
name: LivingroomCamIdentify
faces:
First: /config/www/FamilyPics/FirstPortrait.jpeg
Second: /config/www/FamilyPics/SecondPortrait.jpeg
Third: /config/www/FamilyPics/ThirdPortrait.jpeg
And than call the service once needed (I will set it later, maybe motion based decision)
- alias: "test face recognition"
id: 'testreco'
trigger:
platform: state
entity_id: input_boolean.trigger
to: 'on'
action:
- service: image_processing.scan
target:
entity_id:
- image_processing.doorcamidentify
- image_processing.entrancecamidentify
- service: input_boolean.turn_off
entity_id: input_boolean.trigger
And have one of the following for each camera:
- alias: "Known person is detected"
id: 'cam5persondetect'
trigger:
platform: event
event_type: image_processing.detect_face
event_data:
entity_id: image_processing.doorcamidentify
name: "{{ 'First' or 'Second' or 'Third' }}"
action:
- service: notify.mobile_app_naors_iphone13pmax
data:
message: >
{{ trigger.event.data["name"] }}, Cam5 Gotcha!
What is the correct way to this? should I somehow split the configs?
Thank you guys in advanced!