Adding a bit more explanation about face detection and better integration with MatConvNet.

This commit is contained in:
Tadas Baltrusaitis
2017-08-08 11:04:27 -04:00
parent f18e4264b8
commit 54d06e1a4c
3 changed files with 35 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
function setup(varargin)
try
run D:\soft\matconvnet-master\matconvnet-master\matlab/vl_setupnn ;
addpath D:\soft\matconvnet-master\matconvnet-master\examples ;
opts.useGpu = false ;
opts.verbose = false ;
opts = vl_argparse(opts, varargin) ;
try
vl_nnconv(single(1),single(1),[]) ;
catch
warning('VL_NNCONV() does not seem to be compiled. Trying to compile it now.') ;
vl_compilenn('enableGpu', opts.useGpu, 'verbose', opts.verbose) ;
end
if opts.useGpu
try
vl_nnconv(gpuArray(single(1)),gpuArray(single(1)),[]) ;
catch
vl_compilenn('enableGpu', opts.useGpu, 'verbose', opts.verbose) ;
warning('GPU support does not seem to be compiled in MatConvNet. Trying to compile it now') ;
end
end
catch
fprintf('Could not setup MatConvNet, face detection will be slower, install the library and set the right location for it in setup_mconvnet.m\n');
end

View File

@@ -1,7 +1,7 @@
function [total_bboxes, lmarks, confidence] = detect_face_mtcnn(img, min_face_size)
% Check if MatConvNet is installed
if(~exist('vl_nnconv', 'file') == 3)
if(exist('vl_nnconv', 'file') ~= 3)
fprintf('Warning MatConvNet is not installed or not setup, face detection will be quite slow\n');
end

View File

@@ -0,0 +1,6 @@
My re-implementation of MTCNN face detector (https://github.com/kpzhang93/MTCNN_face_detection_alignment) using Matlab and MatcConvNet.
It uses MatConvNet to speed up face detection, and is able to use GPU support. Alternatively, if MatConvNet is not installed the approach will use Matlab native functions for processing (much slower).
MatConvNet version used:
- MatConvNet from http://www.vlfeat.org/matconvnet/ (tested with version 1.0-beta24), and install following the instructions