seetaface由中科院计算所山世光研究员带领的人脸识别研究组研发。代码基于C++实现,不依赖第三方库。然而,目前开源的代码,是在windows vs上编译的,对于我们这帮mac/linux用户来说,用起来还是挺麻烦的。网上也有不少关于Linux的编译过程详解。然而针对嵌入式平台的移植依然少见:
安装seetaface
git clone https://github.com/seetaface/SeetaFaceEngine.git
cd SeetaFaceEngine
cd FaceDetection/
vim CMakeLists.txt
修改 set(USE_SSE "Set to ON to Build use SSE" OFF)
mkdir build
cd build
cmake ..
make -j4
=================================================完
cd FaceAlignment/
vim CMakeLists.txt
#注释 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")
mkdir build/
cd build
cmake ..
cp FaceDetection/build/libseeta_facedet_lib.so .
export CPLUS_INCLUDE_PATH=/home/pi/SeetaFaceEngine/FaceDetection/inlude/
make -j4
========================================================完
cd FaceIdentification/
vim CMakeLists.txt
修改 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
为:set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -L /home/pi/SeetaFaceEngine/FaceAlignment/build -lseeta_facedet_lib -lseeta_fa_lib")
mkdir build/cd build/
vim ../src/math_functions.cpp
注释//#include<xmmintrin.h>
注释
/*
#ifdef _WIN32
#include <intrin.h>
#else
#include <x86intrin.h>
*/
注释函数simd_dot()
改写为:
float simd_dot(const float* x, const float* y, const long& len){
float inner_prod = 0.0f;
long i;
for(i = 0; i < len; i++){
inner_prod += x[i] * y[i];
}
return inner_prod;
}
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/home/pi/SeetaFaceEngine/FaceAlignment/include
cmake ..
cp ../../FaceAlignment/build/*.so .
vim ../src/test/test_face_recognizer.cpp
增加:
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
vim ../src/test/test_face_verification.cpp
增加:
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
make -j4
========================================完