Installation of Nx Witness integration

For the proper functioning of the integration, it is required to install SmartFace Platform, Nx Witness VMS and the SmartFace analytics plugin. SmartFace Platform and Nx Witness VMS should be successfully installed and configured before you start to install the integration components.

The Nx Witness VMS can be installed on the same machine as the SmartFace Platform, or on a separate machine. We recommend installing SmartFace Platform and Nx Witness server on separate machines. Please consider which option you choose based on your hardware infrastructure.

Instructions which describe both options can be found in these chapters:

⚠️ SmartFace Platform and Nx Witness VMS are resource intensive, therefore installing full SmartFace Platform alongside Nx Witness VMS on the same machine is not recommended. We recommend running only the SmartFace Camera services on the same machine as Nx Witness server. SmartFace Camera services are lightweight and they process raw frames coming from Nx Witness server which produces raw frame data. Having SmartFace Camera on same machine as Nx Witness would ensure the data isn’t sent across the network, potentially limiting the throughput. A single Full HD raw frame is ~6.2 MB, so at 30 FPS one camera processing takes ~186 MB/s of network traffic, which may cause network contention and slow down the video processing performed by SmartFace.

To install and configure SmartFace integration with Nx Witness on a single machine, follow these steps:

Install SmartFace Platform

Install the SmartFace Platform. For information on how to install SmartFace Platform, see Installation on Windows or Installation on Linux.

⚠️ In the step of Camera setup configuration, you should choose the number of slots according to the number of Nx cameras which need to be processed.

After a successful SmartFace Platform installation, ensure that MS SQL Server and RabbitMQ are reachable from the machine on which Nx Witness is hosted:

Install Nx Witness VMS

Install the Nx Witness VMS v5.X or later. You will need both Server and Client, as the Client will be used in configuration. Client should be typically installed on VMS operator’s machine.

