Skip to content
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

Closed
masoudr opened this issue Sep 14, 2017 · 255 comments
Closed

Windows Installation Tutorial #175

masoudr opened this issue Sep 14, 2017 · 255 comments

Comments

@masoudr
Copy link

masoudr commented Sep 14, 2017

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 need Boost 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.)

  1. Microsoft Visual Studio 2015 (or newer) with C/C++ Compiler installed. (Visual C++ 2015 Build Tools didn't work for me, and I got into problems in compiling dlib)
  2. Of course Python3 (I used Python3.5 x64 but the other versions may work too)
  3. CMake for windows and add it to your system environment variables.
  4. (ONLY FOR older versions of 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 of Boost in this tutorial)

Installation:
Easy installation:
Just install dlib and face_recognition (not always on the newest version):
pip install dlib and then pip install face_recognition.

Manual installation:

  1. Download and install scipy and numpy+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.
  2. Download Boost library source code or binary release for your current MSVC from this link.
  3. If you downloaded the binary version skip to step 4 else, follow these steps to compile and build Boost by yourself:
    3-1. Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boost 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 compile Boost:
    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 in stage directory.
  4. (If you have already compiled Boost skip this step) If you already download the binary release, extract the contents to C:\local\boost_1_XX_X
  5. Grab the latest version of dlib from this repo and extract it.
  6. Go to dlib directory and open cmd and follow these commands to build dlib: (remember to replace XX with the current version of Boost 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
  7. Now, you can use import dlib without any problem in your python script.
  8. You can also check the current version of dlib with pip show dlib.
  9. Now, install face_recognition with pip install face_recognition.
  10. Enjoy!

Finally, I need to say thanks to @ageitgey and @davisking for their awesome work.

@TheDogeOfTheInternet
Copy link

You don't need to manually install dlib. I was able to install it with pip (through the pip install face_recognition command) after I had Boost and CMake installed.

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.

@masoudr
Copy link
Author

masoudr commented Sep 14, 2017

@TheDogeOfTheInternet yes you are right the CMake is a must and I forgot to add it but it is just used to compile dlib and Boost. I've edited my post and add it thanks.
And for your first question yes you can use pip to install it but the latest versions are always on his Github repository and website so you need to compile it by yourself. Also, you can configure your compilation.

@ageitgey
Copy link
Owner

Thanks @masoudr! I'll link it from the README.

@ageitgey
Copy link
Owner

Done! https://github.com/ageitgey/face_recognition/blob/master/README.md#installation

Thanks again!

@PBShortStop
Copy link

hello @masoudr, i want to know CMake install procedure. Thanks.

@masoudr
Copy link
Author

masoudr commented Sep 19, 2017

@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.

@BachDoXuan
Copy link

Dear all,
I've tried several times to build dlib, but waited more than 1 hour at face_recognition.cpp without seeing any progress. I redo it several times but still get stuck there. Can you help me with it?

@runt1m33rr0r
Copy link

@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).

@BachDoXuan
Copy link

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?

@masoudr
Copy link
Author

masoudr commented Sep 29, 2017

@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?
Remember that some of the steps in this tutorial are for MSVC-14 and if you want to use with other versions you need to modify them.
Could you provide the error log?

@BachDoXuan
Copy link

@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.

@masoudr
Copy link
Author

masoudr commented Sep 29, 2017

@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 dlib from source or do some configurations to it.

@davisking
Copy link

davisking commented Sep 29, 2017 via email

@loqpa
Copy link

loqpa commented Oct 4, 2017

Hey! I have a problem while following this tutorial.
My versions are:
Python 3.5.4
dlib 19.7
boost 1.65.1
(using "with cuda" and "with avx" options)

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]
jpeg.lib(jmemmgr.c.obj) : error LNK2019: unresolved external symbol __imp___stdio_common_vsscanf referenced in function vsscanf_l [C:\Users\Loqpa\Downloads\dlib-master\dlib-master\tools\python\build\dlib.vcxproj]
jpeg.lib(jmemansi.c.obj) : error LNK2019: unresolved external symbol imp_tmpfile referenced in function jpeg_open_backing_store [C:\Users\Loqpa\Downloads\dlib-master\dlib-master\tools\python\build\dlib.vcxproj]
C:\Users\Loqpa\Downloads\dlib-master\dlib-master\tools\python\build\Release\dlib.pyd : fatal error LNK1120: 3 unresolved externals [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:)

@masoudr
Copy link
Author

masoudr commented Oct 4, 2017

@loqpa Hi,
Are you using a precompiled version of boost with MSVC14?
Try to add these system environment variables too:
VS110COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VS120COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
VS110COMNTOOLS C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\
VSSDK140Install C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\
I don't know the exact cause of your problem but it seems that some of the library files are not recognized by dlib.

@loqpa
Copy link

loqpa commented Oct 6, 2017

@masoudr Hello!
I am compiling boost by myself (following steps 3-1... 3-4) and my system environment variables were already set the way you suggested.
Tried with boost 1.63, got the same error.
Any other ideas?
By the way, i am using Anaconda python, in case it matters.

@masoudr
Copy link
Author

masoudr commented Oct 6, 2017

@loqpa I used this method for the specified version of dependencies, so I am not sure if they work for other versions too.
As I know your problem is causing by missing some dll files on dlib's compile. I think you can try first submit your issue on dlib repository here, maybe @davisking have an answer to it and second use the exact procedure I mentioned here. I don't' know much about Anaconda try to exclude it.

@Klinsman21
Copy link

Does anyone have the link to download, Microsoft Visual Studio 2015 with C / C ++ Compiler

@masoudr
Copy link
Author

masoudr commented Oct 7, 2017

@Klinsman21 google is your friend :) try this.

@loqpa
Copy link

loqpa commented Oct 7, 2017

@masoudr what dlib version did you use? I can use precompiled version 19.4 without any problems but i am really curious about new(19.5+) cnn face_detector :)

@masoudr
Copy link
Author

masoudr commented Oct 8, 2017

@loqpa If you compile dlib from the source you can always use the latest features and besides of that you can customize the compilation for specific configuration like disable/enable AVX instruction, CUDA feature, etc. I used v19.6 but newer versions would work too. You can find new features on dlib's website in here.

@cmlyldz
Copy link

cmlyldz commented Oct 11, 2017

Can anybody help me ?
VC 2015
boost 1_65_1
dlib 19.7

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]
1 Warning(s)
1 Error(s)
Time Elapsed 00:04:35.66
error: cmake build failed!

@masoudr
Copy link
Author

masoudr commented Oct 11, 2017

@cmlyldz You are trying to compile an X86 code on X64 compiler or vice-versa. Try to use VS2015 x86 Native Tools Command Prompt to compile dlib and remember that your python architecture must be same.

@cmlyldz
Copy link

cmlyldz commented Oct 12, 2017

@masoudr Thanks for answer. The problem was my python but there is no problem thanks to you.

@hepingtao
Copy link

@masoudr I have also encountered exactly the same problem as @cmlyldz . And I used VS2015 x86 Native Tools Command Prompt to compile dlib, but the problem didn't go.

@masoudr
Copy link
Author

masoudr commented Oct 13, 2017

@hepingtao Please give me more information about the exact version of your tools like python version?

@cmlyldz
Copy link

cmlyldz commented Oct 13, 2017

@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.

@008karan
Copy link

I have installed cmak and added to path but while installing dlib getting message to install cmak

@masoudr
Copy link
Author

masoudr commented Oct 15, 2017

@008karan If your CMake is successfully added, you can use cmake --version in cmd to verify that. I'm not sure if the problem will exist but put your complete error log here.

@raburgos
Copy link

oh wee thats embarrassing, yet to fully wake up.. update in progress, will try the steps again after all updated

don´t worry about that! let me know if it works for you!

@akeilox
Copy link

akeilox commented May 30, 2020

@raburgos this works beautifully! thanks a million!
was on conda 4.8.3, open Anaconda Prompt

conda update ipykernel
conda update --all

repeat the above update till no error (took few runs for me), then run:

conda create -n face_recognition python==3.6.6 anaconda
conda activate face_recognition
pip install cmake
pip install dlib==19.8.1
pip install face_recognition
pip install opencv-contrib-python==4.1.0.25
pip install twisted

then clone the repo with git clone https://github.com/ageitgey/face_recognition.git
cd examples
face_detection ./

