opencv-mtcnn
说明: opencv-mtcnn,一种使用opencv的DNN模块的mtcnn人脸检测器的实现
(opencv-mtcnn,An implementation of MTCNN Face detector using OpenCV s DNN module)
文件列表:
.gitignore (308, 2018-10-23)
CMakeLists.txt (239, 2018-10-23)
LICENSE (11357, 2018-10-23)
data (0, 2018-10-23)
data\2007_007763.jpg (89619, 2018-10-23)
data\2007_007763_result.jpg (92162, 2018-10-23)
data\Aaron_Peirsol_0003.jpg (14060, 2018-10-23)
data\dogs.jpg (175216, 2018-10-23)
data\models (0, 2018-10-23)
data\models\det1.caffemodel (28163, 2018-10-23)
data\models\det1.prototxt (2353, 2018-10-23)
data\models\det2.caffemodel (407910, 2018-10-23)
data\models\det2.prototxt (3159, 2018-10-23)
data\models\det3.caffemodel (1558412, 2018-10-23)
data\models\det3.prototxt (3931, 2018-10-23)
lib (0, 2018-10-23)
lib\CMakeLists.txt (845, 2018-10-23)
lib\include (0, 2018-10-23)
lib\include\mtcnn (0, 2018-10-23)
lib\include\mtcnn\detector.h (621, 2018-10-23)
lib\include\mtcnn\face.h (3487, 2018-10-23)
lib\include\mtcnn\helpers.h (710, 2018-10-23)
lib\include\mtcnn\onet.h (605, 2018-10-23)
lib\include\mtcnn\pnet.h (891, 2018-10-23)
lib\include\mtcnn\rnet.h (606, 2018-10-23)
lib\src (0, 2018-10-23)
lib\src\detector.cc (1744, 2018-10-23)
lib\src\onet.cc (2391, 2018-10-23)
lib\src\pnet.cc (3496, 2018-10-23)
lib\src\rnet.cc (1998, 2018-10-23)
sample (0, 2018-10-23)
sample\CMakeLists.txt (1063, 2018-10-23)
sample\src (0, 2018-10-23)
sample\src\main.cc (2419, 2018-10-23)
# opencv-mtcnn
This is an inference implementation of MTCNN (Multi-task Cascaded Convolutional Network) to perform Face Detection and Alignment using OpenCV's DNN module.
## MTCNN
[ZHANG2016] Zhang, K., Zhang, Z., Li, Z., and Qiao, Y. (2016). Joint face detection and alignment using multitask cascaded convolutional networks. IEEE Signal Processing Letters, 23(10):1499“1503.
https://kpzhang93.github.io/MTCNN_face_detection_alignment/paper/spl.pdf
## OpenCV's DNN module
Since OpenCV 3.1 there is a module called DNN that provides the inference support. The module is capable of taking models & weights from various popular frameworks such as Caffe, tensorflow, darknet etc.
You can read more about it here - https://github.com/opencv/opencv/wiki/Deep-Learning-in-OpenCV
Note that at present there is no support to perform training in OpenCV's DNN module and if I understood correctly there is no intention either.
## Compile / Run
### Requirements
* OpenCV 3.4+
* Boost FileSystem (1.58+) [only required for the sample application]
* CMake 3.2+
I am using CMake as the build tool. Here are the steps to try the implementation -
```bash
# compiling the library and the sample application
git clone https://github.com/ksachdeva/opencv-mtcnn
cd opencv-mtcnn
mkdir build
cd build
cmake ..
cmake --build .
```
```bash
# running the sample application
cd build
./sample/app
# here are some example cmd lines to run with the model and images in the test repository
# An image with 0 human faces (have picture of 4 dogs)
./sample/app ../data/models ../data/dogs.jpg
# An image with 1 face
./sample/app ../data/models ../data/Aaron_Peirsol_0003.jpg
# An image with 7 faces
./sample/app ../data/models ../data/2007_007763.jpg
```
## Result
Here is an example of how the execution of the sample application looks like

## Acknowledgments
Most of the implementations of MTCNN are based on either Caffe or Tensorflow. I wanted to play with OpenCV's DNN implementation and understand the paper bit better. While implementing it, I looked at various other C++ implementations (again all of them use Caffe) and more specifically borrowed utilities from https://github.com/golunovas/mtcnn-cpp. IMHO, I found his implementation (in C++) that is based on Caffe to be the cleanest amongst many others.
The model files are taken from https://github.com/kpzhang93/MTCNN_face_detection_alignment/tree/master/code
The image file "Aaron_Peirsol_0003.jpg" is from the LFW database (http://vis-www.cs.umass.edu/lfw/)
The image files "dog.jpg" & "2007_007763.jpg" are from dlib's github repository (https://github.com/davisking/dlib/blob/master/examples/faces)
近期下载者:
相关文件:
收藏者: