Integration with Remote Facial Recognition Systems

You can integrate your FindFace instance with remote facial recognition systems. In this case, the server known as a puppeteer will be pushing records designated for remote alerting to remote servers known as puppets. In return, it will be receiving recognition events matching with those records.

This functionality has a large scope of possible applications. One course is tracking offenders’ location and routes and detecting alleged accomplices. Another one is finding missing people. The results are especially great if applied to Public and Transport Safety systems with thousands of cameras.

The current version supports only integration with facial recognition systems from the FindFace family.

In this section:

Sync Schedule

The data between a puppeteer and a puppet are synced in the following way:

  • The puppeteer delivers designated records to the puppet with an interval specified in the REMOTE_MONITORING_SYNC_INTERVAL parameter (see configuration below).

  • The puppet delivers matching recognition events to the puppeteer as soon as they appear.

Configure Puppeteer

To configure your FindFace instance to be a puppeteer, do the following:

  1. Open the /etc/findface-security/config.py configuration file. Make sure that the EXTERNAL_ADDRESS parameter is filled.

    sudo vi /etc/findface-security/config.py
    
    EXTERNAL_ADDRESS = 'http://192.168.0.4'
    
  2. Find the Puppeteer section.

    # ============== Puppeteer ===============
    # INSTALLED_APPS.append('ffsecurity_puppeteer')
    
    # PUPPETEER_CONFIG = {
    #     'UNSAVED_RESULTS_DELETION_TIMEOUT': 3600,        # maximum lifetime of search results not saved involuntarily
    #     'REMOTE_MONITORING_SYNC_INTERVAL': 600,          # monitoring data synchronization interval, seconds
    #     'REMOTE_MONITORING_EVENTS_MAX_AGE': 30,          # monitoring events older than this  number of days will be
    #                                                      # automatically deleted (every night at 1:17 am by default)
    #     'ENABLE_DAILY_SEARCH': False,                    # daily search activation (default False)
    #     'DAILY_SEARCH_PUSH_HOUR': 2,                     # daily search cards synchronization hour
    #     'DAILY_SEARCH_PULL_HOUR': 6,                     # hour in which results of daily search will be obtained
    #     'puppets': [
    #         {
    #             'id': 'first_puppet',                    # puppet ID
    #             'url': 'http://1.1.1.1:8010/',           # puppet URL
    #             'token': 'first_puppet_token',           # use pwgen -s 64 1 (should match the token in puppet)
    #             'facen_model': 'mango_320'           # face model in puppet
    #         },
    #         {
    #             'id': 'second_puppet',
    #             'url': 'http://1.1.1.1:8010/',
    #             'token': 'second_puppet_token',
    #
    #              # if remote installation has a different face model than the one used in FFSecurity -
    #              # you need to specify its name and ExtractionAPI URL where the corresponding face model is specified
    #             'facen_model': 'grapefruit_480',
    #             'extractor': 'http://127.0.0.1:18667',
    #         },
    #     ]
    # }
    #
    
  3. Uncomment the section as shown in the example below and specify the following parameters:

    • REMOTE_MONITORING_SYNC_INTERVAL: interval in seconds with which the puppeteer sends designated records to a puppet.

    • REMOTE_MONITORING_EVENTS_MAX_AGE: remote alerts older than this number of days will be automatically deleted on the puppeteer (every night at 1:17 a.m. by default).

    • puppets -> id: a puppet ID.

    • puppets -> url: IP address and port of a puppet’s principal server.

      Specify the port as follows:

      • Leave the default port as is if the puppet represents a public or transport safety system (i.e., it has the public-security service at its core).

      • Switch the default port to 80 or do not specify it at all if the puppet is based on the findface-security service (i.e., with FindFace Security or FindFace Multi installed).

    • puppets -> token: token for mutual authentication between the puppeteer and a puppet.

      Tip

      Use the following command to generate a random token.

      pwgen -s 64 1
      
    • puppets -> facen_model: neural network model used on a puppet for face recognition.

    • puppets -> extractor: IP address and port of the biometric data extraction service on a puppet if the neural network model for face recognition on the puppet differs from that on the puppeteer.

    Leave other parameters in the section commented out.

    # ============== Puppeteer ===============
    INSTALLED_APPS.append('ffsecurity_puppeteer')
    
    PUPPETEER_CONFIG = {
    #   'UNSAVED_RESULTS_DELETION_TIMEOUT': 3600,        # maximum lifetime of search results not saved involuntarily
        'REMOTE_MONITORING_SYNC_INTERVAL': 600,          # monitoring data synchronization interval, seconds
        'REMOTE_MONITORING_EVENTS_MAX_AGE': 30,          # monitoring events older than this  number of days will be
    #                                                      # automatically deleted (every night at 1:17 am by default)
    #     'ENABLE_DAILY_SEARCH': False,                    # daily search activation (default False)
    #     'DAILY_SEARCH_PUSH_HOUR': 2,                     # daily search cards synchronization hour
    #     'DAILY_SEARCH_PULL_HOUR': 6,                     # hour in which results of daily search will be obtained
        'puppets': [
            {
                'id': '1',                    # puppet ID
                'url': 'http://192.168.0.5:8010/',           # puppet URL
                'token': '1234567890',           # use pwgen -s 64 1 (should match the token in puppet)
                'facen_model': 'mango_320'           # face model in puppet
            },
            {
                'id': '2',
                'url': 'http://192.168.0.6:8010/',
                'token': '0987654321',
                'facen_model': 'grapefruit_480',
                'extractor': 'http://192.168.0.6:18667',
    
    #
    #              # if remote installation has a different face model than the one used in FFSecurity -
    #              # you need to specify its name and ExtractionAPI URL where the corresponding face model is specified
            },
        ]
    }
    
  4. Restart the findface-security service.

    sudo systemctl restart findface-security.service
    
  5. Perform migration and re-create user groups to have enough permissions for working with data from puppets.

    sudo findface-security migrate
    sudo findface-security create_groups
    

