dlib installation under windows

To install python face_recognition, pip install face_recognition

需要安装依赖包 dlib (dlib  http://dlib.net/ Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real world problems. )

----------------------------

 To sum up, the final steps to successfully install on Windows:

0. Download:

cmake(https://cmake.org/download/)

dlib (http://dlib.net/files/dlib-19.9.zip)

boost(https://dl.bintray.com/boostorg/release/1.66.0/source/ )

vs2015(https://www.visualstudio.com/zh-hans/downloads/ )

1. Install cmake;

2. Install vs2015, and customize the selection of vc++ and later windows10sdk;

3. Compile boost

Execute bootstrap.bat in turn in the decompression directory and then run the generated b2.exe (bjam.exe)

4.vs compile dlib

Generate vs2015-based configure with cmake

Select the source directory (...\dlib-19.9\dlib) and fill in the build directory (....\dlib.vs\)

After configure, sln, vcxproj will be generated in the generation directory;

vs open dlib.sln

 Generate ALL_BUILD.vcxproj, run INSTALL.vcxproj

5. Install dlib

In the end, the version downloaded from the official website (shown in the above link) was successfully run python setup.py install, not the tar package downloaded from pip.python.org;

 

The pit encountered here:

 

Because of the time-consuming download and installation of vs2015, I tried to compile dlib under win through msys/mingw, cmake generated msys configure, and mingw compiled dlib, all of which can be compiled/installed; boost can also be compiled and passed;

But an error is reported in python setup.py install (as shown in the figure below)


 CMake Error in E:/temp/dlib-19.9/tools/python/CMakeLists.txt:

  Generator
    Unix Makefiles
  does not support platform specification, but platform
    x64
  was specified.
----------------------

Suspected that there is a problem with the cmake version through Unix Makefiles,

This machine has multiple cmakes because of the installation of mysys64, and there is a problem with the priority in the path. The following is the correct position after the final modification, namely

(ocr.py27) E:\test\ocrpy>where cmake

C:\Program Files\CMake\bin\cmake.exe

C:\msys64\usr\bin\cmake.exe

c:\msys64\mingw32\bin\cmake.exe

 

Adjust the priority of cmake, run python setup.py install, there is no error,

It's a bit long, just wait.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326124476&siteId=291194637