refactor: Update dependencies and clean up unused imports in face liveness detection
This commit is contained in:
parent
5dc7aa3cc7
commit
0eec492698
|
@ -6,7 +6,7 @@ import 'package:camera/camera.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:google_mlkit_face_detection/google_mlkit_face_detection.dart';
|
||||
import 'package:google_mlkit_face_mesh_detection/google_mlkit_face_mesh_detection.dart';
|
||||
// import 'package:google_mlkit_face_mesh_detection/google_mlkit_face_mesh_detection.dart';
|
||||
import 'package:sigap/src/features/auth/data/models/face_model.dart';
|
||||
|
||||
// Enum for liveness status
|
||||
|
@ -37,7 +37,7 @@ class FaceLivenessController extends GetxController {
|
|||
|
||||
// ML Kit detectors
|
||||
late FaceDetector faceDetector;
|
||||
late FaceMeshDetector faceMeshDetector;
|
||||
// late FaceMeshDetector faceMeshDetector;
|
||||
|
||||
// Observable states
|
||||
final status = LivenessStatus.preparing.obs;
|
||||
|
@ -106,13 +106,14 @@ class FaceLivenessController extends GetxController {
|
|||
enableTracking: true,
|
||||
minFaceSize: 0.1,
|
||||
performanceMode: FaceDetectorMode.accurate,
|
||||
|
||||
),
|
||||
);
|
||||
|
||||
// Face mesh detector
|
||||
faceMeshDetector = FaceMeshDetector(
|
||||
option: FaceMeshDetectorOptions.faceMesh,
|
||||
);
|
||||
// faceMeshDetector = FaceMeshDetector(
|
||||
// option: FaceMeshDetectorOptions.faceMesh,
|
||||
// );
|
||||
|
||||
dev.log(
|
||||
'ML Kit detectors initialized successfully',
|
||||
|
@ -260,7 +261,7 @@ class FaceLivenessController extends GetxController {
|
|||
dev.log('Could not determine rotation', name: 'LIVENESS_CONTROLLER');
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
final format =
|
||||
Platform.isAndroid
|
||||
? InputImageFormat.nv21
|
||||
|
@ -686,7 +687,7 @@ class FaceLivenessController extends GetxController {
|
|||
// Close ML Kit detectors
|
||||
try {
|
||||
faceDetector.close();
|
||||
faceMeshDetector.close();
|
||||
// faceMeshDetector.close();
|
||||
} catch (e) {
|
||||
dev.log(
|
||||
'Error closing ML Kit detectors: $e',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:sigap/src/features/auth/presentasion/controllers/basic/registration_form_controller.dart';
|
||||
import 'package:sigap/src/features/auth/presentasion/controllers/selfie-verification/face_liveness_detection_controller.dart';
|
||||
import 'package:sigap/src/features/auth/presentasion/controllers/selfie-verification/facial_verification_controller.dart';
|
||||
import 'package:sigap/src/features/auth/presentasion/controllers/selfie-verification/selfie_verification_controller.dart';
|
||||
import 'package:sigap/src/shared/widgets/image_upload/image_uploader.dart';
|
||||
|
@ -31,6 +32,8 @@ class SelfieVerificationStep extends StatelessWidget {
|
|||
final controller = Get.find<SelfieVerificationController>();
|
||||
final mainController = Get.find<FormRegistrationController>();
|
||||
final facialVerificationService = FacialVerificationService.instance;
|
||||
final FaceLivenessController faceLivenessController =
|
||||
Get.find<FaceLivenessController>();
|
||||
mainController.formKey = formKey;
|
||||
|
||||
return Form(
|
||||
|
|
|
@ -694,29 +694,21 @@ packages:
|
|||
source: hosted
|
||||
version: "0.3.3+1"
|
||||
google_mlkit_commons:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_mlkit_commons
|
||||
sha256: "8f40fbac10685cad4715d11e6a0d86837d9ad7168684dfcad29610282a88e67a"
|
||||
sha256: "27d626c66a181351a953eba5b6ff1ff123aadb891b4dab085b292118f039d6ac"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.11.0"
|
||||
version: "0.7.1"
|
||||
google_mlkit_face_detection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_mlkit_face_detection
|
||||
sha256: f336737d5b8a86797fd4368f42a5c26aeaa9c6dcc5243f0a16b5f6f663cfb70a
|
||||
sha256: "5b597061cafe4dfa70f66adddadd19381eb88bd3312b074528c62b246392304b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.1"
|
||||
google_mlkit_face_mesh_detection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_mlkit_face_mesh_detection
|
||||
sha256: "3683daed2463d9631c7f01b31bfc40d22a1fd4c0392d82a24ce275af06bc811f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.4.1"
|
||||
version: "0.11.0"
|
||||
google_sign_in:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -115,8 +115,9 @@ dependencies:
|
|||
google_fonts:
|
||||
|
||||
# --- Machine Learning ---
|
||||
google_mlkit_face_detection: ^0.13.1
|
||||
google_mlkit_face_mesh_detection: ^0.4.1
|
||||
google_mlkit_face_detection: ^0.11.0
|
||||
# google_mlkit_face_mesh_detection: ^0.4.1
|
||||
google_mlkit_commons: ^0.7.1
|
||||
|
||||
# --- Localization ---
|
||||
# (add localization dependencies here if needed)
|
||||
|
|
Loading…
Reference in New Issue