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 "Using ESRGAN, Links, And Other Information"
Jump to navigation
Jump to search
(Update by ptrsuder) |
|||
Line 7: | Line 7: | ||
==Things you need to know before you use ESRGAN== | ==Things you need to know before you use ESRGAN== | ||
+ | |||
* ESRGAN supports only RGB images, that means it will remove alpha / transparency channels if present and it won't work with grayscale images. | * ESRGAN supports only RGB images, that means it will remove alpha / transparency channels if present and it won't work with grayscale images. | ||
* ESRGAN is limited by the amount of VRAM you have. | * ESRGAN is limited by the amount of VRAM you have. | ||
'''But''' there are ways around both. At the time of writing this there are some popular tools used by a lot of us to solve this: | '''But''' there are ways around both. At the time of writing this there are some popular tools used by a lot of us to solve this: | ||
− | ===[https://github.com/ptrsuder/IEU.Winforms ptrsuder's IEU (Image Enhancement Utility)]=== | + | == Tools / Ways to use ESRGAN == |
− | + | ||
+ | === GUI Tools === | ||
+ | |||
+ | ==== [https://github.com/ptrsuder/IEU.Winforms ptrsuder's IEU (Image Enhancement Utility)] ==== | ||
+ | |||
* '''Easy''' to use '''GUI''' which makes it easy to use for users who don't love CLI yet | * '''Easy''' to use '''GUI''' which makes it easy to use for users who don't love CLI yet | ||
* Image splitting works completely different compared to Deorder's scripts | * Image splitting works completely different compared to Deorder's scripts | ||
Line 26: | Line 31: | ||
* Take your time to read [https://github.com/ptrsuder/IEU.Winforms/wiki/Basic-usage IEU wiki] first | * Take your time to read [https://github.com/ptrsuder/IEU.Winforms/wiki/Basic-usage IEU wiki] first | ||
− | ===[https://github.com/deorder/texture-upscaler Deorder's scripts (CTP)]=== | + | === CLI Tools === |
− | + | ||
+ | ==== [https://github.com/deorder/texture-upscaler Deorder's scripts (CTP)] ==== | ||
+ | |||
* They require '''Bash''' and imagemagick, both of which are available for '''Windows, Linux and MacOS''', on Windows you can use git bash, msys2 or Cygwin. There are others, but those are the main options | * They require '''Bash''' and imagemagick, both of which are available for '''Windows, Linux and MacOS''', on Windows you can use git bash, msys2 or Cygwin. There are others, but those are the main options | ||
* They run from a bash terminal. That makes them harder to use for many people who never used a CLI (command line interface) tool, but allow for an incredible automation potential | * They run from a bash terminal. That makes them harder to use for many people who never used a CLI (command line interface) tool, but allow for an incredible automation potential | ||
Line 35: | Line 42: | ||
* The scripts follow UNIX philosophy, each script has one function, that way you can script basically anything you want thanks to the power of bash, it allows you to emulate every feature of other tools like IEU and more, if you have the time and patience to do so | * The scripts follow UNIX philosophy, each script has one function, that way you can script basically anything you want thanks to the power of bash, it allows you to emulate every feature of other tools like IEU and more, if you have the time and patience to do so | ||
− | == | + | ==== Blue Amulet's Esrgan test.py script ==== |
+ | |||
# Put the pictures or textures you want to upscale into the <code>LR</code> folder | # Put the pictures or textures you want to upscale into the <code>LR</code> folder | ||
# If you want to use a model with a scale other than 4, you need to edit the test.py file. Just open it with your text editor and change the scale to the one from your model. The scale of each model is documented on our wiki. If you want to run an artifact removal model, like my jpg model for example change <code>scale=4</code> to <code>scale=1</code> | # If you want to use a model with a scale other than 4, you need to edit the test.py file. Just open it with your text editor and change the scale to the one from your model. The scale of each model is documented on our wiki. If you want to run an artifact removal model, like my jpg model for example change <code>scale=4</code> to <code>scale=1</code> | ||
Line 50: | Line 58: | ||
==Tips when using ESRGAN== | ==Tips when using ESRGAN== | ||
+ | |||
# When upscaling '''compressed textures''' use a 1x decompression model for the format first and or downscale them first by at least 50% with ,code>nearest neighbor</code> or <code>box</code> filtering first, before upscaling them in ESRGAN | # When upscaling '''compressed textures''' use a 1x decompression model for the format first and or downscale them first by at least 50% with ,code>nearest neighbor</code> or <code>box</code> filtering first, before upscaling them in ESRGAN | ||
# ESRGAN runs '''much''' faster on Nvidia GPUs, you can compile pytorch yourself for AMD GPUs but at the moment that is quite difficult to do | # ESRGAN runs '''much''' faster on Nvidia GPUs, you can compile pytorch yourself for AMD GPUs but at the moment that is quite difficult to do | ||
Line 58: | Line 67: | ||
# If you are still not happy with the results despite having tried out different models, consider training your own and sharing it with us later | # If you are still not happy with the results despite having tried out different models, consider training your own and sharing it with us later | ||
− | ==Additional | + | == Additional Notices == |
− | === | + | |
− | + | === Windows === | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* When upscaling large images (depending on your GPU for example 1000x1000px images) on Windows, it's possible for the operating system to kill the ESRGAN process if it takes too long. This can be fixed using the Nvidia Nsight Monitor app that is installed alongside the CUDA toolkit. [https://docs.nvidia.com/gameworks/content/developertools/desktop/timeout_detection_recovery.htm Here are Instructions for doing so] | * When upscaling large images (depending on your GPU for example 1000x1000px images) on Windows, it's possible for the operating system to kill the ESRGAN process if it takes too long. This can be fixed using the Nvidia Nsight Monitor app that is installed alongside the CUDA toolkit. [https://docs.nvidia.com/gameworks/content/developertools/desktop/timeout_detection_recovery.htm Here are Instructions for doing so] |
Revision as of 15:04, 4 April 2020
Make sure that you have followed the installation guide carefully (Windows, Arch Linux, MacOS). We support BlueAmulets fork offically, not the current ESRGAN branch from xinntao, if you use that one, you will get errors. |
Now that you have installed ESRGAN you can upscale images. There are a few different ways of using ESRGAN. Below I will document the official one. This should work for everyone, but there are a few different applications designed to make the life of the users easier as well as to prevent common pitfalls of using ESRGAN.
Contents
Things you need to know before you use ESRGAN
- ESRGAN supports only RGB images, that means it will remove alpha / transparency channels if present and it won't work with grayscale images.
- ESRGAN is limited by the amount of VRAM you have.
But there are ways around both. At the time of writing this there are some popular tools used by a lot of us to solve this:
Tools / Ways to use ESRGAN
GUI Tools
ptrsuder's IEU (Image Enhancement Utility)
- Easy to use GUI which makes it easy to use for users who don't love CLI yet
- Image splitting works completely different compared to Deorder's scripts
- Windows only for now. (crossplatform support maybe in the future)
- Has a lot of advanced options available without the need to write any scripts
- Some unique features:
- Ability to upscale seamless(tiled) textures (landscape textures for example)
- Ability to use a different model for the alpha channel
- Ability to upscale each channel separately (Red, Green, Blue and Alpha)
- Ability to interpolate models right in the UI
- It is quite mature by now, but if you encounter bugs or have feature requests, feel free to report them on Discord, or on GitHub repository by creating an issue.
- The Download is under IEU.Winforms Releases tab
- Take your time to read IEU wiki first
CLI Tools
Deorder's scripts (CTP)
- They require Bash and imagemagick, both of which are available for Windows, Linux and MacOS, on Windows you can use git bash, msys2 or Cygwin. There are others, but those are the main options
- They run from a bash terminal. That makes them harder to use for many people who never used a CLI (command line interface) tool, but allow for an incredible automation potential
- They include scripts for training as well as using ESRGAN
- You can use them for a lot of other Neural Networks not just BasicSR / ESRGAN
- Don’t use WSL (Windows Subsystem for Linux) if you run ESRGAN on a NVIDIA GPU since WSL doesn’t support GPU acceleration, which makes it unable to run ESRGAN in CUDA mode
- The scripts follow UNIX philosophy, each script has one function, that way you can script basically anything you want thanks to the power of bash, it allows you to emulate every feature of other tools like IEU and more, if you have the time and patience to do so
Blue Amulet's Esrgan test.py script
- Put the pictures or textures you want to upscale into the
LR
folder - If you want to use a model with a scale other than 4, you need to edit the test.py file. Just open it with your text editor and change the scale to the one from your model. The scale of each model is documented on our wiki. If you want to run an artifact removal model, like my jpg model for example change
scale=4
toscale=1
- Open a terminal window and navigate to the
esrgan
folder- For Windows Shift right click in your
esrgan
folder and selectOpen PowerShell window here
. For some users it might sayCommand Line
instead, if that is the case for you click on that and procced - For Linux / MacOS users the process is similar. File managers like Nautilus for example allow you to open a terminal in a folder. If that isn't an option for you can can also navigate using commands.
cd
allows you to navigate and pwd shows you the current folder.cd ..
goes one directory down (for example from/home/combi/code/git/ctp
to/home/combi/code/git
). Usecd /path/to/whatever
to navigate to absolute (full) paths orcd some-folder-in-the-current-folder
to navigate to a folder in the current open folder. (pwd
= print working directory; cd = change directory) If you want to find out more about a command you can just typeman the command-you-want-to-know-about
or use the internet
- For Windows Shift right click in your
- Enter:
- For Nvidia GPUs
python test.py models/${theModelYouWantToUse}
- For other GPUs / integrated Graphic
python test.py --cpu models/${theModelYouWantToUse}
- For Nvidia GPUs
- Don't enter
${theModelYouWantToUse}
Instead replace that with the name of a model of course As an example, for the default model it would be:python test.py models/RRDB_ESRGAN_x4.pth
- That was it, the results will be in the
results
folder
Tips when using ESRGAN
- When upscaling compressed textures use a 1x decompression model for the format first and or downscale them first by at least 50% with ,code>nearest neighbor or
box
filtering first, before upscaling them in ESRGAN - ESRGAN runs much faster on Nvidia GPUs, you can compile pytorch yourself for AMD GPUs but at the moment that is quite difficult to do
- If you run out of VRAM, use Deorder’s scripts or IEU, which will split the texture in smaller parts first
- If you have textures in sub-folders, use Deorder’s scripts or IEU with "Preserve folder structure" mode selected
- If your textures contain an alpha channel (transparency), use Deorder’s scripts or IEU
- Try out different models. In our Model Database you will find a lot of different models, that we trained ourself
- If you are still not happy with the results despite having tried out different models, consider training your own and sharing it with us later
Additional Notices
Windows
- When upscaling large images (depending on your GPU for example 1000x1000px images) on Windows, it's possible for the operating system to kill the ESRGAN process if it takes too long. This can be fixed using the Nvidia Nsight Monitor app that is installed alongside the CUDA toolkit. Here are Instructions for doing so