iris.nodes.validators package

Submodules

iris.nodes.validators.cross_object_validators module

class iris.nodes.validators.cross_object_validators.ExtrapolatedPolygonsInsideImageValidator(min_pupil_allowed_percentage: float = 0.0, min_iris_allowed_percentage: float = 0.0, min_eyeball_allowed_percentage: float = 0.0)[source]

Bases: Algorithm

Validate that GeometryPolygons are included within the image to a certain minimum percentage.

Raises:

ExtrapolatedPolygonsInsideImageValidatorError – If the number of points of the pupil/iris/eyeball that are within the input image is below threshold.

class Parameters(*, min_pupil_allowed_percentage: ConstrainedFloatValue, min_iris_allowed_percentage: ConstrainedFloatValue, min_eyeball_allowed_percentage: ConstrainedFloatValue)[source]

Bases: Parameters

Parameters class for ExtrapolatedPolygonsInsideImageValidator objects.

min_eyeball_allowed_percentage: float
min_iris_allowed_percentage: float
min_pupil_allowed_percentage: float
run(ir_image: IRImage, extrapolated_polygons: GeometryPolygons) None[source]

Perform validation.

Parameters:
Raises:

ExtrapolatedPolygonsInsideImageValidatorError – Raised if not enough points of the pupil/iris/eyeball are within an image.

class iris.nodes.validators.cross_object_validators.EyeCentersInsideImageValidator(min_distance_to_border: float = 0.0)[source]

Bases: Algorithm

Validate that the eye center are not too close to the border.

Raises:

EyeCentersInsideImageValidatorError – If pupil or iris center are strictly less than min_distance_to_border pixel of the image boundary.

class Parameters(*, min_distance_to_border: float)[source]

Bases: Parameters

Parameters class for EyeCentersInsideImageValidator objects.

min_distance_to_border: float
run(ir_image: IRImage, eye_centers: EyeCenters) None[source]

Validate if eye centers are within proper image boundaries.

Parameters:
Raises:

EyeCentersInsideImageValidatorError – Raised if pupil or iris center is not in within correct image boundary.

iris.nodes.validators.object_validators module

class iris.nodes.validators.object_validators.IsMaskTooSmallValidator(min_maskcodes_size: int = 0)[source]

Bases: Callback, Algorithm

Validate that the masked part of the IrisTemplate is small enough.

The larger the mask, the less reliable information is available to create a robust identity.

Raises:

E.EncoderError – If the total number of non-masked bits is below threshold.

class Parameters(*, min_maskcodes_size: ConstrainedIntValue)[source]

Bases: Parameters

Parameters class for IsMaskTooSmallValidator objects.

min_maskcodes_size: int
on_execute_end(input_template: IrisTemplate, *args, **kwargs) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

input_template (IrisTemplate) – input IrisTemplate to be validated.

run(val_arguments: IrisTemplate) None[source]

Validate that the total mask codes size is above the desired threshold.

Parameters:

val_arguments (IrisTemplate) – IrisTemplate to be validated.

Raises:

E.EncoderError – Raised if the total mask codes size is below the desired threshold.

class iris.nodes.validators.object_validators.IsPupilInsideIrisValidator(**kwargs: Any)[source]

Bases: Callback, Algorithm

Validate that the pupil is fully contained within the iris.

Raises:

E.IsPupilInsideIrisValidatorError – If the pupil polygon is not fully contained within the iris polygon.

on_execute_end(result: GeometryPolygons) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

result (GeometryPolygons) – GeometryPolygons resulted from computations.

run(val_arguments: GeometryPolygons) None[source]

Validate if extrapolated pupil polygons are withing extrapolated iris boundaries.

Parameters:

val_arguments (GeometryPolygons) – Computed result.

Raises:

E.IsPupilInsideIrisValidatorError – Raised if the pupil polygon is not fully contained within the iris polygon.

class iris.nodes.validators.object_validators.OcclusionValidator(min_allowed_occlusion: float = 0.0)[source]

