iris.pipelines package

Submodules

iris.pipelines.iris_pipeline module

class iris.pipelines.iris_pipeline.IRISPipeline(config: ~typing.Dict[str, ~typing.Any] | str | None = None, env: ~iris.orchestration.environment.Environment = Environment(call_trace_initialiser=<function PipelineCallTraceStorage.initialise>, pipeline_output_builder=<function build_simple_orb_output>, error_manager=<function store_error_manager>, disabled_qa=[]))[source]

Bases: Algorithm

Implementation of a fully configurable iris recognition pipeline.

DEBUGGING_ENVIRONMENT = Environment(call_trace_initialiser=<function PipelineCallTraceStorage.initialise>, pipeline_output_builder=<function build_simple_debugging_output>, error_manager=<function store_error_manager>, disabled_qa=[<class 'iris.nodes.validators.object_validators.Pupil2IrisPropertyValidator'>, <class 'iris.nodes.validators.object_validators.OffgazeValidator'>, <class 'iris.nodes.validators.object_validators.OcclusionValidator'>, <class 'iris.nodes.validators.object_validators.IsPupilInsideIrisValidator'>, <class 'iris.nodes.validators.object_validators.IsMaskTooSmallValidator'>, <class 'iris.nodes.validators.cross_object_validators.EyeCentersInsideImageValidator'>, <class 'iris.nodes.validators.cross_object_validators.ExtrapolatedPolygonsInsideImageValidator'>])
ORB_ENVIRONMENT = Environment(call_trace_initialiser=<function PipelineCallTraceStorage.initialise>, pipeline_output_builder=<function build_orb_output>, error_manager=<function store_error_manager>, disabled_qa=[])
class Parameters(*, metadata: PipelineMetadata, pipeline: List[PipelineNode])[source]

Bases: Parameters

IRISPipeline parameters, all derived from the input config.

metadata: PipelineMetadata
pipeline: List[PipelineNode]
estimate(img_data: ndarray, eye_side: Literal['left', 'right']) Any[source]

Wrap the run method to match the Orb system AI models call interface.

Parameters:
  • img_data (np.ndarray) – Image data.

  • eye_side (Literal["left", "right"]) – Eye side.

Returns:

Output created by builder specified in environment.pipeline_output_builder.

Return type:

Any

instanciate_class(class_name: str, kwargs: Dict[str, Any]) Callable[source]

Instanciate a class from its string definition and its kwargs.

This function relies on pydoc.locate, a safe way to instanciate a class from its string definition, which itself relies on pydoc.safe_import.

Parameters:
  • class_name (str) – name of the class.

  • kwargs (Dict) – kwargs to pass to the class at instanciation time

Returns:

the instanciated class

Return type:

Callable

Raises:

IRISPipelineError – Raised if the class cannot be located.

instanciate_node(node_class: str, algorithm_params: Dict[str, Any], callbacks: List[PipelineClass] | None) Algorithm[source]

Instanciate an Algorithm from its class, kwargs and optional Callbacks.

NOTE: All callbacks of type listed in self.env.disabled_qa will be filtered out. This allows one config file to be used in various QA standards levels.

Parameters:
  • node_class (str) – Node’s class.

  • algorithm_params (Dict[str, Any]) – Node’s kwargs.

  • callbacks (Optional[List[PipelineClass]]) – list of callbacks.

Returns:

instanciated node.

Return type:

Algorithm

instanciate_nodes() Dict[str, Algorithm][source]

Given a list of PipelineNode, return the associated instanciated nodes.

NOTE: All nodes of type listed in self.env.disabled_qa will be filtered out. This allows one config file to be used in various QA standards levels.

Returns:

instanciated nodes.

Return type:

Dict[str, Algorithm]

instanciate_pipeline() List[PipelineNode][source]

Given a list of PipelineNodes, crawl the parameters and instanciate the PipelineClass available.

Returns:

pipeline with instanciated parameters

Return type:

List[PipelineNode]

static load_config(config: str | None) Dict[str, Any][source]

Convert the input configuration string into a dictionary for deserialisation. If no config is given, load the default config.

Parameters:

config (Optional[str]) – YAML-formatted input configuration string.

Raises:

IRISPipelineError – Raised if the input config is not a string, or is not correctly YAML-formatted.

Returns:

Configuration as a dictionary.

Return type:

Dict[str, Any]

classmethod load_from_config(config: str) Dict[str, IRISPipeline | Dict[str, Any] | None][source]

Given an iris config string in base64, initialise an IRISPipeline with config this config.

Parameters:

config (str) – an iris str configs in base64

Returns:

Initialised iris pipeline and standard error output.

Return type:

Dict[str, Union[IRISPipeline, Optional[Dict[str, Any]]]]

run(img_data: ndarray, eye_side: Literal['left', 'right']) Any[source]

Generate template.

Parameters:
  • img_data (np.ndarray) – Infrared image as a numpy array.

  • eye_side (Literal["left", "right"]) – Eye side.

Returns:

Output created by builder specified in environment.pipeline_output_builder.

Return type:

Any

Module contents