您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 国内外标准规范 > 在linux环境下配置SeetaFace人脸检测-人脸识别-人脸比对环境
在linux环境下配置SeetaFace环境官方下载链接:使用vs的可以看这里——实现:源码可参照:=52641735本次使用Vmwareubuntu16.04.1server64位服务器版本,客户端使用xshell5、xmanager5连接。cmakeversion3.5.1OpenCVversion3.2.0安装前准备1.#!/bin/sh2.sudoapt-getinstallbuild-essential-y3.sudoapt-getinstallcmake-y4.sudoapt-getinstallcurl-y5.sudoapt-getinstallgfortran-y6.sudoapt-getinstallgit-y7.sudoapt-getinstalllibatlas-dev-y8.sudoapt-getinstalllibavcodec-dev-y9.sudoapt-getinstalllibavformat-dev-y10.sudoapt-getinstalllibboost-all-dev-y11.sudoapt-getinstalllibgtk2.0-dev-y12.sudoapt-getinstalllibjpeg-dev-y13.sudoapt-getinstallliblapack-dev-y14.sudoapt-getinstalllibswscale-dev-y15.sudoapt-getinstallpkg-config-y16.sudoapt-getinstallpython-dev-y17.sudoapt-getinstallpython-pip-y18.sudoapt-getinstallpython-numpy19.sudoapt-getinstallwget-y20.sudoapt-getinstallzip–y21.sudoapt-getinstallqt5-defaultqtcreator22.sudoapt-getinstalllibv4l-0libv4l-devlibv4l2rds0libv4lconvert0libxaw7使用vmware安装ubuntu16,官网下载ubuntu-16.04.1-server-amd64.iso安装后,使用#sudo–s输入普通用户密码后登陆root用户。安装vmware-tools工具,点击“虚拟机”-“安装vmware-tools”,Ubuntu14挂载光驱Ubuntu用指令掛載CDROM已經不用像以前那樣,在mount的時候,要給一堆的參數才能掛載,現在,只要先用下面的這一行指令來找出CDROM的代碼。ls/dev|grepcdrom然後,再直接用那個代碼來掛載就可以了,例如阿舍用上面的指令找到的CDROM代碼是cdrom,那就可以用下面的這一行指令來把它掛載到/media/cdrom資料夾用哩!sudomount/dev/cdrom/media/cdrom在Linux虚拟机中手动安装或升级VMwareToolscd/media/cdromls如果cdrom设置的是只读的,则需要将文件移动到其他目录下,tarzxpfVMwareTools-x.x.x-yyyy.tar.gz如果需要,请卸载CD-ROM映像。umount/dev/cdrom运行安装程序并配置VMwareTools。cdvmware-tools-distrib./vmware-install.pl通常,在安装程序文件结束运行后,将运行vmware-config-tools.pl配置文件。看到上图,就安装完成了。设置共享文件夹:参考了以下博文:(主要参考这篇文章,非常感谢~)1.安装/升级cmake安装cmakesudoapt-getinstallcmake升级cmakesudoapt-getupgrade安装完后,用命令:cmake--version查看当前的cmake版本2.安装OpenCV(1)下载opencvforlinux:(2)从共享文件夹复制安装文件到用户目录下cp/mnt/hgfs/opencv-3.2.0.zip/home/ubuntuunzip检查opencv版本命令pkg-config--modversionopencv(3)编译cd~/opencv#移动到源文件文件夹中mkdirreleasecdreleasecmake-DCMAKE_BUILD_TYPE=RELEASE-DCMAKE_INSTALL_PREFIX=/usr/local..#在上面步骤结束之后进行makemakesudomakeinstall#该命令行必须如果遇到:make:***Notargetsspecifiedandno错误make:***Notargetsspecifiedandnomakefilefound.Stop.解决方法安装yumsudoapt-getinstallyumUbuntu16.04上安装gedit,下一步要用到sudoapt-getupdatesudoapt-getinstallgedit-gmatesudoapt-getinstallgedit-pluginssudoapt-getremovegeditsudoapt-getinstallgeditUbuntu16.04上安装arm-linux-gcc-4.4.3安装GCC#yuminstallgccgcc-c++autoconfautomake一、首先下载arm-linux-gcc-4.4.3.tar.gz安装包,安装包地址二、解压安装包:sudotar-zxvfarm-linux-gcc-4.4.3.tar.gz-C/注意C后面有一个空格,这样解压完成后的文件在:/opt/FriendlyARM/toolschain/4.4.3路径下三、在/usr/local目录下新建arm目录,并拷贝/opt/FriendlyARM/toolschain/路径下的4.4.3到arm目录:cd/usr/localsudomkdirarmsudochmod777armsudocp-r/opt/FriendlyARM/toolschain/4.4.3/usr/local/arm四、修改环境变量,把arm-linux-gcc添加到PATH中:方法一:修改/etc/bash.bashrc文件,此文件只对当前用户适用sudogedit/etc/bash.bashrc在最后加上exportPATH=$PATH:/usr/local/arm/4.4.3/bin保存,退出,然后刷新环境变量使其生效:source/root/.bashrc方法二:修改/etc/profile文件,此文件对所有用户适用sudogedit/etc/profile在最后加上exportPATH=$PATH:/usr/local/arm/4.4.3/bin保存,退出,然后刷新环境变量使其生效:source/etc/profile方法三:修改/etc/environment文件sudogedit/etc/environment在最后加上:/usr/local/arm/4.4.3/bin保存,退出,然后重启系统(4)安装完成后需要对系统相关环境变量进行配置:sudogedit/etc/ld.so.conf.d/opencv.conf将以下内容添加到最后:/usr/local/lib接下来配置库:sudoldconfig更改环境变量:sudogedit/etc/bash.bashrc在文件后添加:PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfigexportPKG_CONFIG_PATH保存退出,在运行下面的例程之前,需要重新开启终端来使配置生效。3.配置SeetaFace(1)SeetaFacedetection人脸检测(检测图片中人脸的位置,并进行标注)mkdirbuild#在FaceDetection目录中cdbuildcmake..make-j${npoc}可能出现/usr/bin/ld:cannotfind-lopencv_dep_cudart解决方法,在执行cmake的时候加入下面的参数CUDA_USE_STATIC_CUDA_RUNTIME=OFF,例如cmake-DCUDA_USE_STATIC_CUDA_RUNTIME=OFF..rundemo./build/facedet_testimagefilePath./model/seeta_fd_frontal_V1.0.binerror:‘isnan’wasnotdeclaredinthisscope解决方法,修改文件中的isnan为“std::isnan”找几张有人脸的图片进行测试:sudo-icd/home/ubuntu/SeetaFaceEngine-master/FaceDetection/./build/facedet_test/home/ubuntu/faceimg/face1.jpg./model/seeta_fd_frontal_v1.0.bin如果ubuntu是安装的server版本,没有图形界面,可能会遇到一下问题:QXcbConnection:Couldnotconnecttodisplayssh192.168.49.12822–X如果出现以下错误:exportDISPLAY=192.168.49.1:0.0(自己机子的ip加上0.0)查看本机ip地址测试一:测试二:测试三:侧脸也能识别测试四:有几个没有检测到(2)安装SeetaFaceAlignment人脸对准(将图片中人脸的眼睛、鼻子、嘴进行标注-面部五点)mkdirbuild#在FaceAlignment目录中cdbuild然后将FaceDetection中的/include/face_detection.h和/build/libseeta_facedet_lib.so拷贝到/FaceAlignment/build文件夹下和model文件夹下,为了生成testexamplecp/home/ubuntu/SeetaFaceEngine-master/FaceDetection/include/face_detection.h./cp/home/ubuntu/SeetaFaceEngine-master/FaceDetection/build/libseeta_facedet_lib.so./#将FaceDetection/include/face_detection.h和#FaceDetection/build/libseeta_facedet_lib_so分别拷贝到#FaceAlignment/include和FaceAlignment/build目录下cp/home/ubuntu/SeetaFaceEngine-master/FaceDetection/include/face_detection.h../model/cp/home/ubuntu/SeetaFaceEngine-master/FaceDetection/build/libs
本文标题:在linux环境下配置SeetaFace人脸检测-人脸识别-人脸比对环境
链接地址:https://www.777doc.com/doc-4845006 .html