.. _architecture: ************************************* Architecture ************************************* Though you mostly interact with FindFace through its web interface, be sure to take a minute to learn the FindFace architecture. This knowledge is essential for the FindFace deployment, integration, maintenance, and troubleshooting. .. rubric:: In this chapter: .. contents:: :local: Recognition Process ================================================== FindFace detects a human face in the photo or video and prepares its image through normalization. The normalized image is then used for extracting the face's feature vector (an n-dimensional vector of numerical features that represent the face). Face feature vectors are stored in the database and further used for verification and identification purposes. Architectural Elements =============================== FindFace consists of the following fundamental architectural elements: * FindFace Core, a cutting-edge AI-based recognition technology that can be used as a separate product `FindFace Enterprise Server `_.  * FindFace Application Module, implementing a set of tools for criminal investigations based on video footage. Architecture scheme ------------------------ |architecture_en| .. |architecture_en| image:: /_static/architecture_en.png .. |architecture_ru| image:: /_static/architecture_ru.png FindFace Core ------------------------- The FindFace Core includes the following components: +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ | Component | Ports in use | Description | Vendor | +===========================+==============+======================================================================================+============================================+ | findface-extraction-api | 18666 | Service that uses neural networks to detect a face in an image and extract its | NtechLab own deployment | | | | feature vector. It also recognizes face attributes, for example, gender, age, | | | | | emotions, beard, glasses, etc. CPU- or GPU-acceleration. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-sf-api | 18411 | Service that implements the internal HTTP API for face detection and recognition. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-tarantool-server | 32001, | Service that provides interaction between the ``findface-sf-api`` service and the | | | | shard ports | feature vector database (the Tarantool-powered database that stores face | | | | (default | feature vectors). | | | | 330xx, 81xx) | | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-upload | 3333 | NginX-based web server used as a storage for original images, thumbnails, and | | | | | normalized face images. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-facerouter | 18820 | Service used to define processing directives for detected faces. In FindFace, | | | | | its functions are performed by ``findface-security`` | | | | | (see :ref:`application-module`). | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-video-manager | 18810, | Service, part of the video face detection module, that is used for managing the | | | | 18811 | video face detection functionality, configuring the video face detector | | | | | settings and specifying the list of to-be-processed video files. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-video-worker | 18999 | Service, part of the video face detection module, that recognizes a face in | | | | | the video and posts its normalized image, full frame and metadata (such as | | | | | detection time) to the ``findface-facerouter`` service for further processing | | | | | according to given directives. | | | | | CPU- or GPU-acceleration. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-ntls | 443 | License server that interfaces with the NtechLab Global License Server, a USB | | | | (TCP), | dongle, or hardware fingerprint to verify the :ref:`license ` | | | | 3133, | of your FindFace instance. | | | | 3185 | | | +---------------------------+--------------+--------------------------------------------------------------------------------------+ | | findface-counter | 18300 | Service used for event deduplication. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ | Tarantool | Shard ports | Third-party software that implements the feature vector database that stores | `Tarantool `_ | | | (default | extracted face feature vectors and identification events. The system data, | | | | 330xx, 81xx) | records, user accounts are stored in PostgreSQL | | | | | (part of the FindFace application module). | | +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ | etcd | 2379 | Third-party software that implements a distributed key-value store for | `etcd `_ | | | | ``findface-video-manager``. Used as a coordination service in the distributed | | | | | system, providing the video face detector with fault tolerance. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ | NginX | 80; | Third-party software that implements the system web interfaces. | `nginx `_ | | | SSL: 8002, | | | | | 8003, 443, | | | | | 80 | | | +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ | memcached | 11211 | Third-party software that implements a distributed memory caching system. | `memcached `_ | | | | Used by ``findface-sf-api`` as a temporary storage for extracted face | | | | | feature vectors before they are written to the feature vector database powered by | | | | | Tarantool. | | +---------------------------+--------------+--------------------------------------------------------------------------------------+--------------------------------------------+ .. _application-module: FindFace Application Module --------------------------------------------- The FindFace application module includes the following components: +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ | Component | Ports in use | Description | Vendor | +=======================+==============+=======================================================================================+============================================+ | findface-security | Configurable | Component that serves as a gateway to the FindFace Core. | NtechLab own deployment | | | | Provides interaction between the FindFace Core and the web interface, the system | | | | | functioning as a whole, HTTP and web socket, face monitoring, event | | | | | notifications, etc. | | +-----------------------+--------------+---------------------------------------------------------------------------------------+ | | findface-security-ui | Configurable | Main web interface used to interact with FindFace. | | | | | Based on the `Django framework `_. | | | | | Allows you to work with face recognition events, search for | | | | | faces, manage cases, users, record index, watch lists, and many more. | | +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ | NATS | 4222 | Third-party software that implements a message broker inside ``findface-security``. | `NATS `_ | +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ | etcd | 2379 | Third-party software that implements locks in the ``findface-security`` service, such | `etcd `_ | | | | as locks in NTLS checker, reports, video processing, etc. | | +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ | Pgbouncer | 5439 | Third-party software, a lightweight connection pooler for PostgreSQL. Optional, | `PgBouncer `_ | | | | used to increase the database performance under high load. | | +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ | PostgreSQL | 5432 | Third-party software that implements the main system database. This database stores | `PostgreSQL `_ | | | | records of individuals and data for internal use. | | | | | The face feature vectors and face identification events are stored in Tarantool | | | | | (part of the FindFace Core). | | +-----------------------+--------------+---------------------------------------------------------------------------------------+--------------------------------------------+ .. seealso:: * :ref:`storages` Single- and Multi-Host Deployment ================================== You can deploy FindFace on a single host or in a multi-host environment. If you opt for the latter, we offer you one of the following deployment schemes: * Deploy FindFace standalone and distribute additional ``findface-video-worker`` components across multiple hosts. See :ref:`video-worker-installer`. * Distribute the FindFace components across multiple hosts. If necessary, set up load balancing. See :ref:`multi-host-installation`. CPU- and GPU-acceleration ========================================== The ``findface-extraction-api`` and ``findface-video-worker`` services can be either CPU- or GPU-based. During installation from the developer-friendly :ref:`installer `, you will have an opportunity to choose the acceleration type you need. If you opt to install FindFace from the :ref:`repository package `, deploy the ``findface-extraction-api`` and ``findface-video-worker-cpu`` packages on a CPU-based server, and the ``findface-extraction-api-gpu`` and/or ``findface-video-worker-gpu`` packages on a GPU-based server. .. important:: Refer to :ref:`requirements` when choosing hardware configuration. .. important:: If video resolution is more than 1280x720px, it is strongly recommended to use the GPU-accelerated package ``findface-video-worker-gpu``.