New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Installation Tutorial #175
Comments
You don't need to manually install dlib. I was able to install it with pip (through the Which leads me to my second point; your tutorial does not mention CMake at all. I have no idea what CMake actually does, so it may not be required, but if it does have something to do with simplifying the install process, you should add it to your tutorial. |
@TheDogeOfTheInternet yes you are right the |
Thanks @masoudr! I'll link it from the README. |
Done! https://github.com/ageitgey/face_recognition/blob/master/README.md#installation Thanks again! |
hello @masoudr, i want to know CMake install procedure. Thanks. |
@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 |
Dear all, |
@BachDoXuan you need to use the visual studio 2015 compiler(msvc-14.0), 14.1 is bugged. You also need at least 2GB RAM, because face_recognition.cpp takes a lot of memory during compilation(which could be the reason it takes so long). |
I use VS CE 2017, 8GB RAM laptop. I use Windows 10 Pro but the windows is not activated. I have no idea what problem I have. Can you help me to install dlib? |
@BachDoXuan I used MSVC-14 and haven't tested the 2017 version. Are you using the precompiled version of Boost or compiling it by yourself? |
@masoudr @neutrinobomber Thank you very much for your helps. The screen doesn't have any error log. It just got stuck when building dlib at face_recognition.cpp, I waited for more than hour every time I got there. But currently when I use command "pip install face_recognition" directly, then it succeeds. |
@BachDoXuan You are right, you can always use pip to install this package without any further work on windows. This tutorial is for the people who wanted to build |
This is a known problem. Visual Studio 2017 is buggy and has worse support
for C++11 than Visual Studio 2015. No one has been able to find a
workaround other than to use Visual Studio 2015.
|
Hey! I have a problem while following this tutorial. jpeg.lib(jdatadst.c.obj) : error LNK2019: unresolved external symbol _imp_ferror referenced in function term_destination [C:\Users\Loqpa\Downloads\dlib-master\dlib-master\tools\python\build\dlib.vcxproj] Any ideas how to fix it? I am up to trying everything you suggest:) |
@loqpa Hi, |
@masoudr Hello! |
@loqpa I used this method for the specified version of dependencies, so I am not sure if they work for other versions too. |
Does anyone have the link to download, Microsoft Visual Studio 2015 with C / C ++ Compiler |
@Klinsman21 google is your friend :) try this. |
@masoudr what |
@loqpa If you compile |
Can anybody help me ? libboost_python3-vc140-mt-s-1_65_1.lib(errors.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' [D:\DEV\dlib-master\tools\python\build\dlib_.vcxproj] |
@cmlyldz You are trying to compile an |
@masoudr Thanks for answer. The problem was my python but there is no problem thanks to you. |
@hepingtao Please give me more information about the exact version of your tools like python version? |
@hepingtao be careful while downloading scipy, numpy you have to download them x86 like others(if you want to use x86). Also python, boost and also dlib must compile on x86 also. If you did everything in an x86 compiler (or x64) there will be no error. |
I have installed cmak and added to path but while installing dlib getting message to install cmak |
@008karan If your CMake is successfully added, you can use |
don´t worry about that! let me know if it works for you! |
@raburgos this works beautifully! thanks a million! conda update ipykernel repeat the above update till no error (took few runs for me), then run: conda create -n face_recognition python==3.6.6 anaconda then clone the repo with git clone https://github.com/ageitgey/face_recognition.git (that should output detected faces of pictures in that folder. |
That’s great! |
Thank you for your instruction! I have installed it successfully. Thank you. |
Hi @Yipeng-Wang-Peter ! If you want to use your webcam you can try in command line (e.g: anaconda prompt, considering current path in your local file face_recognition): I hope this helps! |
OK. Thank you! |
Running setup.py install for dlib ... error |
... and it stops at the most interesting part where the root cause of the error is located. Python 3.8 - not sure if everything will work smoothly with the latest & greatest version. Why not try something that works, following the instructions given in the older comments here? |
very amazing , its works for me. very good .many tankx. |
Hi, whenever I am trying to install via pip install dlib or pip install face_recognition, I am getting the following error. |
Hey guys! I am trying this installation on windows 10 with python 3.9. dlib and cmake got installed quite easily but while running pip3 install face_recognition, i got the following error for face_detection. As much as i can understand, it is trying to install it using the exe file which is nowhere in the system. Secondly, when i try to execute face_recognition in the cmd, it says "'face_recognition' is not recognized as an internal or external command, operable program or batch file." Can anyone help me with it? @masoudr, could you please let me know what am i missing here? |
I think u can try to edit the concrete codes in an IDE such as pycharm, and if u test in IDE, u don't need to install with _.exe file.
…------------------ 原始邮件 ------------------
发件人: "ageitgey/face_recognition" ***@***.***>;
发送时间: 2021年6月4日(星期五) 晚上11:17
***@***.***>;
***@***.******@***.***>;
主题: Re: [ageitgey/face_recognition] Windows Installation Tutorial (#175)
Hey guys! I am trying this installation on windows 10 with python 3.9. dlib and cmake got installed quite easily but while running pip3 install face_recognition, i got the following error for face_detection. As much as i can understand, it is trying to install it using the exe file which is nowhere in the system. Secondly, when i try to execute face_recognition in the cmd, it says "'face_recognition' is not recognized as an internal or external command, operable program or batch file." Can anyone help me with it?
@masoudr, could you please let me know what am i missing here?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
hi, it seems like visual studio 2022 doesn't work! uninstalling that and installing visual studio 2019 worked |
I haven't test the VS 2022 yet but as I know it add the C++20 support, so maybe downgrading the compiler may fix compilation issues. |
|
As the error indicates, you need to install CMake and add it to your system PATH. |
|
If you want to install the dlib library, you need to install c++ |
For anyone facing errors trying to install directly on windows, there is the option of using a WSL(Windows Subsystem for Linux), wich is a native VM implementation for windows. You can install normally the API like you would in a Linux machine, then you can acess it directly through Windows using VScode with the extension "Remote -WSL"(instuctions on how to do that are on the extension description itself). Here is an example on it working perfeclty using Flask like if i am running it locally on windows. |
environment: windows python3.8.8 |
Running setup.py install for dlib did not run successfully.
note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while trying to install package. note: This is an issue with the package mentioned above, not pip. |
Hello good people! I was wondering if the encoding becomes properly trained if there is only 1 picture of each person or does there need to be at least more than 1 or something. Thats because when i have single image of different people the encoding after training , the recognition part gives a wrong detection. But whenever i have about 3 or more images of the same person being trained on the encodings, the recognition script gives the correct detection. Any input would be hugely appreciated |
Hello good people! I was wondering if the encoding becomes properly trained if there is only 1 picture of each person or does there need to be at least more than 1 or something. Thats because when i have single image of different people the encoding after training , the recognition part gives a wrong detection. But whenever i have about 3 or more images of the same person being trained on the encodings, the recognition script gives the correct detection. Any input would be hugely appreciated |
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 to try to use this tool on a Windows machine.
IMPORTANT: Actually, this project has been done for Linux systems, especially
dlib
. In my tests, the performance of this tool in Windows 10 was about a quarter compared to Ubuntu, built with the same specs. But I haven't seen any difference between these two in other subjects.Read First:
The new version of
dlib
doesn't needBoost
anymore, so you can skip it. Remember that you still need to meet the following requirements.Requirments:
(I've used this tutorial with these tools installed on Windows 10, but the newer versions may work too.)
dlib
)Python3
(I usedPython3.5 x64
but the other versions may work too)CMake
for windows and add it to your system environment variables.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)Installation:
Easy installation:
Just install
dlib
andface_recognition
(not always on the newest version):pip install dlib
and thenpip install face_recognition
.Manual installation:
scipy
andnumpy+mkl
(must be mkl version) packages from this link (all credits goes to Christoph Gohlke). Remember to grab the correct version based on your current Python version.Boost
library source code or binary release for your current MSVC from this link.Boost
by yourself:3-1. Extract the
Boost
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 of
Boost
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 compile
Boost
, it should create compiled files instage
directory.Boost
skip this step) If you already download the binary release, extract the contents toC:\local\boost_1_XX_X
dlib
from this repo and extract it.dlib
directory and open cmd and follow these commands to builddlib
: (remember to replace XX with the 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
orpython setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA
import dlib
without any problem in your python script.dlib
withpip show dlib
.face_recognition
withpip install face_recognition
.Finally, I need to say thanks to @ageitgey and @davisking for their awesome work.
The text was updated successfully, but these errors were encountered: