重要更新:
在很多嘗試之后無果后,我相信是我的人品問題。今天突然看到一篇文章沃缘,解決我的問題
文章地址
其中有個帥哥的回答是這樣的:
Just go to this page and dowload the Python Wheel file and just pip install it. Or if you want a pre-python 3.6 build you want download it here.
pip install dlib-file.whl
點擊他的第一個鏈接,往下滑孵奶,終于出現(xiàn)了我想要的東西
蒼了個天,果斷下載然后以pip方式進行包的安裝--bingo蜡峰!成功了袁!
接著嘗試
pip install face_recognition
bingo! 成功!之后的內(nèi)容可不看湿颅!
華麗分割線
華麗分割線
華麗分割線
華麗分割線
1.cmake
地址:https://cmake.org/download/
@PBShortStop Installation of CMake in windows is very simple just grab the installation file (*.msi) from this link and install it. Remember to check the "Add CMake to system path" during the installation. Then you can simply use
cmake --version
in command prompt.
繼續(xù)嘗試安裝dlib载绿,shit! 不行
在命令行中嘗試了一下cmake指令,并沒有報錯油航!
嘗試下載dlib離線未編譯版卢鹦,再編譯,運行過程中拋錯誤
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_CXX_COMPILER could be found.
錯誤信息大概如上所示,找解決辦法:看到一篇文章
給出的解決辦法如下所示
查看文件buile/CMakeFiles/CMakeError.log
報錯如下:
LINK : fatal error LNK1158: cannot run 'rc.exe'
解決方法:
1.進入目錄C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
2.拷貝文件:RC.Exe 和 RcDll.Dll
3.放到從CMakeError.log文件中看到的鏈接目錄下冀自,比如:F:\VS\VC\bin
照做,運行還是報一樣的錯誤秒啦,那就是沒有添加到系統(tǒng)環(huán)境變量
嘗試把它添加到系統(tǒng)環(huán)境變量當中熬粗,運行---沒有之前的cmake error了
忘了,之前有一個編譯boost的過程余境,boost的下載地址如下
https://sourceforge.net/projects/boost/files/boost-binaries/
注意事項:下載的boost版本要和MSVC編譯器適配
華麗分割線
以上Windows安裝dlib的指導主要遵循以下知道
原文地址
Hi,
I've successfully installed and tested this tool on my windows 10 machine and I'm writing a simple procedure to install it. It may be useful for some people try to use this tool on a Windows machine.
IMPORTANT: Actually this project has made for Linux systems and especiallydlib
. In my tests, the performance of this tool in Windows 10 was about a quarter in comparison with Ubuntu built with the same specs. But I haven't seen any difference between these two in other subjects.
Requirments:
(I've used this tutorial with these tools installed on Windows 10 but the newer version may work too.)
- Microsoft Visual Studio 2015 with C/C++ Compiler installed. (Visual C++ 2015 Build Tools didn't work for me and I got into problems in compiling
dlib
)Boost
library version 1.63 or newer. Also, you can use precompiled binaries for specific MSVC you have but I don't suggest. (I've included the compiling procedure ofBoost
in this tutorial)- Of course
Python3
(I usedPython3.5 x64
but I think the other versions would work too)CMake
for windows and add it to your system environment variables.
Installation:- Download and install
scipy
andnumpy+mkl
(must be mkl version) packages from this link (all credits goes to Christoph Gohlke). Remember to grab correct version based on your current Python version.- Download
Boost
library source code or binary release for your current MSVC from this link.- If you downloaded the binary version skip to step 4 else follow these steps to compile and build
Boost
by yourself:
3-1. Extract theBoost
source files intoC:\local\boost_1_XX_X
(X means the current version ofBoost
you have)
3-2. Create a system variable with these parameters:
Name:VS140COMNTOOLS
Value:C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
(or any path where you have installed MSVC)
3-3. Open Developer Command Prompt for Visual Studio and go to the current directory ofBoost
extracted and try these commands to compileBoost
:
bootstrap
b2 -a --with-python address-model=64 toolset=msvc runtime-link=static
3-4. If you successfully compileBoost
, it should create compiled files instage
directory.- (If you have already compiled
Boost
skip this step) If you already download the binary release just extract the contents toC:\local\boost_1_XX_X
- Grab latest version of
dlib
from this repo and extract it.- Go to
dlib
directory and open cmd and follow these commands to builddlib
: (remember to replace XX with current version ofBoost
you have)
set BOOST_ROOT=C:\local\boost_X_XX_X
set BOOST_LIBRARYDIR=C:\local\boost_X_XX_X\stage\lib
python setup.py install --yes USE_AVX_INSTRUCTIONS or python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA
- Now you can use
import dlib
without any problem into your python script.- You can also check the current version of
dlib
withpip show dlib
.- Now simply install
face_recognition
withpip install face_recognition
.- Enjoy!