(that should output detected faces of pictures in that folder.

@raburgos
Copy link

@raburgos this works beautifully! thanks a million!
was on conda 4.8.3, open Anaconda Prompt

conda update ipykernel
conda update --all

repeat the above update till no error (took few runs for me), then run:

conda create -n face_recognition python==3.6.6 anaconda
conda activate face_recognition
pip install cmake
pip install dlib==19.8.1
pip install face_recognition
pip install opencv-contrib-python==4.1.0.25
pip install twisted

then clone the repo with git clone https://github.com/ageitgey/face_recognition.git
cd examples
face_detection ./

(that should output detected faces of pictures in that folder.

That’s great!

@Yipeng-Wang-Peter
Copy link

Thank you for your instruction! I have installed it successfully.
Does anyone know how to execute the facial recognition's command line on window 10?

Thank you.

@raburgos
Copy link

Thank you for your instruction! I have installed it successfully.
Does anyone know how to execute the facial recognition's command line on window 10?

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):
.- cd examples
.- python facerec_from_webcam_faster.py

I hope this helps!

@Yipeng-Wang-Peter
Copy link

Thank you for your instruction! I have installed it successfully.
Does anyone know how to execute the facial recognition's command line on window 10?
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):
.- cd examples
.- python facerec_from_webcam_faster.py

I hope this helps!

OK. Thank you!

@AlpeshValvi123
Copy link

Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'd:\pythonpractice\pictures\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib\setup.py'"'"'; file='"'"'C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\avalvi\AppData\Local\Temp\pip-record-zs9fffxc\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\pythonpractice\pictures\include\site\python3.8\dlib'
cwd: C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib
Complete output (74 lines):
running install
running build
running build_py
package init file 'dlib_init_.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:30:28) [MSC v.1926 32 bit (Intel)]
Invoking CMake setup: 'cmake C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=d:\pythonpractice\pictures\scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\avalvi\AppData\Local\Temp\pip-install-2u4dltn8\dlib\build\lib.win32-3.8'
-- Building for: Visual Studio 10 2010
CMake Error at CMakeLists.txt:3 (project):

@progmars
Copy link

(project):

... 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?

@niuyaqun
Copy link

图片
Could you help me figure out what is the problem?
Thanks!

@niuyaqun
Copy link

图片
I tried "pip install dlib" in Anaconda prompt with python 3.7.3
But some errors occurred. Could you help me sovle this problem?
Thanks!

@raburgos
Copy link

Did you try the same steps I mentioned? (Installing cmake before and then install the specific version of dlib)

Regards!> 图片

I tried "pip install dlib" in Anaconda prompt with python 3.7.3

But some errors occurred. Could you help me sovle this problem?

Thanks!

@niuyaqun
Copy link

Did you try the same steps I mentioned? (Installing cmake before and then install the specific version of dlib)

Regards!> 图片

I tried "pip install dlib" in Anaconda prompt with python 3.7.3
But some errors occurred. Could you help me sovle this problem?
Thanks!

I followed the tutorial you sent:
conda update ipykernel
conda update --all
conda create -n face_recognition python==3.6.6 anaconda
conda activate face_recognition
pip install cmake
But it occurred some errors when i was installing cmake
Could you help me figure out what is the problem? Thanks!
图片

@zeintiz
Copy link

zeintiz commented Apr 21, 2021

Hi, here is something that works for me:

1.- conda create -n face_recognition python==3.6.6 anaconda

2.- conda activate face_recognition

3.- pip install cmake

4.- pip install dlib==19.8.1

5.- pip install face_recognition

6.- pip install opencv-contrib-python==4.1.0.25

7.- pip install twisted

very amazing , its works for me. very good .many tankx.

@raaghav2801
Copy link

Hi, whenever I am trying to install via pip install dlib or pip install face_recognition, I am getting the following error.
image
However, I installed dlib manually through the github repository and on importing I am not getting any error. But on installing or importing face_recognition, I am getting the following error
image
@masoudr Can you please help me out

@rjkrsngh
Copy link

rjkrsngh commented Jun 4, 2021

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?

capture

@uestchang
Copy link

uestchang commented Jun 5, 2021 via email

@joachimwan
Copy link

hi, it seems like visual studio 2022 doesn't work! uninstalling that and installing visual studio 2019 worked

@masoudr
Copy link
Author

masoudr commented Jun 20, 2021

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.

@shivamcreator
Copy link

You don't need to manually install dlib. I was able to install it with pip (through the pip install face_recognition command) after I had Boost and CMake installed.

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.

hi!
I am not able to install dlib from pip command.
image

@masoudr
Copy link
Author

masoudr commented Aug 19, 2021

You don't need to manually install dlib. I was able to install it with pip (through the pip install face_recognition command) after I had Boost and CMake installed.
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.

hi!
I am not able to install dlib from pip command.
image

As the error indicates, you need to install CMake and add it to your system PATH.

@alisharf
Copy link

