Info-icon.png We have moved to https://openmodeldb.info/. This new site has a tag and search system, which will make finding the right models for you much easier! If you have any questions, ask here: https://discord.gg/cpAUpDK

Difference between revisions of "BasicSR Installation Guide for Windows"

From Upscale Wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
We will install some tools first to make installing the dependencies, BasicSR and ESRGAN itself easier.
 
 
 
=Disclaimer=
 
=Disclaimer=
  
 
This Guide is currently in Alpha, use it at your own risk!
 
This Guide is currently in Alpha, use it at your own risk!
 
   
 
   
Before you start with this guide, make sure that you have 'nothing from NVIDIA installed'.
+
Before you start with this guide, make sure that you have the '''most up to date driver from Nvidia installed if you have a Nvidia card installed'''.
  
Before you start with this guide, make sure that you have 'no Python, Anaconda, Miniconda, (other Python distribution) installed'.
+
Before you start with this guide, make sure that you have '''no Python, Anaconda, Miniconda, (other Python distribution) installed'''.
  
If you have something from Nvidia installed or an existing Python installation, uninstall them first in the Windows Control pannel. To check that there really is no Python installation left, open a CMD window and type <code>python</code> if nothing happens you are good to go.
+
If you have something from ''Nvidia installed or an existing Python installation, uninstall them first'' in the Windows Control pannel. To check that there really is no Python installation left, open a CMD window and type <code>python</code> if nothing happens you are good to go.
  
=Chocolatey=
+
=WinGet=
  
Chocolatey is a package manager for Windows, you can also install all of the programs we will install with it in the future manually, if you want to do so, skip those steps.
+
WinGet is a package manager for Windows, it allows you to automate the installation of a ton of programs and more.
  
#Open a PowerShell window as an admin. (On Windows 10 rightclick the start symbol (four squares) then select Windows PowerShell (Admin))
+
Let's check if you have it ready to go:
  
==Chocolatey==
+
Open a '''PowerShell''' window as an '''admin'''. (On Windows 10 rightclick the start symbol (four squares) then select Windows PowerShell (Admin)) Enter:
#Enter: <code>Get-ExecutionPolicy</code>
 
#*If it returns <code></code> Enter: <code>Set-ExecutionPolicy AllSigned</code>
 
#Enter: <code>Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))</code>
 
#Close PowerShell (!This is important!)
 
#Reopen PowerShell as an admin.
 
  
==Nvidia Driver==
+
<nowiki>
 +
winget --version
 +
</nowiki>
  
#Enter: <code>choco install nvidia-display-driver</code>
+
If it returns something like:
  
==CUDA==
+
<nowiki>
 
+
v0.2.3162 Preview
#Enter: <code>choco install cuda</code>
+
</nowiki>
  
 +
Then WinGet was installed correctly and you can proceed, if that isn't, you can also install it yourself on Windows 10. You need to opt-into it or install it yourself,
 +
you can find instructions here: https://docs.microsoft.com/en-us/windows/package-manager/winget/
 
==Python==
 
==Python==
  
#Enter: <code>choco install python3 --params "/InstallDir:C:\Python3"</code>
+
<nowiki>
 
+
winget install Python.Python --version 3.9.7 --silent
::If you want to install Python in another location you can just modify the path to whatever you want.
+
</nowiki>
  
 
==Git (Bash)==
 
==Git (Bash)==
  
#Enter: <code>choco install git --params "/GitAndUnixToolsOnPath /NoGuiHereIntegration"</code>
+
  <nowiki>
 
+
winget install Git.Git --silent
::<code>/GitAndUnixToolsOnPath</code> will add many Unix tools to your path, optional
+
</nowiki>
 
 
::<code>/NoGuiHereIntegration</code> Personally I don't like the GUI that comes with Git, I recommend to use any other instead this switch will remove the Git GUI entry from the windows explorer context menu.
 
 
 
==ImageMagick==
 
 
 
#Enter: <code>choco install imagemagick</code>
 
  
 
=Python Dependencies=
 
=Python Dependencies=
Line 57: Line 48:
  
 
*If you have a '''Nvidia''' graphic card enter the following command in the cmd and press enter:  
 
