Seetaface 03 Seetaface python版 win10 vs2015编译

01 环境

win10x64
vs2015 update3
cmake3.7.2
git
源码:https://github.com/5455945/SeetaFaceEngine.git
如果要测试python demo,需要系统安装对应的python版本opencv。
pip3 install opencv-python
本实验使用的是opencv-python==3.2.0.7
需要安装numpy库。本实验使用的:numpy==1.13.0+mkl

02 源码下载

cd D:\git\DeepLearning
git clone https://github.com/5455945/SeetaFaceEngine.git
cd SeetaFaceEngine

03 配置cmake-gui

点击[Configure]。设置:
源码路径:D:/git/DeepLearning/SeetaFaceEngine
目标路径:D:/git/DeepLearning/SeetaFaceEngine/build/x64
勾选BUILD_SEETAFACEENGINE
不选BUILD_EXAMPLES、BUILD_SFMFCTEST
设置CMAKE_INSTALL_PREFIX
USE_OPENMP、USE_SSE默认勾选

BUILD_EXAMPLES=0
BUILD_SEETAFACEENGINE=1
BUILD_SFMFCTEST=0
CMAKE_INSTALL_PREFIX=D:/git/DeepLearning/SeetaFaceEngine/build/x64/install
USE_OPENMP=1
USE_SSE=1

这里写图片描述

注:如果要设置BUILD_EXAMPLES=1BUILD_SFMFCTEST=1,需要配置OpenCV_DIR,因为这两个C++的用例使用了opencv。参考:Seetaface 01 Seetaface win10 vs2015编译(cmake自动配置,可选mfc界面)

此案及[Configure]、点击[Generate],完成后,点击[Open Project]打开vs2015
D:\git\DeepLearning\SeetaFaceEngine\build\x64\SeetaFaceEngine.sln

04 编译

vs2015打开D:\git\DeepLearning\SeetaFaceEngine\build\x64\SeetaFaceEngine.sln后,直接build Release版本后,再build INSTALL工程,完成python版本的安装。
这里写图片描述

INSTALL后,python版本算有3份拷贝。
1 Python安装目录下的Lib\site-packages\SeetaFaceEngine-0.1-py3.6.egg
本实验在C:\Python36\Lib\site-packages\SeetaFaceEngine-0.1-py3.6.egg
这里写图片描述

2 SeetaFaceEngine\python源码目录下,把需要的bin(dll)文件和model文件拷贝过来了。
这里写图片描述

3 CMAKE_INSTALL_PREFIX指定的安装目录下的python文件夹。内容和2 SeetaFaceEngine\python相同。
D:\git\DeepLearning\SeetaFaceEngine\build\x64\install\python
这里写图片描述

注:这里1不是必须的。只要系统环境安装了opencv-python,和vs2015
运行时库。把SeetaFaceEngine\python完整拷贝到任意处,都可以正常运行。

05 测试

用PyCharm打开test_opencv.py、test_pillow.py运行。“`
C:\Python36\python.exe D:/git/DeepLearning/SeetaFaceEngine/python/test_opencv.py
C:\Python36\python.exe D:/git/DeepLearning/SeetaFaceEngine/python/test_pillow.py

test_opencv.py运行结果:

test detector:
(602,126,828,352) score=21.732229948043823
(457,77,596,216) score=30.60622215270996
(247,187,368,308) score=11.426725625991821
(298,13,343,58) score=14.56250661611557
(244,6,279,41) score=4.99791157245636
test aligner:
test identifier:
sim: [0.502326250076294, 0.2604138255119324]
“`
这里写图片描述

这里写图片描述

这里写图片描述

可自行修改test_opencv.py、test_pillow.pyif __name__ == '__main__':部分。比如:使用命令行等。
这里写图片描述

06 参考

本python代码修改自https://github.com/TuXiaokang/pyseeta.git

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值