.. _counters: ******************************************* Face and Body Counters ******************************************* .. important:: To be able to count human bodies (silhouettes), you first have to enable :ref:`body detection `. FindFace Multi allows you to count faces and bodies 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, and more. You can count objects on each camera independently or collectively on all cameras of one or several camera groups. The counting method is based on time slices, which means that the system counts faces and bodies in static screenshots taken with a given ``count interval``. The counter shows how the number of faces and bodies changes over time. .. rubric:: In this section: .. contents:: :local: Configure Counters ================================= To configure counters, open the ``/etc/findface-security/config.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 or bodies have been detected, ``never``. * ``COUNTERS_FULLFRAME_JPEG_QUALITY``: JPEG quality of full frames, * ``COUNTERS_THUMBNAIL_JPEG_QUALITY``: JPEG quality of thumbnails. .. code:: sudo vi /etc/findface-security/config.py # 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, ... Create Counter =========================== To set up a counter, do the following: #. Navigate to the :guilabel:`Counters` tab. #. Click :guilabel:`+`. |create_counter_en| .. |create_counter_en| image:: /_static/create_counter_en.png :scale: 60% .. |create_counter_ru| image:: /_static/create_counter_ru.png :scale: 60% #. Specify the counter name. |counter_en| .. |counter_en| image:: /_static/counter_en.png :scale: 60% .. |counter_ru| image:: /_static/counter_ru.png :scale: 60% #. Select one or several camera groups for counting. By default, counting will apply to all cameras within the groups. If necessary, you can disable counting on specific cameras. #. Specify the interval between two consecutive screenshots used for counting. #. Check :guilabel:`Detect Faces` to count faces. #. Check :guilabel:`Detect Silhouettes` to count bodies. Body detection has to be :ref:`enabled `. #. Make sure that the counter is :guilabel:`Active`. #. Click :guilabel:`Save`. You will see two new tabs appear. #. (Optional) Navigate to the :guilabel:`Region of Interest` tab to specify the face/body tracking region within the camera(s) field. |counter_roi_en| .. |counter_roi_en| image:: /_static/counter_roi_en.png :scale: 60% .. |counter_roi_ru| image:: /_static/counter_roi_ru.png :scale: 60% Counter Chart ==================== To see the counter chart for the last hour, 24 hours, or week, navigate to the :guilabel:`Chart` tab in the counter settings. |counter_chart_en| .. |counter_chart_en| image:: /_static/counter_chart_en.png :scale: 50% .. |counter_chart_ru| image:: /_static/counter_chart_ru.png :scale: 50% Work with Counter Records ================================= Static screenshots taken by a counter, with the number of faces and bodies in them, are saved as counter records. To see the counter records, navigate to the :guilabel:`Counters` tab. Click on any column for the counter, except ``ID`` (leads to the counter settings). |counter_records_en| .. |counter_records_en| image:: /_static/counter_records_en.png :scale: 45% .. |counter_records_ru| image:: /_static/counter_records_ru.png :scale: 45% To work with counter records, use the following filters: * Counter * Cameras * Camera groups * Time period * Number of faces in record * Number of bodies in record * Record id Set Webhook for Counter =================================== To take it up a notch, :ref:`configure a webhook ` for counter records with a specific number of faces and bodies. .. seealso:: * :ref:`bodies` * :ref:`webhooks`