mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2025-12-30 13:02:30 +00:00
Adding a bit more explanation about face detection and better integration with MatConvNet.
This commit is contained in:
28
matlab_version/demo/setup_mconvnet.m
Normal file
28
matlab_version/demo/setup_mconvnet.m
Normal 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
|
||||
@@ -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
|
||||
|
||||
|
||||
6
matlab_version/face_detection/mtcnn/readme.txt
Normal file
6
matlab_version/face_detection/mtcnn/readme.txt
Normal 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
|
||||
Reference in New Issue
Block a user