Difference between revisions of "ESRGAN Installation Guide for Windows"

From Upscale Wiki
Jump to navigation Jump to search
Line 13: Line 13:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
 
<li>Get the latest stable 64-bit Python 3 release here: [https://www.python.org/downloads/windows/ Python Download] [[File:GuideEsrganWin_1-python-link.jpg|center|1-python-link]]</li>
 
<li>Get the latest stable 64-bit Python 3 release here: [https://www.python.org/downloads/windows/ Python Download] [[File:GuideEsrganWin_1-python-link.jpg|center|1-python-link]]</li>
<li>Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation. [[File:https://github.com/alsa64/AI-wiki/raw/master/res/2-installer-1.jpg|1-python-link]]</li>
+
<li>Run the installer and make sure that <code>Add Python 3.*x* to Path</code> and <code>Install launcher for all users (recommended)</code> is selected, then click on Customize installation. [[File:GuideEsrganWin_2-installer-1.jpg|1-python-link]]</li>
<li>Make sure that every Option is selected and click on next. [[File:https://github.com/alsa64/AI-wiki/raw/master/res/3-installer-2.jpg|1-python-link]]</li>
+
<li>Make sure that every Option is selected and click on next. [[File:GuideEsrganWin_3-installer-2.jpg|1-python-link]]</li>
<li>Mirror my selections and click on install (Make sure that the install location contains no spaces). [[File:https://github.com/alsa64/AI-wiki/raw/master/res/4-installer-3.jpg|1-python-link]]</li>
+
<li>Mirror my selections and click on install (Make sure that the install location contains no spaces). [[File:GuideEsrganWin_4-installer-3.jpg|1-python-link]]</li>
 
<li>You have now successfully installed Python 3. Click on Close now.</li>
 
<li>You have now successfully installed Python 3. Click on Close now.</li>
<li>Press <Windows/Super key> + R. Enter <code>cmd</code> and click on <code>OK</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/6-run.jpg|6-run]]</li>
+
<li>Press <Windows/Super key> + R. Enter <code>cmd</code> and click on <code>OK</code> [[File:GuideEsrganWin_6-run.jpg|6-run]]</li>
 
<li>We will now install Pytorch:
 
<li>We will now install Pytorch:
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">
Line 23: Line 23:
  
 
<source lang="bash">pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
 
<source lang="bash">pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
then: <code>bash  pip install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/7-Nvidia.jpg|cmd-NV]]
+
then: <code>bash  pip install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:GuideEsrganWin_7-Nvidia.jpg|cmd-NV]]
 
<ol start="2" style="list-style-type: decimal;">
 
<ol start="2" style="list-style-type: decimal;">
 
<li>If you have an '''AMD / Intel''' graphic card enter the following command in the cmd:</li></ol>
 
<li>If you have an '''AMD / Intel''' graphic card enter the following command in the cmd:</li></ol>
  
 
<source lang="bash">pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
 
<source lang="bash">pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl</source>
then: <code>bash  pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/7-CPU.jpg|cmd-CPU]]
+
then: <code>bash  pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-win_amd64.whl</code> [[File:GuideEsrganWin_7-CPU.jpg|cmd-CPU]]
 
<ol start="3" style="list-style-type: decimal;">
 
<ol start="3" style="list-style-type: decimal;">
 
<li>If the command won’t work for you, please report it and get a new one in the meantime here [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.</li></ol>
 
<li>If the command won’t work for you, please report it and get a new one in the meantime here [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.</li></ol>
Line 36: Line 36:
  
 
<source lang="bash">pip install opencv-python</source>
 
<source lang="bash">pip install opencv-python</source>
[[File:https://github.com/alsa64/AI-wiki/raw/master/res/8-pip.jpg|thumb|none|alt=cmd-others|cmd-others]]
+
[[File:GuideEsrganWin_8-pip.jpg|thumb|none|alt=cmd-others|cmd-others]]
  
 
<ol start="10" style="list-style-type: decimal;">
 
<ol start="10" style="list-style-type: decimal;">
Line 49: Line 49:
 
<li>Go to [https://github.com/xinntao/ESRGAN/tree/aceb85730832001ec1fa3a77bd6856b75e1d0e87 the ESRGAN GitHub Repo (old model structure)]</li>
 
<li>Go to [https://github.com/xinntao/ESRGAN/tree/aceb85730832001ec1fa3a77bd6856b75e1d0e87 the ESRGAN GitHub Repo (old model structure)]</li>
 
<li>Click on <code>Clone or Download</code></li>
 
<li>Click on <code>Clone or Download</code></li>
<li>Click on <code>Download ZIP</code> [[File:https://github.com/alsa64/AI-wiki/raw/master/res/10-github.jpg|cmd-CPU]]</li></ol>
+
<li>Click on <code>Download ZIP</code> [[File:GuideEsrganWin_10-github.jpg|cmd-CPU]]</li></ol>
 
</li>
 
</li>
<li><p>Extract the contents of the folder into your <code>C:\ctp\esrgan</code> folder you created in step 10. It should already be open and look like this: [[File:https://github.com/alsa64/AI-wiki/raw/master/res/11-explorer.jpg|cmd-CPU]]</p></li>
+
<li><p>Extract the contents of the folder into your <code>C:\ctp\esrgan</code> folder you created in step 10. It should already be open and look like this: [[File:GuideEsrganWin_11-explorer.jpg|cmd-CPU]]</p></li>
 
<li><p>Now it is time to download and install the default ESRGAN models:</p>
 
<li><p>Now it is time to download and install the default ESRGAN models:</p>
 
<ol style="list-style-type: decimal;">
 
<ol style="list-style-type: decimal;">

Revision as of 08:38, 12 August 2019

This guide will help you to install ESRGAN on Windows, by showing you step by step with images how to do it.

No knowledge of Python or coding is necessary to follow this guide.

If you have any problems during or after the installation, feel free to ask any questions on our Discord server and we will try to help you out.

Our goal is to open up A.I. upscaling to everyone, not just to those who can pay lots of money or are good at coding.

Before you start, make sure that your driver is up-to-date if you have an Nvidia GPU, to make sure it supports the newest cuda version. If you want to be on the save site, use the cuda driver.

Installing ESRGAN

  1. Get the latest stable 64-bit Python 3 release here: Python Download
    1-python-link
  2. Run the installer and make sure that Add Python 3.*x* to Path and Install launcher for all users (recommended) is selected, then click on Customize installation. 1-python-link
  3. Make sure that every Option is selected and click on next. 1-python-link
  4. Mirror my selections and click on install (Make sure that the install location contains no spaces). 1-python-link
  5. You have now successfully installed Python 3. Click on Close now.
  6. Press <Windows/Super key> + R. Enter cmd and click on OK 6-run
  7. We will now install Pytorch:
    1. If you have a Nvidia graphic card enter the following command in the cmd:

    <source lang="bash">pip install https://download.pytorch.org/whl/cu100/torch-1.1.0-cp37-cp37m-win_amd64.whl</source> then: bash pip install https://download.pytorch.org/whl/cu100/torchvision-0.3.0-cp37-cp37m-win_amd64.whl cmd-NV

    1. If you have an AMD / Intel graphic card enter the following command in the cmd:

    <source lang="bash">pip install https://download.pytorch.org/whl/cpu/torch-1.1.0-cp37-cp37m-win_amd64.whl</source> then: bash pip install https://download.pytorch.org/whl/cpu/torchvision-0.3.0-cp37-cp37m-win_amd64.whl cmd-CPU

    1. If the command won’t work for you, please report it and get a new one in the meantime here Pytorch Website. Select Stable, Windows, Pip, your Python version and your cuda version (should be the newest) or None for AMD / Intel users.
  8. Press Enter.
  9. Now we install the other requirements for running and training ESRGAN and SFTGAN. Enter:

<source lang="bash">pip install opencv-python</source>

cmd-others
cmd-others
  1. Choose a folder where you want to install ESRGAN. Because of the maximum path length limitation in windows, I recommend something as short as possible like: C:\ctp\esrgan\

    1. Create a folder called ctp (That will come in handy if you want to install Deorders scripts later)
    2. In the ctp folder create a folder called esrgan
    3. Open the esrgan folder.
  2. Now it is time to download ESRGAN:

    1. Go to the ESRGAN GitHub Repo (old model structure)
    2. Click on Clone or Download
    3. Click on Download ZIP cmd-CPU
  3. Extract the contents of the folder into your C:\ctp\esrgan folder you created in step 10. It should already be open and look like this: cmd-CPU

  4. Now it is time to download and install the default ESRGAN models:

    1. Go to the ESRGAN Pretrained Models Google Drive
    2. Download the two _old_arch.pth files.
    3. Put the two .pth files that you have just downloaded into your models folder in your esrgan folder
      1. For example in:
      C:\ctp\esrgan\models\
  5. If you have a Nvidia Graphic Card, then you have successfully installed ESRGAN, congratulations!

  6. But If you have an AMD / Intel Graphic Card then open test.py in your ESRGAN folder with a text editor.

    1. Change:

    <source lang="python">device = torch.device('cuda') # if you want to run on CPU, change 'cuda' -> cpu</source>

    into

    <source lang="python">device = torch.device('cpu') # if you want to run on CPU, change 'cuda' -> cpu</source>