Skip to content

Validation

Before the IDLive Face Server processes the image, it validates if the image satisfies the necessary requirements. Some of these validations are optional, and others can be adjusted.

Face occlusion detection

Controls whether to validate if a face is not occluded. If it is occluded the FACE_IS_OCCLUDED error will be thrown. Allowed values are 0 (disabled) and 1 (enabled). Enabled by default.

docker run --env FACESDK_ENABLE_FACE_OCCLUSION_DETECTION=1 ...

Closed eyes detection

Controls whether to validate if eyes on a face were not closed. If they were closed the EYES_CLOSED error will be thrown. Allowed values are 0 (disabled) and 1 (enabled). Disabled by default.

docker run --env FACESDK_ENABLE_CLOSED_EYES_DETECTION=0 ...

Note

Only pipelines added in version 1.31 and later support closed eyes detection.

Validation parameters

You can adjust the validation parameters with the FACESDK_VALIDATION_PARAMETERS environment variable:

docker run --env FACESDK_VALIDATION_PARAMETERS='{"min_face_size":350,"min_face_size_relative":0.4}' ...

It should contain a JSON with the parameters you want to override. Available parameters are:

  • min_face_size – Minimal width and height of the face box, in pixels.

  • min_face_size_relative – Minimal relative width and height of the face box, as a ratio of the face's width and height to the image's width and height. Defined as a value between 0 and 1. For example, if the value is 0.25, one side of the face box should be at least a quarter of the image's corresponding side.

  • detectable_face_size_relative – Similar to the parameter above, but if the size of the face box is smaller than the value, the face is just being skipped. It is used as a filter for small faces in the background.

  • min_pupillary_distance – Minimal distance between the pupils on the face, in pixels.

  • min_face_padding – Minimal distance from the image's border to the face box, in pixels.

  • max_roll – Max roll angle of the head, in degrees.

  • max_yaw – Max yaw angle of the head, in degrees.

  • max_pitch – Max pitch angle of the head, in degrees.

Parameter names before 1.41

Before version 1.41 some parameters had different names:

New name Old name
detectable_face_size_relative detectable_face_size_threshold
min_pupillary_distance min_intpup_dist
min_face_padding face_padding

You can still use the old names if necessary.

Note that values lower than the default ones will lead to less images being rejected, but the accuracy might degrade for such images.

Configuration files

Alternative way to adjust the validation parameters is to edit the configuration file located at /app/data/preprocessing/face_params.conf. You need to replace the file stored in the container with the edited one:

docker run -v /etc/idliveface/face_params.conf:/app/data/preprocessing/face_params.conf ...

Note that the edited file should contain all parameters, not only the updated ones. Use this file as a template:

face_params.conf
use_same_cfg_for_all_meta = false

UNKNOWN {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
}

DESKTOP {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.075
    min_face_size_relative = 0.15
}

ANDROID {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
}

IOS {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
}

Download

Legacy pipelines

Older pipelines used different configuration files:

  • data/preprocessing/b0.conf for Heron pipeline.
  • data/preprocessing/jupiter_preprocessing.conf for Theia, Dionysus and Hephaestus pipelines.
jupiter_preprocessing.conf
use_same_cfg_for_all_meta = false

UNKNOWN {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25 
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
    face_occlusion_threshold = 0.85
}

DESKTOP {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.075
    min_face_size_relative = 0.15
    face_occlusion_threshold = 0.85
}

ANDROID {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
    face_occlusion_threshold = 0.85
}

IOS {
    min_intpup_dist = 80
    min_face_size = 224
    face_padding = 25
    detectable_face_size_threshold = 0.15
    min_face_size_relative = 0.25
    face_occlusion_threshold = 0.85
}

Download

b0.conf
min_intpup_dist = 80
min_face_size = 224
face_padding = 25
face_occlusion_threshold = 0.85
detectable_face_size_threshold = 0.15

Download