Android Face Verification Library

A robust and easy-to-integrate solution for face verification within Android applications

Aria Danesh

Creator & Maintainer

Key Features

Real-time Detection

Advanced face detection and verification in real-time using ML Kit

Modern UI

Beautiful UI components built with Jetpack Compose and Material Design 3

Secure & Reliable

Robust security features and reliable face verification

Installation

Add JitPack Repository

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Add Dependency

dependencies {
    implementation("com.github.arya458:FaceVerification:1.0.0")
    implementation("com.google.mlkit:face-detection:16.1.7")

}

Usage

@Composable
val context = LocalContext.current
    val faceDetectionCallback = remember {
                    object : FaceDetectionCallback {
                        override fun onManyFacesDetected(
                            faces: List,
                            imageProxy: ImageProxy
                        ) {
                        }

                        override fun onOneFaceDetected(face: Face, imageProxy: ImageProxy) {
                            // One face detected! Process the imageProxy here.
                            val base64Image = imageProxyToBase64(imageProxy)
                            base64Image?.let {
                                android.util.Log.d("FaceVerification", "Base64 Image (first 50 chars): ${it.substring(0, 50)}...")
                                // Send to your verification backend or process locally
                            }
                            imageProxy.close() // Remember to close the ImageProxy
                        }

                        override fun onFaceDetectionError(exception: Exception) {
                        }

                        override fun onNoFaceDetected(imageProxy: ImageProxy) {
                            android.util.Log.d("FaceVerification", "No face detected")
                            // Handle no face detected scenario
                        }
                    }
                }


                FaceVerificationComponent(
                    onSmile = {},
                    onFaceDetected = {},
                    onFacesDetected = {},
                    noFaceDetected = {},
                    onError = {}
                )
}

Contributing

Report Bugs

Found an issue? Report it on GitHub

Suggest Features

Have an idea? Share it with us

Submit PRs

Contribute code to improve the library