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 SeetaFaceEngine03 配置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=1或BUILD_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 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。
總結
以上是生活随笔為你收集整理的Seetaface 03 Seetaface python版 win10 vs2015编译的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 哈希密码_哈希生日和密码
- 下一篇: 微信自动打招呼功能