Git Product home page Git Product logo

mtcnn-tensorflow-1's Introduction

MTCNN-tf

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

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/ to test mtcnn with the provided model. You can also provide your own training model directory to do the test. If there are multiple models in the directory, the program will automatically choose the model with the maximum iterations.

Results

test1.jpg test2.jpg

Reference

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

[2] MTCNN official code: MTCNN with Caffe

mtcnn-tensorflow-1's People

Contributors

baomingwang avatar

Watchers

James Cloos avatar SEUNG HYUN KO avatar  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.