Update to FindFace Multi 1.2

Tip

If you use our product FindFace Security deployed on Ubuntu 18.04, upgrade it to FindFace Multi 1.0 and then update it to FindFace Multi 1.2.

To update FindFace Multi from earlier versions to 1.2, do the following:

  1. Open the /etc/findface-security/config.py (/etc/ffsecurity/config.py) configuration file. Save the values of the following parameters for later use: EXTERNAL_ADDRESS, SECRET_KEY, VIDEO_DETECTOR_TOKEN, ROUTER_URL.

    sudo vi /etc/findface-security/config.py
    
    EXTERNAL_ADDRESS = "http://172.20.77.58"
    
    ...
    # use pwgen -sncy 50 1|tr "'" "." to generate your own unique key
    SECRET_KEY = 'c8b533847bbf7142102de1349d33a1f6'
    
    FFSECURITY = {
       'VIDEO_DETECTOR_TOKEN': '381b0f4a20495227d04185ab02f5085f',
       ...
       'ROUTER_URL': 'http://172.20.77.58',
       ...
    }
    
  2. In FindFace Multi 1.2, we significantly refined the internal structure of the report entity. However, it misses backward compatibility with the product earlier versions. Before the update, be sure to download all the reports that you need from the Reports tab. They can later be used as the samples to recreate the previously existing reports in the updated system.

  3. Stop the findface-security service.

    sudo systemctl stop findface-security*.service
    
  4. Create a backup of the Tarantool-based feature vector database in any directory of your choice, for example, /etc/findface_dump.

    sudo mkdir -p /etc/findface_dump
    cd /etc/findface_dump
    sudo findface-storage-api-dump -config /etc/findface-sf-api.ini
    
  5. Install the apt repository with FindFace Multi, using the console installer as described in this section.

    Tip

    On the stage of installing neural network models (APT repository doesn't include recognition models. Do you want to install them now?), use one of the following options:

    • Choose No

    • Choose Yes and leave all the neural network models selected. Enter Done

    Take a look at the step #9 comments to decide which option suits you best.

  6. Install NATS, enable its autostart, and launch the service.

    Important

    Omit this step if updating from FindFace Multi 1.1.

    sudo apt install -y nats-server
    sudo systemctl enable nats-server
    sudo systemctl restart nats-server
    
  7. Install the FindFace Multi services from the repository, following your architecture outline.

    CPU-version:

    sudo apt update
    sudo apt install findface-security findface-security-ui findface-extraction-api findface-ntls findface-sf-api findface-tarantool-server findface-upload findface-video-manager findface-video-worker-cpu findface-counter findface-liveness-api
    

    GPU-version:

    sudo apt update
    sudo apt install findface-security findface-security-ui findface-extraction-api-gpu findface-ntls findface-sf-api findface-tarantool-server findface-upload findface-video-manager findface-video-worker-gpu findface-counter findface-liveness-api
    

    Important

    FindFace Multi on GPU requires the prior installation of NVIDIA drivers.

    Important

    At some moment, you will be prompted to choose which version of the findface-security configuration file to keep. Opt for Install the packages maintainer’s version. Do the same if such a message appears for another component (findface-extraction-api, findface-video-worker, etc.). Always prefer a newer version of a configuration file.

  8. Open the /etc/findface-security/config.py configuration file and paste the saved EXTERNAL_ADDRESS, SECRET_KEY, VIDEO_DETECTOR_TOKEN, and ROUTER_URL into it. Fill in the DATABASES section by analogy: 'PORT': 5439, 'USER': 'ntech', 'PASSWORD': '9T3g1nXy9yx3y8MIGm9fbef3dia8UTc3' (password from /etc/pgbouncer/userlist.txt).

    sudo vi /etc/findface-security/config.py
    ...
    # Database is used by FindFace Security to store cameras,
    # camera groups, watchlists and so on. Only PostgreSQL is supported.
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'DISABLE_SERVER_SIDE_CURSORS': True,
            'NAME': 'ffsecurity',
            'PORT': 5439, 'USER': 'ntech', 'PASSWORD': '9T3g1nXy9yx3y8MIGm9fbef3dia8UTc3',
        }
    }
    ...
    # Use pwgen -sncy 50 1|tr "'" "." to generate your own unique key
    SECRET_KEY = '002231ccb690586f4d33e98322c591bb'
    ...
    SERVICE_EXTERNAL_ADDRESS = 'http://172.20.77.58'
    # EXTERNAL_ADDRESS is used to access objects created inside FFSecurity via external links.
    EXTERNAL_ADDRESS = 'http://172.20.77.58'
    ...
        # findface-video-worker authorization token
        'VIDEO_DETECTOR_TOKEN': '8977e1b0067d43f6c908d0bf60363255',
    ...
        # findface-video-worker face posting address,
        # it must be set to either FFSecurity EXTERNAL_ADDRESS (by default)
        # or findface-facerouter url (in some specific cases)
        'ROUTER_URL': 'http://127.0.0.1:80',
    
  9. Open the old version of the findface-ntls configuration file available at /etc/findface-ntls.cfg.dpkg-old and check it against the new version /etc/findface-ntls.cfg. Move all the custom parameters from the old version to the new one. Do the same for other components, e.g. for findface-extraction-api, check /etc/findface-extraction-api.ini.ucf-old against /etc/findface-extraction-api.ini, etc.

    sudo vi /etc/findface-ntls.cfg.dpkg-old
    sudo vi /etc/findface-ntls.cfg
    sudo vi /etc/findface-extraction-api.ini.ucf-old
    sudo vi /etc/findface-extraction-api.ini
    
    ...
    

    Important

    Be aware that the new version of the findface-extraction-api configuration file by default contains the liveness.colombo model that was absent in the product older versions. This can potentially cause the system to fail. Use one of the following ways to prevent the failure:

    • Revert the face_liveness parameter to the previous value: liveness.alleyn.v2.cpu.fnk/liveness.alleyn.v2.gpu.fnk

    • Install liveness.colombo.cpu.fnk/liveness.colombo.gpu.fnk on the step #5

  10. Open the new version of the /etc/findface-video-worker-cpu.ini (/etc/findface-video-worker-gpu.ini) configuration file. In the streamer section, set tracks = true and tracks_last = true to ensure bboxes on the Video Wall are appropriately displayed.

    sudo vi /etc/findface-video-worker-cpu.ini
    sudo vi /etc/findface-video-worker-gpu.ini
    
    [streamer]
    #------------------------------
    ...
    
    ## use tracks instead detects for streamer
    ## type:bool env:CFG_STREAMER_TRACKS longopt:--streamer-tracks
    tracks = true
    
    ## use tracks with lastFrameId=currentFrameId (.tracks must be true)
    ## type:bool env:CFG_STREAMER_TRACKS_LAST longopt:--streamer-tracks-last
    tracks_last = true
    
  11. Restart the services.

    sudo systemctl restart findface-ntls findface-extraction-api findface-video-worker* findface-video-manager findface-sf-api findface-counter findface-liveness-api
    
  12. Modify the Tarantool database structure by applying the tnt_schema.lua file from FindFace Multi.

    sudo findface-security make_tnt_schema | sudo tee /etc/findface-security/tnt_schema.lua
    
  13. Stop the findface-tarantool-server shards. Purge data from all the directories relevant to active shards.

    sudo systemctl stop 'tarantool@*'
    
    sudo rm /opt/ntech/var/lib/tarantool/shard-*/{index,snapshots,xlogs}/*
    
  14. Navigate to the directory with Tarantool configuration file(s) /etc/tarantool/instances.available/. Check whether each configuration file shard-*.lua contains the dofile command, meta_indexes and meta_scheme definitions, as in the example below.

    sudo vi /etc/tarantool/instances.available/shard-*.lua
    
    ...
    dofile("/etc/findface-security/tnt_schema.lua")
    ...
    FindFace.start("127.0.0.1", 8101, {
        license_ntls_server="127.0.0.1:3133",
        meta_indexes=meta_indexes,
        meta_scheme = meta_scheme
    })
    
  15. Restart the findface-tarantool-server shards.

    TNT=$(ls /etc/tarantool/instances.enabled/ | cut -c 7,8,9)
    for i in $TNT; do sudo systemctl restart tarantool@shard-$i.service ; done
    
  16. Restore the Tarantool database from the backup.

    cd /etc/findface_dump
    
    for x in *.json; do sudo findface-storage-api-restore -config /etc/findface-sf-api.ini < "$x"; done
    
  17. Migrate the main database architecture from FindFace Multi to PostgreSQL, re-create predefined user roles and the first administrator.

    sudo findface-security migrate
    sudo findface-security create_groups
    sudo findface-security create_default_user
    
  18. Restart the findface-security and nginx services.

    sudo systemctl restart findface-security.service nginx.service
    
  19. Recreate the previously existing reports.

    Important

    The following tabs got evolved and renamed in FindFace Multi 1.2:

    • Dossiers got evolved into Cards

    • Episodes became Episodes -> Humans

    • Persons got evolved into Clusters

Important

We highly recommend disabling the Ubuntu automatic update to preserve the FindFace Multi compatibility with the installation environment. In this case, you will be able to update your OS manually, fully controlling which packages to update.

To disable the Ubuntu automatic update, execute the following commands:

sudo apt-get remove unattended-upgrades
sudo systemctl stop apt-daily.timer
sudo systemctl disable apt-daily.timer
sudo systemctl disable apt-daily.service
sudo systemctl daemon-reload

Note

You can additionally deploy Video Recorder. See Deploy Video Recorder Step-by-Step.