当前位置: 首页 > news >正文

SeetaFaceEngine安装和测试

一.介绍

必须安装好opencv。
SeetaFace人脸识别引擎包括了搭建一套全自动人脸识别系统所需的三个核心模块,
即:人脸检测模块SeetaFace Detection、面部特征点定位模块SeetaFace Alignment以及人脸特征提取与比对模块 SeetaFace Identification。
主要功能:
1.人脸检测模块(SeetaFace Detection): 采用了一种结合传统人造特征与多层感知机(MLP)的级联结构,在FDDB上达到了84.4%的召回率(100个误检时),并可在单个i7 CPU上实时处理VGA分辨率的图像。
2.面部特征点定位模块(SeetaFace Alignment): 通过级联多个深度模型(栈式自编码网络)来回归5个关键特征点(两眼中心、鼻尖和两个嘴角)的位置,在AFLW数据库上达到state-of-the-art的精度,定位速度在单个i7 CPU上超过200fps。
3.人脸识别模块(SeetaFace Identification): 采用一个9层的卷积神经网络(CNN)来提取人脸特征,在LFW数据库上达到97.1%的精度(注:采用SeetaFace人脸检测和SeetaFace面部特征点定位作为前端进行全自动识别的情况下),特征提取速度为每图120ms(在单个i7 CPU上)。

二.前提

ubuntu14.04
opencv3.1.0

三.下载解压和安装cmake3.1

(1)下载解压
https://github.com/seetaface/SeetaFaceEngine
下载好后,解压到用户目录

unzip SeetaFaceEngine.zip #注意自己的版本

(2)安装升级cmake3.1

cmake --version #如果版本低于3.1,需要升级。14.04的是2.8
apt-get autoremove cmake  #卸载低版本cmake
cd /usr
wget https://cmake.org/files/v3.1/cmake-3.1.3-Linux-i386.tar.gz
tar zxvf cmake-3.1.3-Linux-i386.tar.gz  #解压自己下的版本
ln -s /usr/cmake-3.1.3-Linux-i386/bin/* /usr/bin/  #创建链接

cmake --version#查看升级是否成功

四.编译和测试

1.编译测试FaceDetection

mkdir build #在FaceDetection目录中
cd build
cmake ..
make -j${npoc}
cd ..


#若无问题,进入到测试
./build/facedet_test imagefilePath ./model/seeta_fd_frontal_V1.0.bin  #imagefilePath是640*480图片的路径

如果提示:段错误(核心已转储)
解决办法:1.查看路径有无问题。2.重启。
效果
这里写图片描述
2.编译测试FaceAlignment

mkdir build

编译之前,将FaceDetection中的/include/face_detection.h和/build/libseeta_facedet_lib.so
拷贝到/FaceAlignment/build文件夹下。
然后在FaceAlignment>src>test中face_alignment_test.cpp中

int main(int argc, char** argv)
{
// Initialize face detection model
seeta::FaceDetection detector("./build/seeta_fd_frontal_v1.0.bin"); //修改路径
//修改成这个路径,把seeta_fd_frontal_v1.0.bin放到build中。原版是基于windows的。
detector.SetMinFaceSize(40);
detector.SetScoreThresh(2.f);
detector.SetImagePyramidScaleFactor(0.8f);
detector.SetWindowStep(4, 4);

保存退出。
shell

cd build
cmake ..
make

如果一切正常,
先要拷贝/FaceDetection/build文件夹下的seeta_fd_frontal_v1.0.bin文件到FaceAlignment的build中。
shell

cd ..
./build/fa_test

运行效果,可以提取出特征值。
这里写图片描述
3.编译测试FaceIndentification
shell

mkdir build

(1)添加文件
将libseeta_facedet_lib.so(/FaceDetection/build),libseeta_fa_lib.so(FaceAlignment/build),
seeta_fd_frontal_v1.0.bin(/FaceDetection/model),seeta_fa_v1.1.bin(FaceAlignment/model),添加到FaceIndentification/build中
将face_alignment.h(FaceAlignment/include),face_detection.h(/FaceDetection/include)添加到FaceIndentification/include中

(2)修改文件
打开FaceIdentification/src/test/CMakeLists.txt将文件替换成如下内容

aux_source_directory (. SRC_LIST)
link_directories(${PROJECT_BINARY_DIR})
message(${SRC_LIST})
# add external libraries
find_package(OpenCV REQUIRED)
include_directories(${seeta_facedet_lib_INCLUDE_DIRS} ${seeta_fa_lib_INCLUDE_DIRS})
list(APPEND seeta_fi_lib_required_libs ${OpenCV_LIBS} seeta_facedet_lib seeta_fa_lib)
enable_testing ()
foreach (f ${SRC_LIST})
  string(REGEX REPLACE "[.]cpp" ".bin" BIN ${f})
  add_executable(${BIN} ${f})
  #target_link_libraries(${BIN} viplnet ${OpenCV_LIBS} seeta_facede_lib seeta_fa_lib)
  target_link_libraries(${BIN} viplnet ${seeta_fi_lib_required_libs})
endforeach ()

在 FaceIdentification/src/test/test_face_recognizer.cpp文件中添加如下内容头文件

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

在 FaceIdentification/src/test/test_face_verification.cpp文件中添加如下内容头文件

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

解压 FaceIdentification/model/seeta_fr_v1.0.part1.rar

 sudo apt-get install unrar
unrar seeta_fr_v1.0.part1.rar

(3)编译

mkdir build
cd build
cmake .. 
make  #如出错,请检查文件添加好

(4)运行

./build/src/test/test_face_recognizer.bin #3个单元测试函数
./build/src/test/test_face_verification.bin #比较两个图像相似度

效果:检测的是FaceIdentification/data/test_face_recognizer/images/compare_im下的图片相似度
0.680086

相关文章:

  • yolo的安装和使用
  • yolo-v1 train和test自己的分类和数据
  • yolo-v2修改只识别person
  • zigbee编译错误汇总(一)
  • 1.The Graphics View Architecture(图形视图框架)
  • 3.The Graphics View Coordinate System(图形视图坐标系)
  • 2.Classes in the Graphics View Framework(图形视图框架中的类)
  • 4.Key Features(主要特征)
  • 5.Performance(性能)
  • linux解决wifi问题
  • 比较C++中数组,vector,array
  • 一、opencv的图像基本读写
  • 二、opencv的滑块使用
  • 三、Mat类的使用
  • 四、常用数据结构和函数
  • 230. Kth Smallest Element in a BST
  • Babel配置的不完全指南
  • CentOS 7 修改主机名
  • css的样式优先级
  • ES6--对象的扩展
  • exports和module.exports
  • Laravel 中的一个后期静态绑定
  • Laravel核心解读--Facades
  • leetcode388. Longest Absolute File Path
  • rabbitmq延迟消息示例
  • 读懂package.json -- 依赖管理
  • 微信小程序:实现悬浮返回和分享按钮
  • 一起来学SpringBoot | 第三篇:SpringBoot日志配置
  • 译有关态射的一切
  • ​ubuntu下安装kvm虚拟机
  • ​如何使用ArcGIS Pro制作渐变河流效果
  • ​软考-高级-系统架构设计师教程(清华第2版)【第15章 面向服务架构设计理论与实践(P527~554)-思维导图】​
  • ​一、什么是射频识别?二、射频识别系统组成及工作原理三、射频识别系统分类四、RFID与物联网​
  • #周末课堂# 【Linux + JVM + Mysql高级性能优化班】(火热报名中~~~)
  • $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • (6)STL算法之转换
  • (6)设计一个TimeMap
  • (Matalb分类预测)GA-BP遗传算法优化BP神经网络的多维分类预测
  • (Redis使用系列) Springboot 实现Redis 同数据源动态切换db 八
  • (六) ES6 新特性 —— 迭代器(iterator)
  • (六)什么是Vite——热更新时vite、webpack做了什么
  • (心得)获取一个数二进制序列中所有的偶数位和奇数位, 分别输出二进制序列。
  • ..thread“main“ com.fasterxml.jackson.databind.JsonMappingException: Jackson version is too old 2.3.1
  • .axf 转化 .bin文件 的方法
  • .Net Core 中间件验签
  • .net web项目 调用webService
  • .NET 材料检测系统崩溃分析
  • .net 反编译_.net反编译的相关问题
  • .NET 使用 XPath 来读写 XML 文件
  • .net 中viewstate的原理和使用
  • .NET/C# 使窗口永不激活(No Activate 永不获得焦点)
  • .NetCore Flurl.Http 升级到4.0后 https 无法建立SSL连接
  • .NET单元测试
  • .Net各种迷惑命名解释
  • .net企业级架构实战之7——Spring.net整合Asp.net mvc