This version is fork of the original Xinntao Real-ESRGAN with multi-channel support (including alpha channel support) and some other optimizations and features. Only differences from the original version will be written here. You can read the description and features of the original version on it's page
🔥 AnimeVideo-v3 model (动漫视频小模型). Please see [anime video models] and [comparisons]
🔥 RealESRGAN_x4plus_anime_6B for anime images (动漫插图模型). Please see [anime_model]
Online demo for Multichannel-Real-ESRGAN: StableDraw
Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.
We extend the powerful ESRGAN to a practical restoration application (namely, Real-ESRGAN), which is trained with pure synthetic data.
- ✅ Add the realesr-general-x4v3 model - a tiny small model for general scenes. It also supports the -dn option to balance the noise (avoiding over-smooth results). -dn is short for denoising strength.
- ✅ Update the RealESRGAN AnimeVideo-v3 model. Please see anime video models and comparisons for more details.
- ✅ Add small models for anime videos. More details are in anime video models.
- ✅ Add the ncnn implementation Real-ESRGAN-ncnn-vulkan.
- ✅ Add RealESRGAN_x4plus_anime_6B.pth, which is optimized for anime images with much smaller model size. More details and comparisons with waifu2x are in anime_model.md
- ✅ Support finetuning on your own data or paired data (i.e., finetuning ESRGAN). See here
- ✅ Integrate GFPGAN to support face enhancement.
- ✅ Integrated to Huggingface Spaces with Gradio. See Gradio Web Demo. Thanks @AK391
- ✅ Support arbitrary scale with
--outscale
(It actually further resizes outputs withLANCZOS4
). Add RealESRGAN_x2plus.pth model. - ✅ The inference code supports: 1) tile options; 2) images with alpha channel; 3) gray images; 4) 16-bit images.
- ✅ The training codes have been released. A detailed guide can be found in Training.md.
- Python >= 3.7 (Recommend to use Anaconda or Miniconda)
- PyTorch >= 1.7
-
Clone repo
git clone https://github.com/Robolightning/Multichannel-Real-ESRGAN cd Multichannel-Real-ESRGAN
-
Install dependent packages
# We use BasicSR for both training and inference # facexlib and gfpgan are for face enhancement pip install facexlib pip install gfpgan pip install -r requirements.txt python setup.py develop
There are usually three ways to inference Real-ESRGAN.
Description is coming soon
- You can use X4 model for arbitrary output size with the argument
outscale
. The program will further perform cheap resize operation after the Real-ESRGAN output.
Usage: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile -o outfile [options]...
A common command: python inference_realesrgan.py -n RealESRGAN_x4plus -i infile --outscale 3.5 --face_enhance
-h show this help
-i --input Input image or folder. Default: inputs
-o --output Output folder. Default: results
-n --model_name Model name. Default: RealESRGAN_x4plus
-s, --outscale The final upsampling scale of the image. Default: 4
--suffix Suffix of the restored image. Default: out
-t, --tile Tile size, 0 for no tile during testing. Default: 0
--face_enhance Whether to use GFPGAN to enhance face. Default: False
--fp32 Use fp32 precision during inference. Default: fp16 (half precision).
--ext Image extension. Options: auto | jpg | png, auto means using the same extension as inputs. Default: auto
4-channeled models is comming soon
Download pre-trained models: RealESRGAN_x4plus.pth
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -P weights
Inference!
python inference_realesrgan.py -n RealESRGAN_x4plus -i inputs --face_enhance
Results are in the results
folder
Pre-trained models: RealESRGAN_x4plus_anime_6B
More details and comparisons with waifu2x are in anime_model.md
# download model
wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth -P weights
# inference
python inference_realesrgan.py -n RealESRGAN_x4plus_anime_6B -i inputs
Results are in the results
folder
If you have any question, please email [email protected]
or to author of the original project [email protected]
or [email protected]
.
If you develop/use Multichannel-Real-ESRGAN in your projects, welcome to let me know.
- Minecraft mod: [MC-textures-upscaler-mod](coming soon) by Robolightning
GUI
- Web graphic editor with neural networks: StableDraw by Robolightning