Facial Recognition provides the ability to recognise faces from your video feeds. You upload and tag photos of the faces you want to recognise and Agent will use DeepStack to recognise the people, take photos and perform actions.

To get started, install DeepStack AI for your platform (Docker). Use the GPU version if possible (you'll need an nvidia card for GPU acceleration). Make sure it's running in Facial Recognition mode. To do that via the command line pass in "-e VISION-FACE=True".

When you have the deepstack server up and running and in Facial Recognition mode, switch back to Agent and go to Server Settings - Intelligence:

DeepStack

Put in the URL of the deepstack server here. Then edit a camera and go to the Facial Recognition tab:

Configure Facial Recognition

  • Enabled: Switch Facial Recognition on or off. You can also do this via the Schedule
  • Mode: When to process frames. You can choose from Alert, Motion which can be based on simple motion or a large object crossing a virtual trip wire. See Detectors, or None which is useful if you are triggering it via API.
  • Minimum Interval: How often to process frames when triggered.
  • Confidence: Minimum confidence of result. Anything below this value will be discarded (0-100)
  • Photos: Check this to take a photo and overlay results. These photos will be saved to Photos in Agent DVR.
  • Edit Faces: Click this to register new faces and delete registered faces (see below)

Editing Faces

Editing Faces

Click Add to register a new face. The face must be clearly visible in the Camera (Camera must be enabled). You can add multiple photos of the same face to improve results - just use the same name for each capture.

DeepStack stores the faces in a database so you can add photos in one camera and other cameras will also have access to them.

Example Result
Example Face Recognition Result
Adding Face Recognition Actions

When Facial Recognition runs Agent will generate events for "Face Recognized" under Actions.

You can use these events to trigger actions such as calling a URL with the recognized face or running an executable or publishing a message to an MQTT server. You can use the tags {AI} for the face name (if more than one they will be in a CSV list) or {AIJSON} for the full response JSON object from DeepStack.


Facial Recognition Troubleshooting

  • If you are getting errors (code 500 server errors) from DeepStack on Windows you may need to install https://aka.ms/vs/16/release/vc_redist.x64.exe
  • Check that DeepStack is running in FACE RECOGNITION mode ( VISION-FACE=True on the command line).
  • Try adjusting the Confidence level down in Agent as results may be being filtered
  • Check the logs at /logs.html for error messages from DeepStack. Possibly the DeepStack service is running on a different port or a firewall or antivirus is blocking access to it. If Agent can't contact DeepStack it will record the event.
  • Check that DeepStack isn't overloading your computer. If DeepStack can't process the images quickly then it will time-out and Agent will give up waiting for a result and start recording. If DeepStack is timing out you will see errors in the logs. You may need to move the DeepStack service to another computer with more resources or a compatible GPU.