detect method

Future<List<Face>> detect(
  1. InputImage image
)

Implementation

Future<List<Face>> detect(InputImage image) async {
  try {
    List result = await channel.invokeMethod('detect', <String, dynamic>{
      'image': image.json,
      'minFaceSize': minFaceSize,
      'performance': mode == FaceDetectorMode.accurate ? 'accurate' : 'fast',
      'landmark': detectLandmark ? 'all' : 'none',
      'contour': detectContour ? 'all' : 'none',
      'classification': enableClassification ? 'all' : 'none',
      'enableTracking': enableTracking,
    });

    return result.map((face) => Face.from(face)).toList();
  } on PlatformException catch (e) {
    print(e.message);
  }

  return [];
}