Person and face detection using image_processing with Sighthound

I just released v0.6 which fixes this

Thanks a lot!

1 Like

Hello,
I’m trying to use sighthound to implement face detection in HA.

I’ve registered with Sighthound to get the api key as developer (free).
I’ve added to my configuration.yaml the following:

image_processing:

  • platform: sighthound
    api_key: api_key
    save_file_folder: /config/sighthound/
    save_timestamped_file: True
    source:
    • entity_id: camera.xxx

These are the errors I got when HA checks the configuration:

Invalid config for [image_processing.sighthound]: [save_file_folder] is an invalid option for [image_processing.sighthound]. Check: image_processing.sighthound->save_file_folder. (See ?, line ?).

not a directory @ data[‘whitelist_external_dirs’][2]
Invalid config for [image_processing.sighthound]: [save_file_folder] is an invalid option for [image_processing.sighthound]. Check: image_processing.sighthound->save_file_folder. (See ?, line ?).

Any idea ?

Thank you for helping me.

You are using the component on github right? The official integration doesn’t have all the features yet

Hello, I’m using the official integration at the moment. How can I use the custom component ?

Thank you for your help.

Simply follow the install instructions in the custom component repo

Hey! This looks awesome
Just to double check before I start playing, would this would with a ring doorbell camera and ring spotlight cameras ?

i cant figure out what i m doing wrong as i couldnt get it working, can somebody point out what i ve missed?

these are things i ve done so far;

  1. installed “sighthound custom component” using integrations in HACS
  2. wrote this in configuration.yaml
image_processing:
  - platform: sighthound
    api_key: (i put in my API key from sighthound)
    save_file_folder: /config/tmp/
    save_timestamped_file: True
    # scan_interval: 30 # optional, in seconds
    source:
      - entity_id: camera.porch
      - entity_id: camera.pc

these created 2 entities; sighthound_pc & sighthound_porch

  1. wrote this in automation.yaml for automation to send me notification on person detection
- alias: scan tell
  trigger:
    platform: event
    event_type: image_processing.detect_persons
  action: 
  - service: notify.tellme
    data_template:
      message: “Person Detected”
  1. wrote this in automation.yaml to trigger the image scan/processing
- id: scan
  alias: Camera Picture Notification Road
  trigger:
    - platform: state
      entity_id: input_boolean.transit
      to: 'on'
  action:
    - service: image_processing.scan
      data:
        entity_id: image_processing.sighthound_pc

When i toggle the input_boolean.transit, nothing happen. What am i doing wrong?
I can see from sighthound website that usage is 0/5000…so no attempt was made.

Everything looks fine, anything in the logs? Also you can directly trigger the scan from the developer tools

Error that i m getting;

Error on receive image from entity: Unable to get image
components/image_processing/init.py (error)

i guess sighthound component is not able to get the image from my camera. btw i m using Vstarcam camera, using onvif platform. not sure if that does matter.

After using it for some time I have to say that sigthound’s algorith to detect people is very very weak. Everyday I keep getting notifications from HA that my camera detected people and on the screen I see flowers, shades etc. Then I send exactly the same picture to google’s vision and no mistake. Unfortunately it is hard to configure and payment details need to be filled.

@robmarkcole you are definitely busy and contributing a lot in this area. I’m picking back up the Coral person detection again - I say picking back up but it’s been working nicely for the past month or two sending me “Dong Ding” doorbell notifications whenever someone’s at the door but hasn’t rung the doorbell yet and it’s great! I’ve added detection for a couple other cameras around the perimeter but want to increase the update frequency and add other objects via a custom trained model.

Did anyone ever get good numbers on the number of images per second the coral could tag? I’m also looking for the “official” integration and repository but am having trouble as it seems there are at least two forks or different efforts working towards the same thing?

The more I type the more I realize this is off topic for this thread, apologies.

-Joni-

@rjchu yes please the coral thread to discuss coral.

@majkers I do not know which model sighthound is using but there are several ‘high accuracy’ models in the public domain so there must be more aspects to consider when selecting a model. I suggest you provide feedback on the sighthound forums

local_file camera gives me the same error. i guess it s not because of my camera then.

“Error on receive image from entity: Unable to get image”

Is it possible to teach sighthound, that my grill is not a person?

1 Like

Hello

  1. installed “sighthound custom component”
  2. wrote this in configuration.yaml

image_processing:

  • platform: sighthound
    api_key: “xxxxxx”
    save_file_folder: /config/www/
    save_timestamped_file: True
    scan_interval: 1000
    source:
    • entity_id: camera.cgaleria

i wrote this in automatizations.yaml

  • id: camera_snapshot_galeria
    alias: Camera Picture galeria
    trigger:
    • entity_id: binary_sensor.camaragaleria
      platform: state
      to: ‘on’
      action:
    • data:
      entity_id: camera.cgaleria
      entity_id: image_processing.sighthound_cgaleria
      service: image_processing.scan

The component gives me an error. I copy the log

Thu Feb 20 2020 23:17:29 GMT-0300 (hora estĂĄndar de Argentina)
Update for image_processing.sighthound_cgaleria fails
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 279, in async_update_ha_state
await self.async_device_update()
File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 459, in async_device_update
await self.async_update()
File “/usr/src/homeassistant/homeassistant/components/image_processing/init.py”, line 132, in async_update
await self.async_process_image(image.content)
File “/usr/src/homeassistant/homeassistant/components/image_processing/init.py”, line 112, in async_process_image
return await self.hass.async_add_job(self.process_image, image)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/sighthound/image_processing.py”, line 112, in process_image
self.faces = hound.get_faces(detections)
File “/usr/local/lib/python3.7/site-packages/simplehound/core.py”, line 54, in get_faces
for obj in detections[“objects”]:
TypeError: ‘NoneType’ object is not subscriptable

that could be happening?

@phontakly I created an issue for this

Working my way through the install and have everything working except my logs say

Could not read camera sighthound image from file /config/www/sighthound_latest.jpg

Checking www the file isn’t there.

I can call the image_processing.scan service and and also trigger the ‘image_processing.sighthound_garage_cctv’ state from 0 to say 2 and HA front end shows 2 faces but I cannot seem to create the file.

Using a DVR which the camera identities are working but are RTSP streams. Is this where my issue is?
Config file

  - platform: sighthound
    api_key: Added API Key
    save_file_folder: /config/www/
    save_timestamped_file: True
    scan_interval: 1000 # optional, in seconds
    source:
      - entity_id: camera.garage_cctv

Any ideas/advice?

To confirm, you are using the custom integration and not the official one?

Could you send me the necessary modification?