Configuration
The values of all Image API configuration parameters listed in this section are configured in the configuration file ./cfg/image-api.values.yaml.
After editing the file, save it and update Image API in the cluster using the command:
./cli.sh image-api install
Basic settings
Field name | Functions |
image_pull_policy | The parameter affects pulling (downloading) container images from registry to deploy an Image API deployment instance. The following field values are available:
|
processing.services[*].configs[*].use_avx2 | Using the AVX2 instructions allows to speed up the recognizers. |
processing.services[*].configs[*].use_cuda | The field value indicates the graphics card usage by the service. This option is available for face-detector-template-extractor. |
processing.services.[*].replicas | Value of service replicas |
processing.services[*].configs[*].downscale_ rawsamples_to_preferred_size | When 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_ingress | This parameter enables proxying to image-api services via ingress. |
processing.enable_resource_management | This parameter enables the use of pod resource management in the cluster. |
processing.enable_hpa | This parameter enables Horizontal Pod Autoscaler for deployments. Needs metric-server to be installed. |
processing.enable_node_selector | This parameter activates the use of designated nodeSelectors in pods. The labels must be assigned to cluster nodes using the command:
|
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.
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.
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:
Service | Modules |
face-detector-face-fitter |
|
body-detector |
|
age-estimator |
|
emotion-estimator |
|
gender-estimator |
|
mask-estimator |
|
face-detector-liveness-estimator |
|
verify-matcher |
|
face-detector-template-extractor |
|
quality-assessment-estimator |
|
template-extractor |
|
liveness-estimator |
|
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