Configure Puppet

To configure a remote FindFace instance to be a puppet, do the following:

  1. Open the /etc/findface-security/config.py configuration file. Make sure that the EXTERNAL_ADDRESS parameter is filled.

    sudo vi /etc/findface-security/config.py
    
    EXTERNAL_ADDRESS = 'http://192.168.0.5'
    
  2. Find the Vns section.

    # ================= Vns ==================
    # A plugin for using FindFace Security as a puppeteer server
    # INSTALLED_APPS.append('ffsecurity_vns')
    
    # VNS_CONFIG = {
    #     'USERS': {
    #         'user1': 'token1',
    #         'user2': 'token2'
    #     },
    #     'MONITORING_THRESHOLD': 0.75,
    #     'DAILY': {
    #         'ENABLED': False,
    #         'THRESHOLD': 0.75,
    #         'START_TIME': "00:00:00"
    #     }
    # }
    
  3. Uncomment the section as shown in the example below and specify the following parameters:

    • token: token for mutual authentication between the puppet and a puppeteer. You can specify several users and tokens if the puppet is communicating with several puppeteers. You can leave the user names as is.

    • MONITORING_THRESHOLD: confidence threshold in face recognition events sent to a puppeteer.

    Leave other parameters in the section commented out.

    # ================= Vns ==================
    # A plugin for using FindFace Security as a puppeteer server
    INSTALLED_APPS.append('ffsecurity_vns')
    
    VNS_CONFIG = {
        'USERS': {
           'user1': '1234567890'
        },
        'MONITORING_THRESHOLD': 0.75,
    #    'DAILY': {
    #        'ENABLED': False,
    #        'THRESHOLD': 0.75,
    #        'START_TIME': "00:00:00"
    #    }
    }
    
  4. Restart the findface-security service.

    sudo systemctl restart findface-security.service
    
  5. Perform migration to sync with puppeteers.

    sudo findface-security migrate
    

Remote Alerting and Remote Search on Puppeteer

See Remote Alerting and Remote Search