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