Hey rafale, very impressive, even though I don't understand half of what you just said With your permission, we would like to include your github links in the 101Sure.
My code is here:
GitHub - rafale77/core: :house_with_garden: Open source home automation that puts local control and privacy first
:house_with_garden: Open source home automation that puts local control and privacy first - rafale77/coregithub.comcore/homeassistant/components/dlib_face_identify at live · rafale77/core
:house_with_garden: Open source home automation that puts local control and privacy first - rafale77/coregithub.com
It is a fork of home assistant you have to look at the commits to see what I changed. Python is the language to go for this type of things unless you are versed enough in C++ which I am not. I am not even in IT by trade.
For the nitty gritty details, I tested a number of AI frameworks, inference models and classification algorithms before settling to use pytorch and retinaface for facial detection and arcface for face recognition.
They are modifications of an original implementations which used a very different framework (dlib) so that's why it is strangely located under the dlib component. I started from dlib and evolved the component -> opencv for face detection + dlib for encoding and classification -> changed classification to SVM classifier to improve accuracy ->pytorch retinaface for detection -> pytorch arcface for encoding and classification. This is as far as I know the state of the art for accuracy and speed.
Then I implemented another model (Yolov4) for other cameras (people, deers and car detection) which meant I needed a GPU to do all of this real time. So I pretty much obsoleted movement detection as an alarm as it had too many false positive.
I also implemented quite a bit of optimization of the video stream handling of home assistant...