GithubHelp home page GithubHelp logo

shaurya026 / real-time-facial-filters-application Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 27.03 MB

Gesture based Facial Filter Application using OpenCV for object tracking and face detection for real time application of facial filters: Hat, Moustache, and Sunglasses. Filters are placed on face using a Deep learning model predicting the needful coordinates.

Jupyter Notebook 100.00%
facial-landmarks face-detection facial-filters deep-learning convolutional-neural-networks object-tracking opencv

real-time-facial-filters-application's Introduction

Real-Time-Facial-Filters-Application

This project builds a Gesture based facial filter application where you can use your hand gesture to select any filter over your face like in many social media applications. this implementation applies deep learning for building a custom model for 15 and 68 points face detection as shown in this directory. Since, 68 points provide better accuracy in placement of filters we will use 68 key points model built in this project. The facial points predicted are shown below:

pts

The model used for Facial Keypoint detection helps in giving results as shown below:

normal face points

Some Requirements for this project are libraries shown below:

  1. Tensorflow
  2. OpenCV
  3. Pillow
  4. numpy

>> For getting the face crops we use Haarcascade Classifier for face extraction and croping the photo for inference on our custom model. The Haarcascade for face detection is provided in this repo for anyone's use. Else you may find it in OpenCV library installed on your system.
>> For Hand gesture we track any object we wish to use for changing the filter using the CSRT_TRACKER present in OpenCV. Where using a Crosshair can be used to select our tracker.

Below is the Working Presentaiton of the Project V1.ipynb with the steps of usage provided after that:

working

  1. From the above video the Haarcascade detects the face present in the frame as soon as the program is executed.
  2. The user selects the key s from the keyboard to pause the frame and allow user to select the area which we want to track, in this case the hand presented. Once the hand is selected user presses space bar for the tracker to start working and track the coordiantes of mid point from the tracker.
  3. We can than see a white circle for gesture reference, where the user moves his hand or any other object being tracked to get replace filter over the face.

    The UP gesture places the sunglasses over the eyes.
    The DOWN gesture simply shows the output of Haarcascade detection.
    The LEFT gesture leads to moustache below the nose.
    The RIGHT gesture leads to Straw Hat above the head.

  4. Finally if we want to exit we use the q key.

The number below shows the Frame Rate per Second and the coordinates where the tracker is currently at.
The FPS is low due to the fact a lot of inferencing i.e., Face Landmark detection, Face Detection, and Object tracking is being done all at once.

real-time-facial-filters-application's People

Contributors

shaurya026 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.