Hi,
I have my camera storing pictures on my synology nas on motion:
filenames are like:
13.19.41[M][0@0][0][0]
13.19.42[M][0@0][0][0]
13.19.43[M][0@0][0][0]
stored in a date stamped folder e.g. 2020-11-17
the camera is a dahua cam btw
when the camera sensor detects motion, i want to trigger facebox to analyse the images until a match is found
I dont know however how to handle the changing date nor the variable filenames.
You need to pass it a camera entity type, and it will get the pictures itself from that camera entity. Basically it will grab stills periodically from these cameras and run them through processing.
What you CAN do with a group of images is train it to learn faces. You give it a bunch of images of a person and say “this is person X”. This will allow it to figure out who person X is from the camera(s) you provide.
It will automatically trigger face recognition always on all images. I don’t think there is a way to start/stop it. It will be grabbing an image and processing it. If it finds something, it will fire the ‘image_processing.detect_face’ event automatically. Though, since it uses the ‘Camera’ entity, it is very possible that it will latch onto the camera’s motion detection automatically and fire from that if it’s enabled.
So if you have a camera device in your config, just pass that entity to facebox and see what happens.
Thanks Jim.
What you describe is what i have currently configured.
Problem with that is that you missout the pictures in between the time it takes for processing.
Or, would it, while processing, start an other process for a next motion event?
My “plans” was to assign these pictures systematically to a “camera” and feed them in facebox one by one,
- alias: Update Facebox image
trigger:
platform: state
entity_id: binary_sensor.camera_motion
to: 'on'
action:
repeat:
sequence:
# Run command that for some reason doesn't always work
- service: input_text.set_value
data:
entity_id: input_text.facebox_image_location
# Use repeat.index to increment to the next image.
# I don't understand your naming scheme, but hopefull you can figure out how to
# translate a loop index to a value.
value: "13.19.41[M][0@0][0][{{repeat.index - 1}}]"
# Give it time to complete
- delay:
milliseconds: 1000
until:
# Did it work?
- condition: state
entity_id: binary_sensor.something
state: 'on'
You need to attach to the facebox events to maybe turn on/off a sensor to use as your loop stopping condition.
Maybe that will give you an idea?
My assumption would be that facebox will automatically pull the next image for processing when it’s done. I can’t imagine it would be very useful if it just tried one time and gave up. But if you want to feed it specific images, the generic camera with a template_url would be the way to do it.
Thanks Jim, your reply will help me a step further.
Would a loop in an automation be the best location? or can it be a “function” stored somewhere else?
Apologies for these “basic” question, but i’m just starting to get my head around home assistant.
the naming of the pictures is nothing more that the time: 13h.19m.41s. rest ([M][0@0][0][0]) is always the same. Cant find a place in my camera config to change this to a more logical name.