Sandeep03edu / FaceRecognition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FaceRecognition

Simple android app created using OpenCv and dlib library

Table of contents

Introduction

  • App has been made in 4 weeks during mentorship period for Microsoft Engage'22.
  • The github repo basically contain two apps codebase.
  • "DiseaseDetection" module works with "dlib", "sdk" and "common" module and used to detect facial parts and face diseases.
  • "SmartAdvertising" module works with "sdk" and "common" module and used to display advertisment based on public age group and gender.

Technologies

  • Google Firebase
    • Firebase mobile authentication to register verified users.
    • Firebase Firestore to store User details, User scan details, Advertisement documents.
    • Firebase storage to store images like user profile pic, scanned image.
    • Firebase Crashanalytics to detect crashes in app modules.
  • OpenCv
    • OpenCv haarcascade_frontalface_alt2.xml file to detect human faces.
    • shape_predictor_68_face_landmarks.dat module to detect landmarks on faces.
    • age_deploy.prototxt and age_net.caffemodel to detect human age.
    • gender_deploy.prototxt and gender_net.caffemodel to detect human gender.

Features

Disease Detection

  • Fetching multiple faces from a given image.
  • Getting human face count from a given image.
  • Adding 68 face landmark points to face.
  • Splitted human face into small face parts like eyes, eyebrows, nose, lips and face.
  • Fetching age and gender of given image with confidence value.
  • Fetching human facial diseases symptoms percentage
    • Eyebrow Alopecia detection
    • Chapped Lips detection
    • Eye Redness detection
  • Save result for future analysis and comparision.
  • Rescan option to re-evaluate results with clear images.

Smart Advertisement

  • Displaying advertisement based on gender and age group of users.
  • Priotizing advertisement based on parameter "lastDisplayedTime"
  • Advertisement displayed in ascending order of "lastDisplayedTime" for a specific gender and age group
    • For e.g., With age group 8-15 and Gender Male
    • Advertisement-1 with "lastDisplayedTime" - 1653763874560
    • Advertisement-2 with "lastDisplayedTime" - 1653763874234
    • Then Advertisement-2 will be displayed prior to Advertisement-1

Dependencies

  • OpenCv Sdk modules
  • dlib facelandmark module
  • Firebase
    • firebase-analytics
    • firebase-auth
    • firebase-firestore
    • firebase-storage
    • firebase-crashlytics
  • Tensorflow dependencies
    • tensorflow-android
    • tensorflow-lite
  • Gson dependency
    • com.squareup.retrofit2:converter-gson
  • Image cropping API
    • com.theartofdev.edmodo:android-image-cropper
  • Circle ImageView
    • de.hdodenhof:circleimageview
  • Picasso to load images from url
    • com.squareup.picasso:picasso
  • Updated workmanager for Foreground service
    • androidx.work:work-runtime

Permissions

  • Internet permission
    • To access advertisement in smartAdvertisement and authentication, saving records in diseaseDetection
  • External Storage
    • To access media files inside the mobile phone
  • Camera
    • To capture photo

Working

Disease detection

Working flow

DiseaseDetection Workflow

Authentication

  • User have to first authenticate in the app for using its functionality

  • User have to login into his/her account

  • User should create his/her account

Testing account credentials (Not to be used for saving data)

  • Mobile number - 9999988888
  • OTP - 123456

Choosing Image

  • Home Screen

  • Selected Image Cropping

Results prediction

  • Image Scanning

  • Predict age and gender with confidence percentage

  • Face parts analysis

  • Face parts rescan facility

  • Saving user scan record in foreground service with notification

Additional features

  • Scan History, My profile and logout option

Smart Advertising

  • Simple single screen app to display advetisements based on users age and gender.
  • Advertisement changes at the interval of 30 seconds based on live audience in front of camera (Front camera).
  • This application can be extended in public places like Malls, Shopping places, railway stations to display productive ads.

Advertisement cloud documents

Firebase Firestore Advertisement collection

Permission Requirements

  • App needs to access Camera and External storage to function properly along with internet

Output

  • App detects image from Front camera and scan results from images
  • Home screen, Male and Female advertisement is shown

About

License:Apache License 2.0


Languages

Language:C++ 57.7%Language:Java 35.7%Language:C 3.7%Language:CMake 2.7%Language:Objective-C 0.1%Language:HTML 0.1%Language:Kotlin 0.1%Language:Makefile 0.1%Language:AIDL 0.0%Language:Shell 0.0%