Coder Social home page Coder Social logo

miftanurfarid / masked-face-recognition-using-mtcnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from srinidhi9440/masked-face-recognition-using-mtcnn

0.0 1.0 0.0 5 KB

I have developed a deep learning model which recognises the person's face even when they are masked.

Python 100.00%

masked-face-recognition-using-mtcnn's Introduction

Masked-Face-Recognition-using-MTCNN-and-FaceNet (End-to-End-Deploymnet-using-Streamlit)

Existing Face Recognition systems fail in recognizing the persons when they are masked but I have developed a face recognition system that is capable of recognizing persons even when they are masked with different kinds of occlusion such as Facemasks, templates, Handkerchiefs, and so on. I have even deployed my model using Streamlit.

Entire Workflow of the project

flowhart

How to use the code in the repository

1. Collect images of persons that are to be recognized using the model. The images that you collect should contain various kinds of occlusions. For good accuray, make sure that the images that you collect are as follows

 ```
 a. Non masked face images
 b. Non masked face images with Spectacles or Goggles
 c. Masked face with any kind of masks such as N-95, Cloth or surgical masks
 d. Masked face with any kind of mask such as N-95, Cloth or surgical mask along with spectacles or goggles.
 e. Masked face with a handkerchief or any cloth or scarf.
 f. Masked face with a handkerchief or any cloth or scarf when you are wearing either Spectacles or Goggles.
 ```

Picture1 The images of every individual person should be placed in a seperate directory. The directory structure of the images that you have collected should be as follows image

2. Run the file 'embeddings_generator.py'.

  • Make sure that you have installed the MTCNN package before running this file. You can download the package by using the command 'pip install mtcnn'.
  • Downlaod the Facenet model file from this link https://drive.google.com/open?id=1pwQ3H4aJ8a6yyJHZkTwtjcL4wYWQb7bn and place it in the same directory that contains 'embeddings_generator.py' file and rename the downloaded file as 'facenet.h5'.
  • The modification to be done to the code in 'embeddings_generator.py' file is providing the path to the directory that contain directories of images of each individual.
  • Change the value of the variable 'base_dir' in the first line of the file with your local location of the dataset directory.

3. Run the streamlit file face_recognizer.py using command line.

To run the streamlit file, move the directory location in the command prompt and enter the command streamlit run face_recognizer.py which will open a tab in your default browser by default. The inteface of the webapp will be as follows pro1

Now upload a image into the Webapp.
If the image uploaded contains face of a trained person then the name of the person will be displayed if not the person will be recognized as Unknown.
The result of the model on the image of a trained person is as follows pro2

masked-face-recognition-using-mtcnn's People

Contributors

srinidhi9440 avatar

Watchers

James Cloos 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.