Hi all
just released a custom component for face and person detection with sighthound.com. Adds an entity where the state of the entity is the number of faces detected in an image. Person and face data are accessible as attributes, and events are fired that can be used to trigger automations.
To use this component you must register with sighthound to get an api key. The developer tier (free) allows 5000 requests per month, therefor you are advised to set a long scan_interval and call the scan service when you want to process an image, otherwise you will quickly burn through your 5000 requests as the default scan interval is 10 seconds. Please read the developer docs.
The image with bounding boxes is just to show what the component is recognising. If you are curious how to view bounding boxes see this repo.
That’s surprises me, you should raise the topic on their forums. Myself I’ve only briefly experimented with it but found it to be similar accuracy to other classifiers out there
I think it was the lens distortion that gave it trouble. I can get other corrected streams out of the camera. Might give it another go but the trial has expired on my test PC now.
I would create a seperate component for cars but since these components (all rest APIs) are very similar to one-another it is trivial to knock out another
@robmarkcole if you can that would be great. Would be nice to get notified when a sensor picks up a particular model car sitting in driveway. On a separate note how would you compare this component to your facebox one? Tried reading the documentation but its a bit beyond me. Do you have inx how to train faces for this component?
I see recognition of faces is possible, but functionality is identical (from what I can tell) to the Microsoft component - any reason which you would need this? My main interest in Sighthound is for person detection.
Events
On each image processing, an image_processing.detect_face event is fired for each detected face, and an image_processing.detect_persons event is fired with the total number of detected persons. The events can be used to trigger automations, for example the following:
id: ‘11200961111’
alias: Notify on person detection
trigger:
platform: event
event_type: image_processing.detect_persons
action:
service: notify.pushbullet
data_template:
title: People detected
message: ‘Alert: {{ trigger.event.data.total_persons }} persons detected by {{ trigger.event.data.entity_id }}’
I put on automation
not working
@robmarkcole I’ve set this up and its working well, email alerts are also being sent when a face is detected.
Any thoughts on how the image can be attached to the alert being sent? The below is what i have configured for attaching files generated by the folder_water integration, i’ve tried to adapt it to sighthound but to no avail
– id: SightHound
alias: SightHound Notify on person detection
trigger:
platform: event
event_type: image_processing.detect_persons
action:
- service: notify.email_steve
data_template:
message: “Alert: {{ trigger.event.data.total_persons }} people detected by {{ trigger.event.data.entity_id }}”
data:
images:
- “{{ trigger.event.data.path }}”
With this config the alert is emailed, but no attachment, i’m assuming i’m not passing through the image after the detection?
Automation that sends a telegram notification after the scan has completed, if a person is found. The file section is hardcoded to suit my setup, which is what more advanced HA user would have used a template for i guess…?
id: ‘1120092824611’
alias: “Notify that a person has been detected”
initial_state: ‘on’
condition:
condition: template
value_template: “{{ trigger.event.data.total_persons > 0 }}”
action:
service: notify.telegram_steve
data_template:
message: “A Person has been detected”
data:
photo:
- file: “/storagemotion/{{ trigger.event.data.entity_id.split(‘.’)[1].split(‘‘)[2] }}/lastmotion.jpg"
caption: "We have detected {{ trigger.event.data.total_persons }} people at {{ trigger.event.data.entity_id.split(’.‘)[1].split(’’)[2] }} camera”
trigger:
platform: event
event_type: image_processing.detect_persons
Here is what the notification looks like. The red box is drawn by motion, not by sighthound.
I’m still messing with it but it’s working nicely now. Thanks @robmarkcole for your efforts with this and the other image classification services, been really interesting learning more about them
I cant tell why this is not working,
-below is my config
-my camera is working
-my token is active in sighthound
-HA creates a entity named image_processing.sighthound_frontdoorcam
-the .py file is saved in custom_components\image_processing