Skip to main content
Version: 2.2.0

Configuration

The values of all Image API configuration parameters listed in this section are configured in the configuration file ./cfg/image-api.values.yaml.

ATTENTION!

After editing the file, save it and update Image API in the cluster using the command:

./cli.sh image-api install

Basic Settings

Field NameFunctions
image_pull_policyThe parameter affects pulling (downloading) container images from registry to deploy an Image API deployment instance. The following field values are available:
  • Always - kubelet (node agent in Kubernetes) pulls an image from registry.
  • Never - image pulling from registry is not applicable. If the image is already present locally, kubelet attempts to launch a container, otherwise, startup fails.
  • IfNotPresent - image is pulled only if it isn’t present locally.
processing.services[*].configs[*].use_avx2Using the AVX2 instructions allows to speed up the recognizers.
processing.services[*].configs[*].use_cudaThe field value indicates the graphics card usage by the service. This option is available for face-detector-template-extractor.
processing.services.[*].replicasValue of service replicas.
processing.services[*].configs[*].downscale_ rawsamples_to_preferred_sizeWhen field is enabled, each sample is downscaled to the suitable size to reduce memory consumption. However, the system performance decreases. It is recommended to leave this field disabled.
processing.enable_ingressThis parameter enables proxying to image-api services via ingress.
processing.enable_resource_managementThis parameter enables the use of pod resource management in the cluster.
processing.enable_hpaThis parameter enables Horizontal Pod Autoscaler for deployments. Needs metric-server to be installed.
processing.enable_node_selectorThis parameter activates the use of designated nodeSelectors in pods. The labels must be assigned to cluster nodes using the command:
kubectl label nodes <node_name> type=<type>
  • "type": "processing" - node for calculations
  • "type": "generic" - generic node

Face Detection and Matching

Image API services use a set of objects and processing blocks that implement the functionality of Face SDK - a set of code libraries for development of facial recognition solutions:

  • capturer: face detection
  • recognizer: face matching
  • block: processing block:
    • AGE_ESTIMATOR: processing block used to determine person's age
    • EMOTION_ESTIMATOR: processing block used to determine person's emotions
    • GENDER_ESTIMATOR: processing block used to determine person's gender
    • LIVENESS_ESTIMATOR: processing block used to estimate liveness
    • MASK_ESTIMATOR: processing block used to detect a medical mask
    • QUALITY_ASSESSMENT_ESTIMATOR: processing block used to estimate image quality

You can configure object and/or processing block in the ./cfg/image-api.values.yaml file in the specific service block in the configs attribute.

Object fields:

  • name: name of Face SDK configuration file.
  • params: parameters to be overridden in this configuration.

Processing block fields:

  • unit_type - name of processing block, for example, AGE_ESTIMATOR.
  • modification - modification of processing block.
  • version - version of processing block.

For more information about objects and processing blocks, see 3DiVi Face SDK documentation.

Detection Settings
  • processing.services[*].configs[*].capturer.name

The field value indicates the name of the configuration file of the selected face detector. When installing Image API, the default is common_capturer_uld_fda.xml (ULD detector configuration file used to detect faces of different sizes, including masked faces).

This configuration file can be replaced with another one, specially configured for one of the use cases: Safe City, Remote Identification, ACS (Cooperative / Non-Cooperative recognition).

For more information about detectors and configuration files, see 3DiVi Face SDK documentation.

note

The same detector configuration file must be specified for all services that use the capturer object.

Face Matching Settings
  • processing.services[*].configs[*].recognizer.name

The field value specifies the name of the recognizer configuration file. Each recognizer uses a specific recognition method. In total, Face SDK provides several recognition methods that differ in characteristics of recognition accuracy and operating time.

For Image API, you can specify the following recognizer configuration files:

  • method11v1000_recognizer.xml
  • method12v30_recognizer.xml
  • method12v50_recognizer.xml
  • method12v100_recognizer.xml
  • method12v1000_recognizer.xml

For more information about recognizers, facial recognition methods and recognizer configuration files, see 3DiVi Face SDK documentation.

note

The same recognizer configuration file must be specified for all services that use the recognizer object.

Module Selection

Module is an implementation variant of Image API service. Some services will have multiple modules available for selection in the future.

To change the module, find a certain service config in processing.services in ./cfg/image-api.values.yaml and change the value for module field.

Example: config of quality-assessment-estimator:

quality-assessment-estimator:
…………
module: quality-assessment-estimator
…………

List of available modules for each Image API service:

ServiceModules
face-detector-face-fitter
  • face-detector-face-fitter - standard module
body-detector
  • body-detector - standard module
age-estimator
  • age-estimator - standard module
emotion-estimator
  • emotion-estimator - standard module
gender-estimator
  • gender-estimator - standard module
mask-estimator
  • mask-estimator - standard module
face-detector-liveness-estimator
  • face-detector-liveness-estimator - standard module
verify-matcher
  • verify-matcher - standard module
face-detector-template-extractor
  • face-detector-template-extractor - standard module
quality-assessment-estimator
  • quality-assessment-estimator - standard module
template-extractor
  • template-extractor - standard module
liveness-estimator
  • spoofing-estimator - standard liveness estimation module (used to accurately detect spoofing attacks)
  • liveness-estimator - liveness estimation module

Scalability

When the load increases, for stable operation of Image API you can manually scale the deployments described in para. Install Image API to the Cluster.

To scale the installed release, run the command below:

$ kubectl scale deployment <deployment_name> --replicas <count>

where <deployment_name> is a deployment name (for example, face-detector-face-fitter-dep), and <count> is a number of deployment replicas (pods).

To save the scaling state, set the value for replicas key in processing.services in ./cfg/image-api.values.yaml file and restart the deployment using a command below:

$ ./cli.sh image-api install