1.5M ratings
277k ratings

See, that’s what the app is perfect for.

Sounds perfect Wahhhh, I don’t wanna

I figured out how to get ESRGAN (and SFTGAN) running on Windows. Unfortunately, it’s not as user friendly as waifu2x, but it’s fairly easy as far as Python deep learning programs go.

The most up to date info is at Reddit’s /r/gameupscale. https://www.reddit.com/r/GameUpscale/ You can also check out the Game Upscale Discord here: https://discord.gg/jkFHzGD 

I’m leaving this guide up because it still gets quite a bit of traffic.


You will need:

Windows 7 or up, 64-bit only

An Nvidia GPU is recommended. the newer and the more memory, the better. My 6GB 1060 could upscale 1024x600 images to 4096x2400. You’ll need to run it in CPU mode otherwise - see step 3.5.

Python 3 64-bit (x86-64) : https://www.python.org/downloads/release/python-366/

Step 1: Install CUDA 9.2 or 10.0, plus the patch if there is one. I believe you only need the CUDA and driver components: https://developer.nvidia.com/cuda-toolkit-archive

Step 2: Go to the PyTorch installation site. Use “pip” as the package, “stable” for the build, and everything else should match your software versions. Open up the Windows command prompt (search “cmd” in the start menu) and paste in the commands. https://pytorch.org/get-started/locally/

If it tells you “x is not a supported wheel on this platform”, make absolutely sure your options match and that your Python installation is 64-bit, or try different versions of Python or CUDA.

While you’re there, paste in this (pip3, not pip): pip3 install numpy opencv-python

Step 3: Download https://github.com/xinntao/ESRGAN along with the two pretrained models.

Step 3.5 (READ IF YOU HAVE AN AMD/INTEL GPU): Go into test.py and change “device = torch.device(‘cuda’)“ to “ device = torch.device(‘cpu’)”.

Step 4: Follow the instructions in ESRGAN’s “Quick Test” section. I highly recommend running the network interpolation command, because the default, full monty SRGAN model can make images a bit noisy whereas PSNR is too blurry. I usually use 0.8.

Ignore any “nn.Upsampling is deprecated” errors, they have no effect on the results. Do not use PNGs with alpha channels or you will get an “index out of range” error.k

Make sure to include the model path, or else you will get an “IndexError: list index out of range“ error. Either navigate to the ESRGAN directory via the command prompt, or save the commands you want as a .bat file in the ESRGAN directory.


.

Optional Step 5, for SFTGAN: Download SFTGAN here and follow the PyTorch instructions under “Test Models”. Make sure to download the pretrained models: https://github.com/xinntao/SFTGAN

SFTGAN is similar to ESRGAN. It tries to make more intelligent guesses about what kind of details it’s trying to retrieve, and it looks better in some cases (outdoor photographs, textures) and worse in others. The requirements are the same as ESRGAN.

Just Cause 2 texture comparison: https://imgur.com/a/JDsvVei

Place the images for  SFTGAN in data/samples. Unlike ESRGAN, you need to scale up the images by 4x before you run it. SFTGAN will downscale the image, then upscale it again, leaving the resolution unchanged. I use nearest neighbor scaling, but cubic scaling could be worth a try if dithering’s a problem.


Additional Info: I’ve been seeing this tutorial on other sites now and there’s a couple of things I need to clear up:

1. ESRGAN’s default networks were trained on a very specific type of image. That is, high resolution photographs downscaled with bicubic sampling. So it struggles with pics that went through color reduction or heavy dithering (like you see with old prerendered sprites), pictures that are blurry (I’d recommend downscaling them by 50%, as you’ll still get a 2x resolution boost), and pixel art. It may be possible to “tune” it by training it on specific categories of images. I’ve had some success adding small amounts of noise to the images to help it out, or blurring out color banding or sharp edges.

Other tips here:  https://boards.fireden.net/v/thread/443447437/#443455703

2. ESRGAN and SFTGAN are not the only super-resolution programs out there. The former is a modification of the existing SRGAN program from 2 years ago, and there’s new ones coming out every week. Not all of them exist as open source programs and not all of them run on Windows (Ubuntu 16.04 seems to be the “standard” OS for neural network programs), but I recommend you give them a try too, since there’s no one best way of upscaling photos. You could even shell out cash for Let’s Enhance or AI Gigapixel if you have more money than time.

3. Waifu2x is (as far as I know) the state of the art for illustrations and it’s what I’d recommend for HD anime reaction images.

4. NVIDIA is working on their own superresolution program. Right now it’s in closed beta (I’ll provide a link if they accept my application), but once it’s available to the public it’ll likely be the standard for super-resolution, and you’ll start seeing game developers use it themselves. https://developer.nvidia.com/gwmt

esrgan neural networks superresolution super-resolution neural network machine learning prosr ESR