Skip to content

kangzixiang/MTCNN-light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MTCNN-light

Introduction

this repository is the implementation of MTCNN with no framework, only depend on opencv and openblas.
"Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Neural Networks", implemented with C++,no framework
it is very easy for you to use.
it is can be a part of your project with no framework, like caffe and mxnet.
it is real time for VGA, and you can improve it's runtime.

Time Cost

The average time cost is about 68ms per frame(640,480).The result is generated by testing a camera. mini_size is 40
cpu i5-4590
os windows10 64bit

Dependencies

opencv 2.0+
openblas

ubuntu

opencv

you can find many tutorials.

openblas

It is very easy to install

Install from source

1 download the source code from https://github.com/xianyi/OpenBLAS
2 Extract it and type "cd xxx", xxx means the directory
3 type "make"
4 type "make install PREFIX=your_installation_directory"

Install by apt

sudo apt-get install libopenblas-dev

or

sudo apt-cache search openblas

you will get the following message

dmrgpp - Density matrix renormalization group algorithm
libblas-test - Basic Linear Algebra Subroutines 3, testing programs
libblas64-test - Basic Linear Algebra Subroutines 3, testing programs (64bit-index)
libjulia-openblas64 - Optimized BLAS (linear algebra) library (julia version)
libopenblas-base - Optimized BLAS (linear algebra) library (transitional)
libopenblas-dev - Optimized BLAS (linear algebra) library (dev, meta)
libopenblas-openmp-dev - Optimized BLAS (linear algebra) library (dev, openmp)
libopenblas-pthread-dev - Optimized BLAS (linear algebra) library (dev, pthread)
libopenblas-serial-dev - Optimized BLAS (linear algebra) library (dev, serial)
libopenblas0 - Optimized BLAS (linear algebra) library (meta)
libopenblas0-openmp - Optimized BLAS (linear algebra) library (shared lib, openmp)
libopenblas0-pthread - Optimized BLAS (linear algebra) library (shared lib, pthread)
libopenblas0-serial - Optimized BLAS (linear algebra) library (shared lib, serial)
libopenblas64-0 - Optimized BLAS (linear algebra) library (shared lib, 64bit, meta)
libopenblas64-0-openmp - Optimized BLAS (linear algebra) library (shared lib, 64bit, openmp)
libopenblas64-0-pthread - Optimized BLAS (linear algebra) library (shared lib, 64bit, pthread)
libopenblas64-0-serial - Optimized BLAS (linear algebra) library (shared lib, 64bit, serial)
libopenblas64-dev - Optimized BLAS (linear algebra) library (dev, 64bit, meta)
libopenblas64-openmp-dev - Optimized BLAS (linear algebra) library (dev, 64bit, openmp)
libopenblas64-pthread-dev - Optimized BLAS (linear algebra) library (dev, 64bit, pthread)
libopenblas64-serial-dev - Optimized BLAS (linear algebra) library (dev, 64bit, serial)

Then choose a package you want to install by apt

sudo apt-get install libopenblas-dev
#or
sudo apt-get install libopenblas64-dev

if you don't have cmake

apt-get install cmake

Build

cd root_directory   
vim CMakeLists.txt

change include_directories(the_directory_of_openblas_include_of_yours)
change link_directories(the_directory_of_openblas_lib_of_yours)
save and exit

./build.sh 

How to Run

cd products/bin

# 1. run default
./mtcnn_image

# 2. run customize
./mtcnn_image [image path]

for windows

opencv and openblas

There have binary packages of openblas for windows, all you needed is download it to local.
Please be careful, if you download the 64bit, you need configure the opencv and vs project environment with 64bit rather than x86