EVA-Android is an advanced real-time face detection application built on Google's MediaPipe framework. It provides high-performance face detection capabilities with support for multiple inference modes and hardware accelerators.
| Feature | Description |
|---|---|
| ๐ฅ Real-time Camera Detection | Detect faces in live camera streams with low latency |
| ๐ผ๏ธ Image Detection | Analyze static images from gallery |
| ๐ฌ Video Detection | Process video files frame by frame |
| โก GPU Acceleration | Leverage GPU for ultra-fast inference |
| ๐ง CPU Support | Fallback to CPU for wider device compatibility |
| ๐ Real-time Metrics | Display inference time and FPS |
| ๐จ Visual Feedback | Draw bounding boxes around detected faces |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MainActivity โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ CameraFragment โ โ GalleryFragment โ โ
โ โ (Live Stream) โ โ (Image/Video Processing) โ โ
โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ FaceDetectorHelper โ โ
โ โ (MediaPipe Face Detector) โ โ
โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ face_detection_short_range โ โ
โ โ .tflite Model โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- ๐ ๏ธ Android Studio Arctic Fox or higher
- ๐ฑ Android SDK API Level 24+
- ๐ค Gradle 7.0+
- ๐ป Java Development Kit 11+
-
Clone the repository
git clone https://github.com/EVA-Android/EVA-Android.git cd EVA-Android -
Open in Android Studio
- Launch Android Studio
- Select "Open an existing project"
- Navigate to the cloned repository
-
Build the project
./gradlew build
-
Run the app
- Connect an Android device or start an emulator
- Click "Run" in Android Studio
- Launch the application
- The camera will automatically start
- Face detection runs in real-time
- Bounding boxes are drawn around detected faces
- Inference time is displayed at the bottom
- Tap the gallery icon in the navigation bar
- Select an image or video from your gallery
- The app will process the media and display results
- Confidence Threshold: Adjust detection sensitivity (0.0-1.0)
- Delegate: Switch between CPU and GPU
- Running Mode: Image, Video, or Live Stream
| Property | Value |
|---|---|
| Model Type | TensorFlow Lite |
| Model Name | face_detection_short_range.tflite |
| Input Size | 256x256 pixels |
| Quantization | FP16 |
| Metric | CPU | GPU |
|---|---|---|
| Inference Time | ~30ms | ~10ms |
| FPS | ~30 | ~60 |
- IMAGE Mode - Process single static images
- VIDEO Mode - Process video files sequentially
- LIVE_STREAM Mode - Real-time camera processing
EVA-Android/
โโโ app/
โ โโโ src/main/
โ โ โโโ java/com/google/mediapipe/examples/facedetection/
โ โ โ โโโ MainActivity.kt # Main activity with navigation
โ โ โ โโโ MainViewModel.kt # ViewModel for settings
โ โ โ โโโ FaceDetectorHelper.kt # Core detection logic
โ โ โ โโโ OverlayView.kt # Custom view for drawing
โ โ โโโ assets/
โ โ โ โโโ face_detection_short_range.tflite
โ โ โโโ res/ # UI resources
โ โ โโโ AndroidManifest.xml # App configuration
โ โโโ build.gradle # Module build config
โโโ gradle/ # Gradle wrapper
โโโ build.gradle # Project build config
โโโ README.md # This file
The default confidence threshold is set to 0.9 (90%). To change this:
// In FaceDetectorHelper.kt
const val THRESHOLD_DEFAULT = 0.9F // Adjust this valueThe app supports both CPU and GPU delegates:
// CPU (default)
FaceDetectorHelper.DELEGATE_CPU = 0
// GPU (faster inference)
FaceDetectorHelper.DELEGATE_GPU = 1This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch
- โ๏ธ Make your changes
- ๐ค Submit a pull request
For questions or support, please reach out to the development team.
โญ If you find this project useful, please give it a star!
Built with โค๏ธ using MediaPipe & TensorFlow Lite