Giter Club home page Giter Club logo

android-face-detector's Introduction

Face detector

alt text

Face detector is a face detection Android library which can be easily plugged into any camera API (given it provides a way to process its frames).

Face detector is built on top of Firebase ML Kit's face detection API.

Related article

I wrote the following article in order to explain why this project was built, how it's designed and how one can use it in a real-world Android application.

Usage

Three easy steps:

  1. Add a FaceBoundsOverlay on top of your camera view.
<FrameLayout
    ...>
    
    // Any other views

    <CameraView
        ... />

    <husaynhakeem.io.facedetector.FaceBoundsOverlay
        ... />

    // Any other views
    
</FrameLayout>
  1. Define a FaceDetection instance and connect it to your camera.
private val faceDetector: FaceDetector by lazy {
    FaceDetector(facesBoundsOverlay)
}

...

cameraView.addFrameProcessor {
    faceDetector.process(Frame(
            data = it.data,
            rotation = it.rotation,
            size = Size(it.size.width, it.size.height),
            format = it.format,
            isCameraFacingBack = cameraView.facing))
}
  1. Setup firebase in your Android project

Download

  1. Add the code below in your root build.gradle at the end of repositories
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  1. Add the dependency
implementation 'com.github.husaynhakeem:android-face-detector:v1.2'

Demo

alt text

android-face-detector's People

Contributors

bapspatil avatar husaynhakeem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.