About Video Face Detection¶
To add video face detection to your FindFace Server Enterprise SDK instance, you need the fkvideo_detector component. This component extracts faces from video and posts them to FindFace Server over API for further processing. It can work with both live streams and files, and supports all video file formats and codecs that can be decoded by FFmpeg.
In this section:
Install fkvideo_detector from the <findface-repo>.deb package on one of the FindFace Server hosts or on a separate host:
Click here for the package preparation instruction.
sudo apt-get update sudo apt-get install fkvideo-detector
When processing video, fkvideo_detector consequently uses the following algorithms:
Motion detection. This algorithm is aimed to reduce system resources consumption. Only when the motion detector recognizes motion of certain intensity in video that the face tracker can be triggered.
Face tracking. The face tracker tracks, detects and captures faces from video, and posts them to FindFace Server. It can simultaneously process several faces.
Configure the maximum number of processed faces in the fkvideo_detector configuration file.
Each captured face is posted as a snapshot and a bbox in a request
/identify, depending on the configuration settings. If there are several active trackers, the face tracker sends the same number of requests with a unique snapshot and bbox in each.
When tracking a face, the face tracker searches for its best snapshot before posting it to FindFace Server.
The best face can be found in one of the following modes:
The real-time mode allows posting a face immediately after it appears in a camera field of view.
rt-perm=True, the face tracker searches for the best face snapshot within each time period equal to
rt-delayand posts it to FindFace Server.
rt-perm=False, the face tracker searches for the best face snapshot dynamically:
- First, the face tracker estimates whether the quality of a face snapshot exceeds a pre-defined threshold value. If so, the snapshot is posted to FindFace Server.
- The threshold value increases after each post. Each time the face tracker gets a higher quality snapshot of the same face, it is posted.
- When the face disappears from the camera field of view, the threshold value resets to default.
The offline mode is less storage intensive than the real-time one as it allows posting only one snapshot per face, but of the highest quality. In this mode, the face tracker buffers a video stream with a face in it until the face disappears from the camera field of view. Then the face tracker picks up the best face snapshot from the buffered video and posts it to FindFace Server.
To configure fkvideo_detector, you can specify its options in any of the following ways:
As command line arguments upon starting fkvideo_detector.
As parameters in the fkvideo_detector configuration file.
The default fkvideo_detector configuration file is
/etc/fkvideo.ini. Avoid editing
/etc/fkvideo.ini, especially if fkvideo_detector and FindFace Web UI are running on the same host, as FindFace Web UI also uses this configuration file. Instead, make a copy of this file, edit the copy and specify it in the option
-cwhen starting fkvideo_detector.
sudo cp /etc/fkvideo.ini /etc/fkvideo_example.ini fkvideo_detector -c /etc/fkvideo_example.ini
See Configuration Parameters for the full option list.
You can specify video streams to be processed by fkvideo_detector as follows:
- A single stream can be specified directly by using the
--sourceoptions when configuring fkvideo_detector.
- A list of streams has first to be posted to FindFace Server by applying the /camera POST method to each stream. When posting, all streams in the list have to be assigned a common user-defined string, so called
detector. This string should then be specified as the
--detector-nameoption when configuring fkvideo_detector. In this case, fkvideo_detector will retrieve the list of streams from FindFace Server, based on their
detector-name, and begin to process each stream individually. It will also be periodically updating the list of cameras from FindFace Server with a polling interval defined by the