jakowenko / double-take

Unified UI and API for processing and training images for facial recognition.
https://hub.docker.com/r/jakowenko/double-take
MIT License
1.23k stars 98 forks source link

[FR] UI filters for camera name and event type #106

Open Sylvain-Laine opened 3 years ago

Sylvain-Laine commented 3 years ago

First, apologies for my english, and my first time on github !

Just to preface my case and my tests, my need is: I've got cameras that dont work well with frigate for their main_stream, they work well for the sub_stream and the person detection work as intended For the face detection with double take, i need to use an overide of the snapshot to process the detectors at max resolution

I did a lot of trial and error and have some errors and requests:

detect: match:

save match images

save: true
# include base64 encoded string in api results and mqtt messages
# options: true, false, box
base64: false
# minimum confidence needed to consider a result a match
confidence: 60
# hours to keep match images until they are deleted
purge: 168
# minimum area in pixels to consider a result a match
min_area: 3600

frigate: url: http://[ip]:5000

object labels that are allowed for facial recognition

labels:

  • person

    attempts:

    number of times double take will request a frigate latest.jpg for facial recognition

    latest: 0

    number of times double take will request a frigate snapshot.jpg for facial recognition

    snapshot: 0

    process frigate images from frigate/+/person/snapshot topics

    mqtt: false

    add a delay expressed in seconds between each detection loop

    delay: 0

Even with this config, the default mqtt topics are processed, latest and snapshot are not (as intended).

cameras: reolink_cam_01: snapshot:

process any jpeg encoded mqtt topic for facial recognition

#   topic: 
#   # process any http image for facial recognition
  url: http://[ip]:8123/local/test.jpg

Request: On the Macthes UI: Beeing able to filter by camera entity Beeing able to filter by trigered media (latest,snapshot,mqtt,...)

jakowenko commented 3 years ago

Hey @Sylvain-Laine, those config examples you posted are for the current beta build. I'm working on releasing 1.0.0 today as well which will include that.

I'll take a look at your other requests in a bit, but that should be the reason for the config inconsistencies.

Sylvain-Laine commented 3 years ago

Ok, thank you for the repply, i will update this issue, after the 1.0.0 release, I toyed with the config in the past days, updated it today with the information available, but i already had the same problems before. I hope i'll come back with good news :)

jakowenko commented 3 years ago

1.0.0 is released now. So the config you have above should work.

I will work on adding in support for filtering based off the camera and triggered media like you suggested. I think those make sense to add in!

Sylvain-Laine commented 3 years ago

Everything works thank you ! I didn't quite understand the configuration section for "camerar / [cam] / snapshot / url" I thought (falsly) that it was an override of the frigate snapshot, but this point is addressed in the issue #110

The support for filtering based off the camera and triggered media will be a great improvement for the ui ! Thank you

jakowenko commented 3 years ago

Hey @Sylvain-Laine, I got the new filters added to the beta build, docker pull jakowenko/double-take:beta. Let me know what you think!

Screen Shot 2021-09-22 at 11 45 41 PM

Sylvain-Laine commented 3 years ago

Perfect ! Thanks

Sylvain-Laine commented 3 years ago

Juste a quick update, the filters do work great, but they are reset after a delete operation, this is just for quality of use.

This may need another [FR], but i was thinking of another filter which may be great for debugging, not so important for normal use: The ability to filter by frigate event (even the events with no return from detectors).

jakowenko commented 3 years ago

Glad they are working! I can work on the filter resetting logic and make it better. It's a little tricky because if no matches are in the database, then there's no filters, but as soon as one comes in I need to update all the filters so it shows on the page, this is when the "reset" of the filters happens.

I'll update it though so they don't reset after the delete operation. Only when the WebSocket receives new matches.

How did you think the other debug filter would work? No images would be saved for these events, so I'm not sure what to display. I guess I could start saving 1 image for maybe each Frigate event that doesn't find any faces. I just don't want to save too many or it would get out of control. Then you could see an image for each Frigate event that triggered Double Take.

Everything is written to a messages.log file, so you could always look through there for debugging the Frigate events too. Though not as clean as being on the UI.

Sylvain-Laine commented 3 years ago

Maybe a filter logic based on both trained folders / entry in the configuration instead of matches in database, it's a little more tricky because you still need to be able to shows matches in db that are no longer in the configuration after a change... But as i said, this is juste quality of use, the filters are fine ! And the difference between v1.0.0 and the current beta build is perfect ! Great Job !

For the frigate event filter, im still thinking about it, i'll come back to you after having some time to formulate the use case in the details.

ozett commented 3 years ago

Hey @Sylvain-Laine, I got the new filters added to the beta build, docker pull jakowenko/double-take:beta. Let me know what you think!

Screen Shot 2021-09-22 at 11 45 41 PM

can you do such a selection-filter accordingly also for the train-page?

jakowenko commented 3 years ago

@ozett the training page already filters images when you select a name from the dropdown. I don't see a lot of other value added by adding more filters. What else were you hoping to filter by?

ozett commented 3 years ago

i have now 5 page of faces. i dont want to filter by person, i want to images regardless of the person-category to improve quality i would check from time to time if images have a too low box-area. or to sort out images that matched, but had not been trained on again image