create static method

Future<IrisLandmark> create({
  1. InterpreterOptions? options,
  2. PerformanceConfig? performanceConfig,
})

Creates and initializes an iris landmark model instance.

This factory method loads the iris landmark TensorFlow Lite model from package assets and prepares it for inference. The model predicts 5 keypoints per iris plus eye contour points.

The options parameter allows you to customize the TFLite interpreter configuration (e.g., number of threads, use of GPU delegate).

The performanceConfig parameter enables hardware acceleration delegates. Use PerformanceConfig.xnnpack() for 2-5x speedup on CPU. If both options and performanceConfig are provided, options takes precedence.

Returns a fully initialized IrisLandmark instance ready to detect irises.

Note: This model expects a cropped eye region as input. For full pipeline processing, use the high-level FaceDetector class with FaceDetectionMode.full.

Example:

// Default (auto mode)
final irisModel = await IrisLandmark.create();
final irisPoints = await irisModel.call(eyeCropMat);

// With XNNPACK acceleration
final irisModel = await IrisLandmark.create(
  performanceConfig: PerformanceConfig.xnnpack(),
);

See also:

Throws StateError if the model cannot be loaded or initialized.

Implementation

static Future<IrisLandmark> create({
  InterpreterOptions? options,
  PerformanceConfig? performanceConfig,
}) => _createWithLoader(
  load: (opts) => Interpreter.fromAsset(
    'packages/face_detection_tflite/assets/models/$kIrisLandmarkModel',
    options: opts,
  ),
  options: options,
  performanceConfig: performanceConfig,
);