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

[documentation] Instruction for Windows users. #9

Closed
topin89 opened this issue Jun 18, 2020 · 5 comments
Closed

[documentation] Instruction for Windows users. #9

topin89 opened this issue Jun 18, 2020 · 5 comments

Comments

@topin89
Copy link

topin89 commented Jun 18, 2020

It turns out, as long as you have GTX 970 or higher, prerequisites installation is quite simple

  1. Fresh nVidia drivers.
  2. Python
  3. Visual Studio with c++ workload and cmake, needed for dlib. Possibly, only buildtools are needed, I didn't check that. There may be precompiled dlib, I also didn't check.
  4. Precompiled pytorch and pytorchvision
  5. Pillow, numpy, scipy and dlib.

Looks like there is no need to install CUDA SDK to use precompiled pytorch on Windows.

So, from clean slate:

  1. Install chocolatey, used to install Cmake, Visual Studio and Python

from admin cmd

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

or from admin PowerShell

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  1. Reopen admin cmd/Powershell and run
cinst -y visualstudio2019community visualstudio2017-workload-nativedesktop

to install Visual Studio with C++ compiler. Then reboot and, again, from admin cmd/Powershell

cinst -y python
cinst -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
  1. Finally, install all python libraries. I used pytorch 1.5.0, and it supports only GTX 970 and newer. Maybe older versions supports your hardware.

from non-admin cmd/PowerShell

pip install numpy
pip install scipy
pip install https://download.pytorch.org/whl/cu102/torch-1.5.0-cp38-cp38-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.0-cp38-cp38-win_amd64.whl
pip install pillow
pip install dlib

Everything's ready for use, from Data section of the Readme.

Warning, though, for some reason dlib module align_face.py didn't work well with pngs and bmps. So jpg realpics it is.

@adamian98 adamian98 pinned this issue Jun 18, 2020
@adamian98
Copy link
Owner

Thanks!

It should work with pngs as long as they are 3 channel and not 4 channel. If they contain an alpha channel then it will not work. Most image editing tools should be able to strip the alpha channel from a png so that you can use it with PULSE.

@luiscosio
Copy link

For dlib, you can just use one from conda-forge to avoid using compiling and installing VIsual Studio:

conda install -c conda-forge dlib

@BadCoder2
Copy link

When installing dlib from pip it gives a massive error with the only readable part being "NMake Makefiles does not support platform specification, but platform x64 was specified." I tried to find the log file but the file directory it gave didn't exist.

@eabase
Copy link

eabase commented Mar 22, 2021

This should be put in the README

@hurui5423
Copy link

It turns out, as long as you have GTX 970 or higher, prerequisites installation is quite simple

  1. Fresh nVidia drivers.
  2. Python
  3. Visual Studio with c++ workload and cmake, needed for dlib. Possibly, only buildtools are needed, I didn't check that. There may be precompiled dlib, I also didn't check.
  4. Precompiled pytorch and pytorchvision
  5. Pillow, numpy, scipy and dlib.

Looks like there is no need to install CUDA SDK to use precompiled pytorch on Windows.

So, from clean slate:

  1. Install chocolatey, used to install Cmake, Visual Studio and Python

from admin cmd

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

or from admin PowerShell

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  1. Reopen admin cmd/Powershell and run
cinst -y visualstudio2019community visualstudio2017-workload-nativedesktop

to install Visual Studio with C++ compiler. Then reboot and, again, from admin cmd/Powershell

cinst -y python
cinst -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
  1. Finally, install all python libraries. I used pytorch 1.5.0, and it supports only GTX 970 and newer. Maybe older versions supports your hardware.

from non-admin cmd/PowerShell

pip install numpy
pip install scipy
pip install https://download.pytorch.org/whl/cu102/torch-1.5.0-cp38-cp38-win_amd64.whl
pip install https://download.pytorch.org/whl/cu102/torchvision-0.6.0-cp38-cp38-win_amd64.whl
pip install pillow
pip install dlib

Everything's ready for use, from Data section of the Readme.

Warning, though, for some reason dlib module align_face.py didn't work well with pngs and bmps. So jpg realpics it is.

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

6 participants