Ubuntu16.04下SeetaFace配置

SeetaFace简介

seetaface是中科院计算所山世光老师组的开源人脸识别项目
https://github.com/seetaface/SeetaFaceEngine

配置要求

CMake版本需超过3.1,本教程使用3.13.2
需配置过opencv
本教程ubuntu版本:16.04

参考教程

https://blog.csdn.net/u012235003/article/details/54576923

步骤

1. 编译FaceDetection

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

配置完成后测试,注意imagefilePath需要自己修改成具体位置

./build/facedet_test imagefilePath ./model/seeta_fd_frontal_V1.0.bin  #imagefilePath是640*480图片的路径

2. 编译FaceAlignment

mkdir build  #在FaceAlignment目录中

将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);

回到FaceAlignment文件夹下

cd build #进入到刚才创建的build文件夹
cmake ..
make

拷贝/FaceDetection/build文件夹下的seeta_fd_frontal_v1.0.bin文件到FaceAlignment的build中

cd .. #回到FaceAlignment文件夹下
./build/fa_test  #运行人脸关键点检测

3. 编译FaceIdentification

mkdir build  #在FaceIdentification目录中

将以下四个文件添加到FaceIndentification/build中

  • libseeta_facedet_lib.so(/FaceDetection/build)
  • seeta_fd_frontal_v1.0.bin(/FaceDetection/model)
  • libseeta_fa_lib.so(FaceAlignment/build)
  • seeta_fa_v1.1.bin(FaceAlignment/model)

将以下两个文件添加到FaceIndentification/include中

  • face_alignment.h(FaceAlignment/include)
  • face_detection.h(/FaceDetection/include)

打开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

!这里注意要改一下FaceIdentification/src/test/test_face_verification.cpp
不然回头会报Segmentation fault
在这里插入图片描述

进入FaceIdentification\build文件夹下进行编译

cmake .. 
make  

回到FaceIdentification文件夹中进行测试

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

即可输出相似度分数
在这里插入图片描述

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu 16.04(代号Xenial Xerus)是一个非常稳定的操作系统版本,支持多网卡配置。为了使计算机能够同时连接到多个网络并管理这些连接,需要进行适当的网络设置。以下是如何在Ubuntu 16.04上进行多网卡配置的基本步骤: ### 步骤一:识别和添加新网卡 首先,在终端中输入以下命令查看当前已安装的所有硬件驱动程序: ``` lsmod | grep e1000 lsmod | grep ixgbe lsmod | grep igb ``` 这将显示已加载的网络设备模块名称。例如,如果你有一块Intel网卡,可能会看到`igb`模块。 **添加新网卡:** 假设你添加了一个新的网卡,并将其命名为了eth1,你可以通过运行以下命令来启用它: ```bash sudo modprobe ethx # 使用实际的网卡名替换ethx ifconfig eth1 up # 启动新网卡 ip addr add 192.168.2.2/24 dev eth1 # 配置IP地址及子网掩码,根据实际情况调整IP地址 ip link set up eth1 # 确保网卡开启 ``` ### 步骤二:编辑网络配置文件 接下来,编辑网络配置文件以包含新的网卡设置。默认路径通常是 `/etc/network/interfaces` 或 `/etc/netplan/50-cloud-init.yaml`,取决于你是否正在使用Netplan作为网络管理工具。 #### 使用 `network/interfaces` 文件配置: 打开 `/etc/network/interfaces` 并添加如下内容: ```bash # 网络配置文件 auto lo iface lo inet loopback allow-hotplug ens33 iface ens33 inet dhcp # 如果是动态IP分配 auto eth1 iface eth1 inet static address 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.1 ``` **注意:** 将上述配置中的 IP 地址、子网掩码和默认网关更改为你的需求。 #### 使用 Netplan 配置: 如果你使用的是 Netplan(通常在较新版本的Ubuntu中),你需要编辑 `/etc/netplan/50-cloud-init.yaml`,并添加如下内容: ```yaml network: version: 2 ethernets: ens33: dhcp4: true eth1: addresses: [192.168.1.2/24] gateway4: 192.168.1.1 nameservers: addresses: [8.8.8.8] ``` **保存更改并重启网络服务**: 执行以下命令以应用更改: ```bash sudo netplan apply sudo service networking restart ``` ### 步骤三:验证网络设置 最后,可以检查网络配置和连接状态: ```bash ifconfig -a # 查看所有网络接口的状态 ping <目标IP> # 测试网络连通性 ``` 这将帮助您确认多网卡配置已经成功完成并且工作正常。 --- ### 相关问题: 1. 安装和配置额外的网络设备后,如何确定其正确配置了IP地址? 2. 在Ubuntu 16.04中使用多个网络接口有何优势? 3. 如何管理和切换不同的网络连接(例如,从无线网络切换到有线网络)? 这个示例涵盖了基本的多网卡配置流程。对于更复杂的场景,如路由设置或网络安全性考虑,则需要进一步的研究和配置
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值