Closed Jayakumar-AndroidDev closed 3 months ago
Unable to detect face using google_mlkit_face_detection: ^0.11.0 `void faceDetect(CameraImage image) { final writeBuffer = WriteBuffer();
for (final plan in image.planes) { writeBuffer.putUint8List(plan.bytes); } final bytes = writeBuffer.done().buffer.asUint8List(); final size = Size( image.width.toDouble(), image.height.toDouble(), ); const rotation = InputImageRotation.rotation0deg; final format = InputImageFormatValue.fromRawValue(image.format.raw) ?? InputImageFormat.nv21; final metaData = InputImageMetadata( size: size, rotation: rotation, format: format, bytesPerRow: image.planes[0].bytesPerRow, ); final inputImage = InputImage.fromBytes( bytes: bytes, metadata: metaData, ); final option = FaceDetectorOptions( enableClassification: true, enableContours: true, enableLandmarks: true, enableTracking: true, ); final faceDetector = FaceDetector(options: option); faceDetector.processImage(inputImage).then( (detectedFace) { debugPrint('detected_face:- ${detectedFace.length}'); }, );
} `
Seems you are using the flutter API(not maintained by Google). Please consider to post your question here:
https://github.com/flutter-ml/google_ml_kit_flutter
Unable to detect face using google_mlkit_face_detection: ^0.11.0 `void faceDetect(CameraImage image) { final writeBuffer = WriteBuffer();
} `