A simple Android application that demonstrates real-time face detection using the device's camera. The app uses CameraX for camera management and ML Kit's Face Detection API to identify faces in the camera preview and draw a bounding box around them.
- Real-time camera preview using Jetpack Compose.
- Face detection using Google's ML Kit.
- Drawing bounding boxes around detected faces.
- Handles camera permission requests.
- Kotlin - First-class and official programming language for Android development.
- Jetpack Compose - Android’s modern toolkit for building native UI.
- CameraX - A Jetpack support library, built to help you make camera app development easier.
- ML Kit Face Detection - A Google API that can detect faces in an image or video.
- Accompanist Permissions - A library that provides easy-to-use composables and utilities for working with Android runtime permissions.
To get a local copy up and running follow these simple steps.
- Android Studio Iguana | 2023.2.1 or later.
- Android SDK 34 or later.
- An Android device or emulator with a camera.
- Clone the repo
git clone https://github.com/hi-mod/face-detection.git
- Open the project in Android Studio.
- Build the project and run it on an Android device or emulator.
- Launch the app.
- Grant camera permission when prompted.
- Point the camera at a face.
- A green rectangle will be drawn around the detected face(s).