Face, Body, Vehicle Counters
Important
To be able to count human bodies (silhouettes) or vehicles, you first have to enable body recognition or vehicle recognition.
FindFace Multi allows you to count faces, bodies and vehicles on connected cameras. This functionality can apply to a wide range of situations, such as people counting in queues and waiting areas, monitoring public gatherings, crowding prevention, traffic jam detection, and more.
The counting method is based on time slices, which means that the system counts faces, bodies and vehicles in static screenshots taken with a given count interval
.
You can opt for counting faces/bodies/vehicles either on each camera independently, or collectively on all selected cameras.
In this section:
Create Counter
To set up a counter, do the following:
Navigate to the Counters tab.
Click + Add new counter.
On the Info tab, specify the counter name.
Select one or several camera groups for counting.
Select one or several cameras for counting.
Enable Faces to count faces.
Enable Bodies to count bodies. Body recognition has to be enabled.
Enable Vehicles to count vehicles. Vehicle recognition has to be enabled.
Specify the interval in seconds between two consecutive screenshots used for counting.
Click Save.
Make sure that the counter is activated.
Click Save.
(Optional) Navigate to the ROI tab to specify the face/body/vehicle tracking region within the camera(s) field. Select a camera and specify a region of interest. Click Save.
Monitor Counter Operation
To monitor the operation of counters, navigate to the Counters tab.
Counter statuses:
Green: the counter is running without errors, all frames from all cameras of the counter have been received for a certain period.
Yellow: the number of errors is less than 70%.
Red: the number of errors is over 70%.
Grey: the counter is disabled.
You may use the counter status filter to find counters with technical problems, for example, if the counter could not receive frames due to loss of connection with the camera.
By selecting a counter, you can filter the list of frames and leave only frames with errors. The error tooltip is displayed when pointing over the frame id.
Tip
You can configure the yellow and red statuses based on the portion of failed counter records. To do so, modify the MAX_COUNTER_ERROR_RECORDS
parameter in the /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
configuration file:
sudo vi /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
FFSECURITY = {
...
# Counter health status config:
# max percent of camera records with errors
'MAX_COUNTER_ERROR_RECORDS': {'yellow': 0.3, 'red': 0.5},
...
}
Work with Counter Records
Static screenshots taken by a counter, with the number of faces, bodies and vehicles in them, are saved as counter entries.
If the counter is running with errors, the system will create blank records with an error message.
To see the counter records, navigate to the Counters tab. Click on the counter. Navigate to the Screenshots tab.
You can scale the screenshots by clicking on them.
To work with the counter list, use the following filters:
Name contains: filter counters by name.
Counter ID: display a counter with a given ID.
Camera groups: display counters from selected camera groups.
Cameras: display counters from a selected camera.
Status: filter counters by status.
To work with counter screenshots, use the following filters:
Cameras: display screenshots from a selected camera.
Date and time: display screenshots that occurred within a certain period.
Has errors: filter screenshots with/without errors.
Count faces: display screenshots with the number of faces within a certain interval.
Count bodies: display screenshots with the number of bodies within a certain interval.
Count vehicles: display screenshots with the number of vehicles within a certain interval.
Counter entry ID: display screenshots with a given counter entry ID.
Set Webhook for Counter
To take it up a notch, configure a webhook for counter records with a specific number of faces, bodies and vehicles.
Configure Counters
To configure counters, open the /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
configuration file and modify the following parameters:
COUNTERS_SAVE_FULLFRAME
determines saving options of full frames in counters:always
,detect
– only save if faces, bodies or vehicles have been detected,never
.COUNTERS_FULLFRAME_JPEG_QUALITY
: JPEG quality of full frames.COUNTERS_THUMBNAIL_JPEG_QUALITY
: JPEG quality of thumbnails.COUNTERS_ROI_INTERSECTION_THRESHOLD
: required percentage of the rectangle around the object (a.k.a.bbox
) intersection with the region of interest defined for the counter.'COUNTERS_SCREENSHOT_TIMEOUT'
: a timeout before a counter starts getting screenshots.'COUNTERS_DETECTION_TASK_TIMEOUT'
: a timeout before a counter starts registering objects on already received screenshots.
Also, you can configure the parameters that regulate CPU consumption throughout the entire operation time of the counters:
'COUNTERS_MAX_SLEEP_ON_START'
: counters get a random delay on first launch from 0 (zero) to the specified number of seconds.'COUNTERS_MAX_CONCURRENT_SCREENSHOT_FETCHES'
: this parameter is set to ensure the uniform loads on CPUs while counters are working. The default value is100
. With this value, on a 100-CPU installation, each CPU will work the most efficiently. However, on the installation with fewer CPUs you may need to lessen this value to the number of CPUs. The parameter is configured individually for every single installation.
sudo vi /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py
# counters full frame saving options:
# `always` - save always
# `detect` - save only if faces, silhouettes or cars have been detected
# `never` - never save full frames
'COUNTERS_SAVE_FULLFRAME': 'always',
'COUNTERS_FULLFRAME_JPEG_QUALITY': 75,
'COUNTERS_THUMBNAIL_JPEG_QUALITY': 75,
# required percentage of bbox intersection with ROI
'COUNTERS_ROI_INTERSECTION_THRESHOLD': 0.75,
'COUNTERS_MAX_SLEEP_ON_START': 10, # in seconds
'COUNTERS_SCREENSHOT_TIMEOUT': 15, # in seconds
'COUNTERS_DETECTION_TASK_TIMEOUT': 15, # in seconds
# global limit devided equally among general workers
'COUNTERS_MAX_CONCURRENT_SCREENSHOT_FETCHES': 100,
...
Be sure to restart FindFace Multi containers after making changes.
cd /opt/findface-multi/
sudo docker-compose restart