Bases: Callback, Algorithm

Validate that the occlusion fration is above threshold.

Raises:

E.OcclusionError – If the occlusion fraction is below threshold.

class Parameters(*, min_allowed_occlusion: ConstrainedFloatValue)[source]

Bases: Parameters

Parameters class for OcclusionValidator objects.

min_allowed_occlusion: float
on_execute_end(result: EyeOcclusion) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

result (EyeOcclusion) – EyeOcclusion resulted from computations.

run(val_arguments: EyeOcclusion) None[source]

Validate of occlusion estimation algorithm.

Parameters:

val_arguments (EyeOcclusion) – Computed result.

Raises:

E.OcclusionError – Raised if result isn’t greater then specified threshold.

class iris.nodes.validators.object_validators.OffgazeValidator(max_allowed_offgaze: float = 1.0)[source]

Bases: Callback, Algorithm

Validate that the offgaze score is below threshold.

Raises:

E.OffgazeEstimationError – If the offgaze score is above threshold.

class Parameters(*, max_allowed_offgaze: ConstrainedFloatValue)[source]

Bases: Parameters

Parameters class for OffgazeValidator objects.

max_allowed_offgaze: float
on_execute_end(result: Offgaze) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

result (Offgaze) – Offgaze resulted from computations.

run(val_arguments: Offgaze) None[source]

Validate of offgaze estimation algorithm.

Parameters:

val_arguments (Offgaze) – Computed result.

Raises:

E.OffgazeEstimationError – Raised if result isn’t greater then specified threshold.

class iris.nodes.validators.object_validators.PolygonsLengthValidator(min_iris_length: int = 150, min_pupil_length: int = 75)[source]

Bases: Callback, Algorithm

Validate that the pupil and iris polygons have a sufficient length.

Raises:

E.GeometryEstimationError – If the total iris or pupil polygon length is below the desired threshold.

class Parameters(*, min_iris_length: ConstrainedIntValue, min_pupil_length: ConstrainedIntValue)[source]

Bases: Parameters

Parameters class for PolygonsLengthValidator objects.

min_iris_length: int
min_pupil_length: int
on_execute_start(input_polygons: GeometryPolygons, *args, **kwargs) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

input_polygons (GeometryPolygons) – input GeometryPolygons to be validated.

run(val_arguments: GeometryPolygons) None[source]

Validate that the total iris and pupil polygon length is above the desired threshold.

Parameters:

val_arguments (GeometryPolygons) – GeometryPolygons to be validated.

Raises:

E.GeometryEstimationError – Raised if the total iris or pupil polygon length is below the desired threshold.

class iris.nodes.validators.object_validators.Pupil2IrisPropertyValidator(min_allowed_diameter_ratio: float = 0.0001, max_allowed_diameter_ratio: float = 0.9999, max_allowed_center_dist_ratio: float = 0.9999)[source]

Bases: Callback, Algorithm

Validate that the pupil-to-iris ratio is within thresholds.

Raises:

E.PupilIrisPropertyEstimationError – If the pupil-to-iris ratio isn’t within boundaries.

class Parameters(*, min_allowed_diameter_ratio: ConstrainedFloatValue, max_allowed_diameter_ratio: ConstrainedFloatValue, max_allowed_center_dist_ratio: ConstrainedFloatValue)[source]

Bases: Parameters

Parameters class for Pupil2IrisPropertyValidator objects.

max_allowed_center_dist_ratio: float
max_allowed_diameter_ratio: float
min_allowed_diameter_ratio: float
on_execute_end(result: PupilToIrisProperty) None[source]

Wrap for validate method so that validator can be used as a Callback.

Parameters:

result (PupilToIrisProperty) – Pupil2Iris property resulted from computations.

run(val_arguments: PupilToIrisProperty) None[source]

Validate of pupil to iris calculation.

Parameters:

p2i_property (PupilToIrisProperty) – Computation result.

Raises:

E.PupilIrisPropertyEstimationError – Raised if result isn’t without previously specified boundaries.

Module contents