Install and configure the integration components

  1. Stop the Nx Witness server

    • On Windows by right-clicking the tray icon and selecting Stop Server.
    • On Linux (Ubuntu) with sudo service networkoptix-mediaserver stop
  2. Download the SmartFace analytics plugin from our Customer Portal and unzip.

    • On Windows copy the .dll file to {NxInstallPath}\plugins\ usually on C:\Program Files\Network Optix\Nx Witness\MediaServer\plugins. See bellow:

    - On Linux - create folder `smartface_analytics_plugin` inside the `{NxInstallPath}/bin/plugins` usually on `/opt/networkoptix/mediaserver/bin/plugins` - copy `.dll` into this folder. See bellow:

  3. (optional) In case you would like to brand the plugin with your own labels, specify the plugin white labeling, i:

    • Create sf_plugin_branding.json file in the installation path of Nx Witness server

      • On Windows usually in C:\Program Files\Network Optix\Nx Witness\MediaServer\
      • On Linux in /opt/networkoptix/mediaserver/
    • Use formatting of sf_plugin_branding.json file below:

    {
        "product_name": "SmartFace Platform",
        "plugin_name": "SmartFace analytics plugin",
        "vendor_name": "Innovatrics"
    }
    
    • Change labels for your desired branding
    📢 It is important to create the branding file with branding changes prior to the first start of Nx Witness server with SmartFace analytics plugin. Otherwise you won't be able to change the branding of the plugin anymore. When plugin is loaded for the first time Nx Witness caches a plugin information about the branding into the database which can not be modified later on without an uninstallation of Nx Witness!
  4. Start the Nx Witness VMS.

    • On Windows by right-clicking the tray icon and selecting Start Server.
    • On Linux (Ubuntu) with sudo service networkoptix-mediaserver start
  5. In the left panel, right-click the camera you want to process with SmartFace and select Camera Settings. In the Plugins tab, enable the SmartFace analytics plugin .

    Repeat the step for each camera that you want to process with SmartFace.

  6. In the Camera Settings of the analytics plugin, set a unique port for each camera that should be processed by SmartFace. We recommend to start from port 4000. This is a TCP port which is used for a communication between the Nx Witness plugin and SmartFace Camera services.

    • On Windows by right-clicking the tray icon and selecting Start Server.

    • On Linux (Ubuntu) use named hostname. In this sample we deploy SmartFace alongside NX Witnes on host named nx-1u

  7. Download and unzip SmartFace_Binaries_Package_v5_4.17.zip from our CRM portal (for the old CRM portal please visit the old CRM)

    1. Configure the SmartFace Camera service with the MS SQL Server connection string and RabbitMQ address and credentials. This is performed by modifying the SmartFace.appsettings.json file:
    • Configure the MS SQL connection string under the key ConnectionStrings.CoreDbContext to the value you have set during the SmartFace installation.

    • Configure the RabbitMQ under the keys RabbitMQ.Username, RabbitMQ.Password, RabbitMQ.VirtualHost, RabbitMQ.Hostname and RabbitMQ.Port to the values you have set during the SmartFace installation.

    1. To start the SmartFace Camera service for each Nx Witness camera that you want to process with SmartFace:
    • Run the Service_Installer.bat script as an administrator.

    • When prompted to enter service you would like to install, insert camera.

    • For the service name of the SmartFace Camera Service on Nx Witness server, enter the Nx ID (UUID) of the Nx Witness camera that you want to process. To obtain the Nx ID: Go to Camera Setting (right-click on a particular camera) and under the General tab, select More info. Then, copy the Nx ID from the Camera ID field.

  8. Create a camera using the SmartFace API, hosted on the server where SmartFace Platform is installed

    • SmartFace Platform is managed through the API. By default, the API is hosted on port 8098 and Swagger UI is available on localhost:8098/index.html

    • The endpoint to create the camera is POST /api/v1/Cameras. To find it in Swagger UI, go to the Camera section, open the POST call and click Try it out. Delete the prefilled request body and then fill it according to the following Example request body:

        {
            "serviceName": "338ef68-e0e6-c775-9459b244c102",
            "name": "My camera",
            "source": "sfcam://localhost:4000",
            "enabled": true,
            "faceDetectorResourceId": "cpu_remote",
        }
    
    • Set the serviceName property to the Nx camera ID. The instructions on how to obtain the Nx ID are described above. This step binds the SmartFace Camera service with the camera created on the API.

    • Set the name property as an arbitrary string used to identify the camera.

    • Set the source property to the custom string in the format sfcam://<host>:<port>. For example, sfcam://localhost:4000 where:

      <host> is the address (IPv4 or hostname) of the machine where Nx Witness is hosted. As the Nx Witness and Camera services should be hosted on the same machine, localhost should suffice.

      <port> is the TCP communication port which you have set up in the Nx Witness camera plugin settings.

    • Preferably, set the remote detection for the SmartFace Camera service as follows: set the FaceDetectorResourceId to either cpu_remote or gpu_remote, depending on whether you want to use GPU.

    • (Optional) Configure other camera parameters depending on your requirements.

    • To send the request, click Execute.

    When the SmartFace camera is enabled, then the video processing should be running and face objects should be available in Nx Witness.

  9. Create a camera using the SmartFace API:

    • SmartFace Platform is managed through the API. By default, the API is hosted on port 8098 and Swagger UI is available on localhost:8098/index.html.

    • The endpoint to create the camera is POST /api/v1/Cameras. To find it in Swagger UI, go to the Camera section, open the POST call and click Try it out. Delete the prefilled request body and then fill it according to the following Example request body:

        {
            "name": "My camera",
            "source": "sfcam://localhost:4000",
            "enabled": true,
        }
    
    • Set the name property as an arbitrary string used to identify the camera.

    • Set the source property to the custom string in the format sfcam://<host>:<port> . For example, sfcam://localhost:4000 where:

    • <host> is the address (IPv4 or hostname) of the machine where Nx server is hosted as accessible from the SmartFace Camera service. In most cases the value localhost should suffice.

    • <port> is the TCP communication port that you have set in the Nx Witness camera plugin settings.

    • (Optional) Configure other camera parameters depending on your requirements.

    • To send the request, click Execute .

When the SmartFace camera is enabled, then the video processing should be running and face objects should be available in Nx Witness.