How miniailive/facerecognition-livenessdetection-android works
Main Components of the System
• User Interface (UI) Layer:
• Activities such as CameraActivity, MainActivity, AboutActivity, IdentifyActivity, SplashActivity, etc.
• Layout XML files in the res/layout folder that define the UI screens.
• Face Recognition and Liveness Detection Engine:
• Core face recognition logic is implemented in classes like FrameAnalyser, FrameInterface, BitmapUtils, and BoundingBoxOverlay.
• External native/core functionality is packaged in the AAR library (miniai_face.aar under app/libs) that encapsulates the complex algorithms.
• Camera and Image Processing Module:
• CameraActivity provides the entry point for capturing images.
• Utilities such as ImageRotator and other transformation services.
• Data Management:
• User data handling through files like UserDB.java, UserInfo.java, and adapter components like UsersAdapter.java.
• Testing and Quality Assurance:
• Instrumented tests under app/src/androidTest.
• Unit tests under app/src/test.
• Build and Configuration System:
• Gradle build files (build.gradle, settings.gradle, gradle.properties) and proguard configuration (proguard-rules.pro).
• Project configuration folders (.idea, .gitignore) that define environment and versioning settings.
Relationships and Interactions
• UI components (Activities) serve as the entry point where user interactions trigger camera capture, face recognition, and liveness checks.
• Activities and fragments connect to business logic classes (like FrameAnalyser) for real-time image processing.
• Utility classes (e.g., BitmapUtils, BoundingBoxOverlay) perform pre/post-processing before passing images and results between the UI and core processing layers.
• Data managers (UserDB and related classes) persist and retrieve user data as needed.
• Tests are separated but interact with various components (UI, business logic) to ensure correct operation.
Architectural Patterns and Design Principles
• Layered Architecture: Clearly separate UI, core processing (face recognition & liveness detection), and data persistence.
• Modularity: Each activity focuses on a distinct function (enrollment, identification, liveness testing, etc.), enabling a plug-and-play modular design.
• Use of External Libraries: The integration of the precompiled miniai_face.aar helps encapsulate complex AI functionalities, easing maintenance.
• Platform Conventions: Follows Android’s standard project organization (src/main, src/test, etc.) and build tooling (Gradle).
Technologies, Frameworks, and Libraries
• Android SDK & Kotlin/Java for application logic.
• Gradle for build automation.
• External AAR (miniai_face.aar) containing face recognition and liveness detection algorithms.
• Standard Android components (Activities, Layouts, Resources) and possible compatibility libraries for UI.
• Testing frameworks provided by Android for both unit and instrumented tests.