Face, Body, Car Counters. Distance Measurement

Important

To be able to count human bodies (silhouettes) or cars, you first have to enable body detection or car detection.

FindFace Multi allows you to count faces, bodies and cars 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 cars in static screenshots taken with a given count interval.

You can opt for counting faces/bodies/cars either on each camera independently, or collectively on all selected cameras.

In this section:

Create Counter

To set up a counter, do the following:

  1. Navigate to the Counters tab.

  2. Click +.

    create_counter_en

  3. Specify the counter name.

  4. Select one or several camera groups for counting.

    Tip

    By default, counting will apply to all cameras within the groups. If necessary, you can disable counting on specific cameras.

  5. Specify the interval in seconds between two consecutive screenshots used for counting.

  6. Check Detect Faces to count faces.

  7. Check Detect Bodies to count bodies. Body detection has to be enabled.

  8. Check Detect Cars to count cars. Car detection has to be enabled.

  9. Check Distance measurement to count the distance between bodies. This option becomes available only if Detect Bodies box is checked.

  10. Make sure that the counter is Active.

  11. Click Save.

    counter_en

  12. (Optional) Navigate to the Region of Interest tab to specify the face/body/car tracking region within the camera(s) field.

    counter_roi_en

Calibrate Counter for Distance Measurement

If Distance measurement is enabled, you should perform the counter calibration.

For counter calibration:

  1. Ask a person to stand before the selected camera in full height.

  2. Ask a person to walk through the area visible by the camera, along which the distances will be calculated. To achieve the best quality, the person must walk on a flat surface.

  3. Enter the counter calibration timeframe (from 15s to 300s) and click Calibrate counter.

If you need to calibrate the counter for several cameras, perform steps 1-3 for each camera selected in the Cameras field.

If you are unsatisfied by the result, click Delete calibration and perform the calibration once more.

Counter Chart

To see the counter chart for the last hour, 24 hours, or week, navigate to the Chart tab in the counter settings.

counter_chart_en

Monitor Counter Operation

To monitor the operation of counters, navigate to the Counters tab.

monitor_counters_en

Counter statuses:

  • Green: the counter is running without errors, or the number of errors doesn’t pass the acceptable threshold.

  • Yellow: the number of errors exceeds the threshold.

  • Red: the number of errors is critical.

  • Grey: the counter disabled.

Tip

You can configure the yellow and red statuses based on the portion of failed counter records and change the time window duration between two consecutive checks of the counter health status. To do so, modify the following parameters in the /etc/findface-security/config.py configuration file:

sudo vi /etc/findface-security/config.py

FFSECURITY = {
    ...
    # Counter health status config:
    # max percent of camera records with errors
    'MAX_COUNTER_ERROR_RECORDS': {'yellow': 0.3, 'red': 0.5},
    # time window for computing health status (in seconds)
    'COUNTER_HEALTH_STATUS_TIME_WINDOW': 30,
    ...
}

Work with Counter Records

Static screenshots taken by a counter, with the number of faces, bodies and cars in them, are saved as counter records. If you have enabled the distance measurement, each record will also contain a minimum, average, and maximum detected distance in meters.

If the counter is running with errors, the system will be creating blank records with an error message.

To see the counter records, navigate to the Counters tab. Click on any column for the counter, except ID (leads to the counter settings).

counter_records_en

You can scale the screenshots by clicking on them. If distanse measurement is enabled, the screenshot will contain boxes around bodies and the distance between them.

counter_scale_en

To work with counter records, use the following filters:

  • Counter

  • Cameras

  • Camera groups

  • Time

  • Number of faces in record

  • Number of bodies in record

  • Number of cars in record

  • Record id

  • Minimum distance

  • Maximum distance

  • Average distance

Set Webhook for Counter

To take it up a notch, configure a webhook for counter records with a specific number of faces, bodies and cars.

Configure Counters

To configure counters, open the /etc/findface-security/config.py configuration file and modify the following parameters:

  • COUNTERS_DEDUP_OPTIONS: a set of options that help avoid object duplication in multi-camera counters, i.e., the situation when the same object is counted on several cameras at the same time, leading to the overly increased counting result. Two options are available for each object type (face, body, car): enabled - enables object deduplication, threshold - defines the minimum level of similarity between objects for the system to consider them duplicates.

  • COUNTERS_SAVE_FULLFRAME determines saving options of full frames in counters: always, detect - only save if faces, bodies or cars 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.

sudo vi /etc/findface-security/config.py

# deduplicate objects on multi-camera counters
 'COUNTERS_DEDUP_OPTIONS': {
     'face': {
         'enabled': False,
         'threshold': 0.723,  # model: [kiwi_320]
     },
     'body': {
         'enabled': False,
         'threshold': 0.65,  # model: [andariel]
     },
     'car': {
         'enabled': False,
         'threshold': 0.65,  # model: [alonso]
     },
},
# counters full frame saving options:
# `always` - save always
# `detect` - save only if faces or bodies 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,
...

Be sure to restart the findface-security service after making changes.

sudo systemctl restart findface-security.service