detectFacesFromFilepath method

Future<List<Face>> detectFacesFromFilepath(
  1. String path, {
  2. FaceDetectionMode mode = FaceDetectionMode.full,
})

Detects faces in an image file at path.

Convenience wrapper that reads the file and calls detectFacesFromBytes. Not available on Flutter Web (uses dart:io).

Throws StateError if initialize has not been called successfully. Throws FileSystemException if the file cannot be read. Throws FormatException if the image cannot be decoded.

Implementation

Future<List<Face>> detectFacesFromFilepath(
  String path, {
  FaceDetectionMode mode = FaceDetectionMode.full,
}) async {
  final bytes = await File(path).readAsBytes();
  return detectFacesFromBytes(bytes, mode: mode);
}