Skip to content

Repository files navigation

FaceDetector

FaceDetector is an Android application designed to detect and tag faces in images stored in a local gallery. This project demonstrates the use of advanced Android development practices, integrating Room for local database management, Glide for image loading, and a custom implementation of face detection.

Features

  • Face Detection: Automatically detects faces in images from a local gallery.
  • Face Tagging: Allows users to tag detected faces with specific identifiers.
  • Responsive UI: A clean, intuitive interface optimized for all screen sizes.
  • Room Database Integration: Efficiently stores and retrieves face tags with Room persistence library.
  • Glide Image Loading: Smooth and efficient image loading using Glide.
    • Search by Tag: Retrieve images based on face and tag identifiers (coming soon).

Technology Stack

  • Programming Language: Kotlin
  • Architecture: MVVM (Model-View-ViewModel)
  • Database: Room
  • Image Loading: Glide
  • Testing Frameworks: JUnit

Getting Started

Prerequisites

  • Android Studio (latest version recommended)
  • Minimum SDK version: 24
  • Gradle version: 8.1.1

Setup

  1. Clone the repository:
    git clone https://github.com/sandeep27d/FaceDetector.git
    

Open the project in Android Studio. Sync the project with Gradle files. Build and run the project on an emulator or physical device.

Key Components Database

AppDatabase: Central database class with a DAO for face tagging.
FaceTagDao: DAO interface providing methods to query and manipulate face tags.

ViewModel

MainActivityViewModel: Handles UI-related data, including querying face tags and managing states.

Repository

FaceTagRepository: Abstracts the data layer, providing a clean API for ViewModels to interact with the Room database.

Tests

Unit Tests: Written using JUnit and MockK to test repository and DAO methods. Instrumentation Tests: Written using Espresso to validate UI interactions.

Glide Integration

Images are efficiently loaded into the UI using Glide:

Glide.with(context)
    .load(imagePath)
    .placeholder(R.drawable.placeholder)
    .into(imageView)

Development Practices

Modern Android Development (MAD): Includes Jetpack components like ViewModel, Room, and LiveData. Clean Architecture: Separation of concerns using MVVM pattern.

How to Contribute

Fork the repository. Create a new branch:

git checkout -b feature-name

Make your changes and commit:

git commit -m "Add new feature"

Push the branch:

git push origin feature-name

Open a pull request.

License

This project is licensed under the MIT License. For any questions or feedback, feel free to reach out to Sandeep.

Contact: sandeep27d@gmail.com

About

Sample project for face detection in on-device images

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages