Skip to content

YJLeonMan/EVA-Android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฅ EVA-Android - Face Detection Application

GitHub stars GitHub forks License Platform


๐Ÿ“ฑ About EVA-Android

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.

โœจ Key Features

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

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    MainActivity                            โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚   CameraFragment โ”‚  โ”‚        GalleryFragment          โ”‚  โ”‚
โ”‚  โ”‚  (Live Stream)   โ”‚  โ”‚  (Image/Video Processing)      โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚           โ”‚                              โ”‚                  โ”‚
โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚                          โ–ผ                                  โ”‚
โ”‚           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”‚
โ”‚           โ”‚      FaceDetectorHelper       โ”‚                โ”‚
โ”‚           โ”‚  (MediaPipe Face Detector)    โ”‚                โ”‚
โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ”‚
โ”‚                          โ–ผ                                  โ”‚
โ”‚           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”‚
โ”‚           โ”‚  face_detection_short_range   โ”‚                โ”‚
โ”‚           โ”‚        .tflite Model          โ”‚                โ”‚
โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Getting Started

Prerequisites

  • ๐Ÿ› ๏ธ Android Studio Arctic Fox or higher
  • ๐Ÿ“ฑ Android SDK API Level 24+
  • ๐Ÿค– Gradle 7.0+
  • ๐Ÿ’ป Java Development Kit 11+

Installation

  1. Clone the repository

    git clone https://github.com/EVA-Android/EVA-Android.git
    cd EVA-Android
  2. Open in Android Studio

    • Launch Android Studio
    • Select "Open an existing project"
    • Navigate to the cloned repository
  3. Build the project

    ./gradlew build
  4. Run the app

    • Connect an Android device or start an emulator
    • Click "Run" in Android Studio

๐ŸŽฎ Usage

Live Camera Mode

  1. Launch the application
  2. The camera will automatically start
  3. Face detection runs in real-time
  4. Bounding boxes are drawn around detected faces
  5. Inference time is displayed at the bottom

Gallery Mode

  1. Tap the gallery icon in the navigation bar
  2. Select an image or video from your gallery
  3. The app will process the media and display results

Settings

  • Confidence Threshold: Adjust detection sensitivity (0.0-1.0)
  • Delegate: Switch between CPU and GPU
  • Running Mode: Image, Video, or Live Stream

๐Ÿง  Technical Details

Model Specifications

Property Value
Model Type TensorFlow Lite
Model Name face_detection_short_range.tflite
Input Size 256x256 pixels
Quantization FP16

Performance Metrics

Metric CPU GPU
Inference Time ~30ms ~10ms
FPS ~30 ~60

Supported Running Modes

  1. IMAGE Mode - Process single static images
  2. VIDEO Mode - Process video files sequentially
  3. LIVE_STREAM Mode - Real-time camera processing

๐Ÿ“ Project Structure

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

๐Ÿ”ง Configuration

Changing Detection Threshold

The default confidence threshold is set to 0.9 (90%). To change this:

// In FaceDetectorHelper.kt
const val THRESHOLD_DEFAULT = 0.9F  // Adjust this value

Switching Delegate

The app supports both CPU and GPU delegates:

// CPU (default)
FaceDetectorHelper.DELEGATE_CPU = 0

// GPU (faster inference)
FaceDetectorHelper.DELEGATE_GPU = 1

๐Ÿ“ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


๐Ÿค Contributing

Contributions are welcome! Please feel free to:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch
  3. โœ๏ธ Make your changes
  4. ๐Ÿ“ค Submit a pull request

๐Ÿ“ง Contact

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages