processInputImage method

Future<List<Face>> processInputImage(
  1. InputImage imgFile
)

Implementation

Future<List<Face>> processInputImage(InputImage imgFile) async {
  const maxAttempts = 3;

  for (var attempt = 0; attempt < maxAttempts; attempt++) {
    final List<Face> faces = await faceDetector.processImage(imgFile);
    if (faces.isNotEmpty) return faces;
  }

  return [];
}