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:
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.
After a successful SmartFace Platform installation, ensure that MS SQL Server and RabbitMQ are reachable from the machine on which Nx Witness is hosted:
Create the new RabbitMQ user for remote connection
- Create a new user (The default guest user is available only locally).
- Add the created user to the required virtual host named /.Enable remote MS SQL connection
For more information, see How to configure remote access and connect to a remote SQL Server instance with ApexSQL tools.
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
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
Download the SmartFace analytics plugin from our Customer Portal and unzip.
- On Windows copy the
.dll
file to{NxInstallPath}\plugins\
usually onC:\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:- On Windows copy the
(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/
- On Windows usually in
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!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
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.
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.Download and unzip SmartFace_Binaries_Package_v5_4.17.zip from our CRM portal (for the old CRM portal please visit the old CRM)
- 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
andRabbitMQ.Port
to the values you have set during the SmartFace installation.
- 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.
- Configure the SmartFace Camera service with the MS SQL Server connection string and RabbitMQ address and credentials. This is performed by modifying the
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.htmlThe 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 eithercpu_remote
orgpu_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.
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 onlocalhost: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.