Giter Club home page Giter Club logo

v1zh3d / wider-face-detection-using-mtcnn Goto Github PK

View Code? Open in Web Editor NEW
16.0 1.0 9.0 36.03 MB

This is my first Internship Project on Deep Learning. This is a challenge of WIDER Face Benchmark whose aim is to detect faces in the images in any condition of various poses, illuminations and occlusions. And we managed to get the accuracy of 91% in detecting every type of images.

Python 100.00%
mtcnn tfrecords detect-faces tensorflow python3 deep-learning machine-learning computer-vision

wider-face-detection-using-mtcnn's Introduction

WIDER-Face-Detection using MTCNN

This is a tensorflow implementation of MTCNN for both training and testing of WIDER Face Detection.

Requirement

  1. Ubuntu 14.04 or 16.04 or Mac 10.*
  2. tensorflow 1.3 && python3.6: https://github.com/tensorflow/tensorflow
  3. opencv 3.0 for python3.6 pip install opencv-python
  4. numpy 1.13 pip install numpy

Prepare Data

notice: You should be at ROOT_DIR/prepare_data/ if you want to run the following command.

  • Step1. Download Wider Face Training part only from Official Website and unzip to replace WIDER_train

  • Step2. Run python gen_shuffle_data.py 12 to generate 12net training data. Besides, python gen_tfdata_12net.py provide you an example to build tfrecords file. Remember changing and adding necessary params.

  • Step3. Run python tf_gen_12net_hard_example.py to generate hard sample. Run python gen_shuffle_data.py 24 to generate random cropped training data. Then run python gen_tfdata_24net.py to combine these output and generate tfrecords file.

  • Step4. Similar to last step. Run python gen_24net_hard_example.py to generate hard sample. Run python gen_shuffle_data.py 48 to generate random cropped training data. Then run python gen_tfdata_48net.py to combine these output and generate tfrecords file.

Training Example

notice: You should be at ROOT_DIR/ if you want to run the following command.

if you have finished step 2 above, you can run python src/mtcnn_pnet_test.py to do Pnet training. Similarly, after step 3 or step 4, you can run python src/mtcnn_rnet_test.py or python src/mtcnn_onet_test.py to train Rnet and Onet respectively.

Testing Example

notice: You should be at ROOT_DIR/ if you want to run the following command.

You can run python test_img.py YOUR_IMAGE_PATH --model_dir ./save_model/all_in_one/ --save_image True --save_name images/sample_test.jpg --save_file sample.txt to test mtcnn with the provided model. You can also provide your own training model directory to do the test or use the new_saver model, trained with less no. of epochs. If there are multiple models in the directory, the program will automatically choose the model with the maximum iterations.

Results

sample.jpg

Reference

[1] MTCNN paper link: Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks

[2] MTCNN official code: MTCNN with Caffe

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.