VorlonCD / bi-aidetection

Alarm system for Blue Iris based on Artificial Intelligence.
https://ipcamtalk.com/threads/tool-tutorial-free-ai-person-detection-for-blue-iris.37330/
GNU General Public License v2.0
203 stars 45 forks source link

[Feature Request] Facial Recognition #241

Open apedance opened 3 years ago

apedance commented 3 years ago

Amazing tool. Thank you.

Is it possible to have the software detect certain faces if trained? Store known faces, forward to other APIs if certain face is detected.

VorlonCD commented 3 years ago

With any of the latest versions you can have it 'trigger' anything you want based on a face name being detected assuming you have already trained deepstack face database. In AITOOL Just add the name to the list of objects that will be detected. You can also create an object called unknown if you want it to do something based on an untrained face. https://github.com/VorlonCD/bi-aidetection/tree/master/src/UI/Installer

I'm starting to think about an UI for training and keeping track of unknown faces, etc. Any input on how you would like that part to work is welcome.

sneekerzzz commented 3 years ago

I think this is a great idea. Perhaps making a new tab with all training stuff and custom object adding to.

kozoke commented 3 years ago

So happy to have AI Tool - Thank you @VorlonCD! To the training question, I just stumbled across this. https://github.com/johnolafenwa/deepstack-trainer I trained 3 faces tonight and just read your guidance on how to inference/detect. Will try it. So cool.

VorlonCD commented 3 years ago

Once trained just add your person names to the list of "Relevant Objects". Or the reverse, add "Unknown" to the list in order to only preform an action if an unknown face is shown. (prob have to uncheck PERSON or else it will go off every time)

apedance commented 3 years ago

This is amazing. Thanks guys. My AITool is working along Home Assistant.

The making a new tab for training and learning is a great idea. Incorporate the https://github.com/johnolafenwa/deepstack-trainer code?

Can I send individual detections to my Home Assistant? Like - detect a yellow truck - send yellow truck notification, etc.

marrobHD commented 3 years ago

Ofc you can send individual detections to HA.

I solved it with using HomeAssistants API: Set trigger external program to cmd.exe with argument /C curl -X POST ^ -H "Content-Type: application/json" ^ -H "Authorization: Bearer SECRET" ^ -d "{\"state\": \"[Detection]\", \"attributes\": {\"friendly_name\": \"Haustuer state detection\", \"detections\": \"[Detections]\"}}" ^ https://HAInstance.local/api/states/sensor.camera_state_detection

This will create a new HA sensor entity with special attributes. You can create more specific automations with NodeRED.