تشغيل تثبيت setup.py لـ dlib ... خطأ
خطأ: خطأ في الأمر مع حالة الخروج 1:
الأمر: 'd: \ pythonpractice \ pictures \ scripts \ python.exe' -u -c 'import sys، setuptools، tokenize؛ sys.argv [0] = "" "" C: \ Users \ avalvi \ AppData \ Local \ Temp \ pip-install-2u4dltn8 \ dlib \ setup.py '"" "'؛ file = "" "" C: \ Users \ avalvi \ AppData \ Local \ Temp \ pip-install-2u4dltn8 \ dlib \ setup.py '"" ""؛ f = getattr (رمز مميز ، "" "" فتح " "" "، فتح) ( ملف ) ؛ كود = f.read (). استبدل ('" ""' \ r \ n '"" "'، '" ""' \ n '"" "')؛ f.close ()؛ exec (ترجمة (رمز ، ملف ، "" "" "
cwd: C: \ Users \ avalvi \ AppData \ Local \ Temp \ pip-install-2u4dltn8 \ dlib
الإخراج الكامل (74 سطرًا):
تشغيل التثبيت
قيد
التشغيل الذي يعمل على تشغيل build_py
package init ملف 'dlib_ init _.py' غير موجود (أو لا ملف عادي)
تشغيل build_ext
Building extension for Python 3.8.4 (tags / v3.8.4: dfa645a ، 13 يوليو 2020 ، 16:30:28) [MSC v.1926 32 bit (Intel)]
استدعاء إعداد CMake: 'cmake C: \ Users \ avalvi \ AppData \ Local \ Temp \ pip-install-2u4dltn8 \ dlib \ tools \ python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY = C: \ Users \ avalvi \ AppData \ Local \ Temp \ pip-install- 2u4dltn8 \ dlib \ build \ lib.win32-3.8 -DPYTHON_EXECUTABLE = d: \ pythonpractice \ pictures \ scripts \ python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE = C: \ Users \ avalvi \ AppData-install \ TEM8 \ d pipl build \ lib.win32-3.8 '

  • إنشاء لـ: Visual Studio 10 2010
    CMake Error في CMakeLists.txt: 3 (مشروع):

@alisharf
Copy link

If you want to install the dlib library, you need to install c++

@MarcioJrios
Copy link

MarcioJrios commented Oct 8, 2021

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).

wsl-example

Here is an example on it working perfeclty using Flask like if i am running it locally on windows.
Hope it helps anyone with problems related to Windows usage!

@gengyanlei
Copy link

gengyanlei commented Nov 19, 2021

environment: windows python3.8.8
you just need pip install dlib-19.19.0-cp38-cp38-win_amd64.whl,and pip install face_recognition
dlib whl提取码: 1sk6

@utkarshrocks
Copy link

You don't need to manually install dlib. I was able to install it with pip (through the pip install face_recognition command) after I had Boost and CMake installed.

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.

Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [58 lines of output]
running install
running build
running build_py
package init file 'tools\python\dlib_init_.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\Dell\AppData\Local\Programs\Python\Python310\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\build\lib.win-amd64-3.10 -A x64'
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19043.
-- The C compiler identification is unknown
-- The CXX compiler identification is MSVC 19.31.31104.0
CMake Error at CMakeLists.txt:14 (project):
No CMAKE_C_COMPILER could be found.

  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Dell/AppData/Local/Temp/pip-install-ib3cgbg6/dlib_415ab045cd144cdabeed0215a5d6f304/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/Dell/AppData/Local/Temp/pip-install-ib3cgbg6/dlib_415ab045cd144cdabeed0215a5d6f304/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeError.log".
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\setup.py", line 222, in <module>
      setup(
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py", line 61, in run
      return orig.install.run(self)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\command\install.py", line 568, in run
      self.run_command('build')
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
    File "C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\setup.py", line 134, in run
      self.build_extension(ext)
    File "C:\Users\Dell\AppData\Local\Temp\pip-install-ib3cgbg6\dlib_415ab045cd144cdabeed0215a5d6f304\setup.py", line 171, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "C:\Users\Dell\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-ib3cgbg6\\dlib_415ab045cd144cdabeed0215a5d6f304\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-ib3cgbg6\\dlib_415ab045cd144cdabeed0215a5d6f304\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\Dell\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-ib3cgbg6\\dlib_415ab045cd144cdabeed0215a5d6f304\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

@galib937
Copy link

galib937 commented Nov 7, 2022

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

@galib937
Copy link

galib937 commented Nov 7, 2022

@loqpa I believe that was a known problem/bug with the dlib conda package on Windows specifically and not dlib itself

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests