安装OpenCV 这个一开始配置,消耗时间,主要就交叉编译的问题,网上查一下,最后test一下成功就OK
copy开源Seetaface
第一步进入FaceDetection
PS:因为build下是别人生成的额,我生成的都放在build2下,一样的
!!!!!!操作步骤必须和Readme一样!!!!!
我们在Linux上操作所以只要做这部分:
How to Build in Linux
- Build
mkdir build
cd build
cmake ..
make -j${nproc}
2. Run demo
-shell
./build/facedet_test image_file model/seeta_fd_frontal_v1.0.bin
这一步为生成seeta_fd_frontal_v1.0.bin,后面需要使用!
我运行test的结果:
- 第二步进入FaceAlignment
同样根据Readme
### Build in Linux
mkdir build
//copy the "face detection lib" and "face_detection.h" to the //directory "build" for building the test example.
cd build
cmake ..
make
If everything goes fine, move on to test the program. Note: you should copy the face detetion model [seeta_fd_frontal_v1.0.bin](../FaceDetection/model/seeta_fd_frontal_v1.0.bin) to the directory "build" before testing.
cd ..
./build/fa_test
The alignment results are stored in "result.jpg".
运行test后build下为:
6. 第三步进入Indentification
同样根据Readme
Linux & Mac OS
//Change current working directory to `SeetaFace/FaceIdentification` //and run the following command:
mkdir build
cd build
cmake .. && make
//If everything goes fine, move on to test the program:
./build/src/test/test_face_recognizer.bin
要把之前需要用到的lib和bin拷贝过来,因为识别需要之前的人脸标注和特征点
运行test完成表明配置完成了!
自己根据项目改的结果
一些数据也被注释掉了。反正要出好多数据
程序运行终于的问题总结:
1、mkdir build 将src/test 下的facedetection cpp 加入头文件include <cv.h> 在build 下make
2、./build2/facedet_test image_file ./model/seeta_fd_frontal_v1.0.bin
3、提示:copy the "face detection lib":libseeta_facedet_lib.a and "face_detection.h" to the directory "build" for building the test example.
4、在Alignment里build2下运行./fa_test
5、Identification问题:/usr/bin/ld: cannot find -lseeta_facedet_lib
/usr/bin/ld: cannot find -lseeta_fa_lib
6、要在make之后的FaceIdentification的build2中加入图像 pic1 pic2 pic1_g pic2_g
还要加入seeta_fa_v1.1bin & seeta_fd_frontal_v1.0.bin 这两个其他文件的moudle
7、首先在build2下 进行 ./src/test/test_face_verification.bin 成功
8、在到Identification下的src 的test中对test_face_recognizer.cpp修改
需要添加如下缺少的代码后重新再build2下make
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "face_identification.h"
#include "common.h"
#include "math.h"
#include "time.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include "ctime"
#include "common_net.h"
#include "bias_adder_net.h"
#include "bn_net.h"
#include "conv_net.h"
#include "eltwise_net.h"
#include "inner_product_net.h"
#include "max_pooling_net.h"
#include "spatial_transform_net.h"
#include "pad_net.h"
using namespace seeta;
REGISTER_NET_CLASS(Common);
REGISTER_NET_CLASS(BiasAdder);
REGISTER_NET_CLASS(Bn);
REGISTER_NET_CLASS(Conv);
REGISTER_NET_CLASS(Eltwise);
REGISTER_NET_CLASS(InnerProduct);
REGISTER_NET_CLASS(MaxPooling);
REGISTER_NET_CLASS(SpatialTransform);
REGISTER_NET_CLASS(Pad);
1、按照READme操作,Detection-----Alignment------Identification
新建build文件夹,在下面生成文件