*If you have a '''Nvidia''' graphic card enter the following command in the cmd and press enter:  
*#<code>pip install torch==1.2.0 torchvision==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html</code>
+
*#<code>pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio===0.9.1 -f https://download.pytorch.org/whl/torch_stable.html</code>
 
*If you have an '''AMD / Intel''' graphic card enter the following command in the cmd and press enter:
 
*If you have an '''AMD / Intel''' graphic card enter the following command in the cmd and press enter:
*#<code>pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html</code>  
+
*#<code>pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/torch_stable.html</code>  
 
*If the command for your system won’t work for you, please report it. In the meantime, you can get an up to date version here on the [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
 
*If the command for your system won’t work for you, please report it. In the meantime, you can get an up to date version here on the [https://pytorch.org/get-started/locally/ Pytorch Website]. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.
  
Line 78: Line 69:
 
==ESRGAN==
 
==ESRGAN==
  
#Enter:<code>git clone https://github.com/BlueAmulet/ESRGAN.git</code>
+
#Enter:<code>git clone https://github.com/JoeyBallentine/ESRGAN.git /c/scr/git/ESRGAN</code>
  
 
==BasicSR==
 
==BasicSR==
  
#Enter:<code>git clone https://github.com/victorca25/BasicSR.git</code>
+
#Enter:<code>git clone https://github.com/victorca25/traiNNer.git /c/src/git/BasicSR</code>
 
 
==Neural Testing Scripts==
 
 
 
#Enter:<code>https://github.com/gameupscale/neural-testing-scripts.git</code>
 
 
 
==Neural Training Scripts==
 
 
 
#Enter:<code>https://github.com/gameupscale/neural-training-scripts</code>
 

Latest revision as of 17:46, 8 October 2021

Disclaimer

This Guide is currently in Alpha, use it at your own risk!

Before you start with this guide, make sure that you have the most up to date driver from Nvidia installed if you have a Nvidia card installed.

Before you start with this guide, make sure that you have no Python, Anaconda, Miniconda, (other Python distribution) installed.

If you have something from Nvidia installed or an existing Python installation, uninstall them first in the Windows Control pannel. To check that there really is no Python installation left, open a CMD window and type python if nothing happens you are good to go.

WinGet

WinGet is a package manager for Windows, it allows you to automate the installation of a ton of programs and more.

Let's check if you have it ready to go:

Open a PowerShell window as an admin. (On Windows 10 rightclick the start symbol (four squares) then select Windows PowerShell (Admin)) Enter:

winget --version

If it returns something like:

v0.2.3162 Preview

Then WinGet was installed correctly and you can proceed, if that isn't, you can also install it yourself on Windows 10. You need to opt-into it or install it yourself, you can find instructions here: https://docs.microsoft.com/en-us/windows/package-manager/winget/

Python

winget install Python.Python --version 3.9.7 --silent

Git (Bash)

winget install Git.Git --silent

Python Dependencies

  1. Open a shell of your choice as an admin. (PowerShell, CMD or Git Bash)

Pytorch

  • If you have a Nvidia graphic card enter the following command in the cmd and press enter:
    1. pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio===0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
  • If you have an AMD / Intel graphic card enter the following command in the cmd and press enter:
    1. pip install torch torchvision torchaudio -f https://download.pytorch.org/whl/torch_stable.html
  • If the command for your system won’t work for you, please report it. In the meantime, you can get an up to date version here on the Pytorch Website. Select Stable, Windows, Pip, your Python version and your CUDA version (should be the newest) or None for AMD / Intel users.

OpenCV-Python

  1. Enter: pip install opencv-python

The Neural Networks

In my example we will install ESRGAN and BasicSR in a project folder called nn (neural network) in the drive root of C. You can change the path if you want to, but keep it as short as you can, since windows has a limitation on how long paths can be.

We will also work with Bash here, you can do this in other shells too, but this guide will use Git Bash, that we installed above.

  1. Open a Git Bash window.
  2. Enter:mkdir -p /c/nn/
  3. Enter:cd /c/nn/

ESRGAN

  1. Enter:git clone https://github.com/JoeyBallentine/ESRGAN.git /c/scr/git/ESRGAN

BasicSR

  1. Enter:git clone https://github.com/victorca25/traiNNer.git /c/src/git/BasicSR