GithubHelp home page GithubHelp logo

xinntao / esrgan Goto Github PK

View Code? Open in Web Editor NEW
5.7K 119.0 1.0K 24.86 MB

ECCV18 Workshops - Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution. The training codes are in BasicSR.

Home Page: https://github.com/xinntao/BasicSR

License: Apache License 2.0

Python 100.00%
esrgan

esrgan's Introduction

ESRGAN (Enhanced SRGAN) [:rocket: BasicSR] [Real-ESRGAN]

New Updates.

We have extended ESRGAN to Real-ESRGAN, which is a more practical algorithm for real-world image restoration. For example, it can also remove annoying JPEG compression artifacts.
You are recommended to have a try 😃

In the Real-ESRGAN repo,

  • You can still use the original ESRGAN model or your re-trained ESRGAN model. The model zoo in Real-ESRGAN.
  • We provide a more handy inference script, which supports 1) tile inference; 2) images with alpha channel; 3) gray images; 4) 16-bit images.
  • We also provide a Windows executable file RealESRGAN-ncnn-vulkan for easier use without installing the environment. This executable file also includes the original ESRGAN model.
  • The full training codes are also released in the Real-ESRGAN repo.

Welcome to open issues or open discussions in the Real-ESRGAN repo.

  • If you have any question, you can open an issue in the Real-ESRGAN repo.
  • If you have any good ideas or demands, please open an issue/discussion in the Real-ESRGAN repo to let me know.
  • If you have some images that Real-ESRGAN could not well restored, please also open an issue/discussion in the Real-ESRGAN repo. I will record it (but I cannot guarantee to resolve it😛).

Here are some examples for Real-ESRGAN:

📖 Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data

[Paper]
Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan
Applied Research Center (ARC), Tencent PCG
Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences


As there may be some repos have dependency on this ESRGAN repo, we will not modify this ESRGAN repo (especially the codes).

The following is the original README:

The training codes are in 🚀 BasicSR. This repo only provides simple testing codes, pretrained models and the network interpolation demo.

BasicSR is an open source image and video super-resolution toolbox based on PyTorch (will extend to more restoration tasks in the future).
It includes methods such as EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, etc. It now also supports StyleGAN2.

Enhanced Super-Resolution Generative Adversarial Networks

By Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, Chen Change Loy

We won the first place in PIRM2018-SR competition (region 3) and got the best perceptual index. The paper is accepted to ECCV2018 PIRM Workshop.

🚩 Add Frequently Asked Questions.

For instance,

  1. How to reproduce your results in the PIRM18-SR Challenge (with low perceptual index)?
  2. How do you get the perceptual index in your ESRGAN paper?

BibTeX

@InProceedings{wang2018esrgan,
    author = {Wang, Xintao and Yu, Ke and Wu, Shixiang and Gu, Jinjin and Liu, Yihao and Dong, Chao and Qiao, Yu and Loy, Chen Change},
    title = {ESRGAN: Enhanced super-resolution generative adversarial networks},
    booktitle = {The European Conference on Computer Vision Workshops (ECCVW)},
    month = {September},
    year = {2018}
}

The RRDB_PSNR PSNR_oriented model trained with DF2K dataset (a merged dataset with DIV2K and Flickr2K (proposed in EDSR)) is also able to achive high PSNR performance.

Method Training dataset Set5 Set14 BSD100 Urban100 Manga109
SRCNN 291 30.48/0.8628 27.50/0.7513 26.90/0.7101 24.52/0.7221 27.58/0.8555
EDSR DIV2K 32.46/0.8968 28.80/0.7876 27.71/0.7420 26.64/0.8033 31.02/0.9148
RCAN DIV2K 32.63/0.9002 28.87/0.7889 27.77/0.7436 26.82/ 0.8087 31.22/ 0.9173
RRDB(ours) DF2K 32.73/0.9011 28.99/0.7917 27.85/0.7455 27.03/0.8153 31.66/0.9196

Quick Test

Dependencies

  • Python 3
  • PyTorch >= 1.0 (CUDA version >= 7.5 if installing with CUDA. More details)
  • Python packages: pip install numpy opencv-python

Test models

  1. Clone this github repo.
git clone https://github.com/xinntao/ESRGAN
cd ESRGAN
  1. Place your own low-resolution images in ./LR folder. (There are two sample images - baboon and comic).
  2. Download pretrained models from Google Drive or Baidu Drive. Place the models in ./models. We provide two models with high perceptual quality and high PSNR performance (see model list).
  3. Run test. We provide ESRGAN model and RRDB_PSNR model and you can config in the test.py.
python test.py
  1. The results are in ./results folder.

Network interpolation demo

You can interpolate the RRDB_ESRGAN and RRDB_PSNR models with alpha in [0, 1].

  1. Run python net_interp.py 0.8, where 0.8 is the interpolation parameter and you can change it to any value in [0,1].
  2. Run python test.py models/interp_08.pth, where models/interp_08.pth is the model path.

Perceptual-driven SR Results

You can download all the resutls from Google Drive. (:heavy_check_mark: included; :heavy_minus_sign: not included; :o: TODO)

HR images can be downloaed from BasicSR-Datasets.

Datasets LR ESRGAN SRGAN EnhanceNet CX
Set5 ✔️ ✔️ ✔️ ✔️
Set14 ✔️ ✔️ ✔️ ✔️
BSDS100 ✔️ ✔️ ✔️ ✔️
PIRM
(val, test)
✔️ ✔️ ✔️ ✔️
OST300 ✔️ ✔️ ✔️
urban100 ✔️ ✔️ ✔️
DIV2K
(val, test)
✔️ ✔️ ✔️

ESRGAN

We improve the SRGAN from three aspects:

  1. adopt a deeper model using Residual-in-Residual Dense Block (RRDB) without batch normalization layers.
  2. employ Relativistic average GAN instead of the vanilla GAN.
  3. improve the perceptual loss by using the features before activation.

In contrast to SRGAN, which claimed that deeper models are increasingly difficult to train, our deeper ESRGAN model shows its superior performance with easy training.

Network Interpolation

We propose the network interpolation strategy to balance the visual quality and PSNR.

We show the smooth animation with the interpolation parameters changing from 0 to 1. Interestingly, it is observed that the network interpolation strategy provides a smooth control of the RRDB_PSNR model and the fine-tuned ESRGAN model.

   

Qualitative Results

PSNR (evaluated on the Y channel) and the perceptual index used in the PIRM-SR challenge are also provided for reference.

Ablation Study

Overall visual comparisons for showing the effects of each component in ESRGAN. Each column represents a model with its configurations in the top. The red sign indicates the main improvement compared with the previous model.

BN artifacts

We empirically observe that BN layers tend to bring artifacts. These artifacts, namely BN artifacts, occasionally appear among iterations and different settings, violating the needs for a stable performance over training. We find that the network depth, BN position, training dataset and training loss have impact on the occurrence of BN artifacts.

Useful techniques to train a very deep network

We find that residual scaling and smaller initialization can help to train a very deep network. More details are in the Supplementary File attached in our paper.

The influence of training patch size

We observe that training a deeper network benefits from a larger patch size. Moreover, the deeper model achieves more improvement (∼0.12dB) than the shallower one (∼0.04dB) since larger model capacity is capable of taking full advantage of larger training patch size. (Evaluated on Set5 dataset with RGB channels.)

esrgan's People

Contributors

xinntao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esrgan's Issues

UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead

I have the problem:
Model path models/RRDB_ESRGAN_x4.pth.
Testing...
1 baboon
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/upsampling.py:129: UserWarning: nn.Upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.{} is deprecated. Use nn.functional.interpolate instead.".format(self.name))
2 comic

How to reduce fringe interference in results?

I got some fringe interference (条纹干涉) in results, just like SRGAN results in the above picture. And I don't know how to call about such phenomenon officially which is often happened in GAN training.
It is worse in visual perception, and is there any way to reduce it? Or, which part of optimizations in ESRGAN reduce such phenomenon?
THX!

Enlarging images with alpha channel

Hello, is there any way to configure ESRGAN to preserve alpha (transparency) channel in png format images? It could be very useful when converting various textures with transparency for games. Best regards

import architecture as arch error

Hi! when I run test I get this errors

Traceback (most recent call last):
File "test.py", line 7, in
import architecture as arch
File "/User/1/ESRGAN-master/architecture.py", line 33
self.model = B.sequential(fea_conv, B.ShortcutBlock(B.sequential(*rb_blocks, LR_conv)),
SyntaxError: only named arguments may follow *expression

i tried this, but didn't help
here

Out of memor for .jpg images

When I use a .jpg image to test, system tell me that it`s out of memory.(I run it in Google Colab with 11.7G memory)

Not enough Vram

Hello,

So I've tried ESRGAN with higher resolution images, such as 1280x720, but it says that my GPU (970gtx) doesn't have enough VRAM to process it. Is there a way to make the higher resolution images work with my GPU? Maybe someway to cache the data?
I tried the CPU option, but even with 16GB of RAM, it still says not enough memory.

Killed: 9

After running the ESRGAN test on a 12" 240dpi 6000 pixel file the process fails with:

Killed: 9

Does anyone know what this means and how I can get the process to complete successfully?

keep going if some file processing fail ?

Hello.
When i use the test.py all is working great, but if i have some picture bigger than my computer can process in a whole set of picture, the processing stops then it can't process one file.
Is there any way to keep the processing going to the nexts file in case of processing error on one file ?

thanks

CPU Device Segfaults

Using 'cpu' instead of 'cuda' causes a segfault. CUDA 10.0.130, PyTorch 1.0.0 (latest versions)

Not sure where any other information regarding the crash would be located.

预训练的模型没法直接用来测试

您好,首先感谢下您的代码,对我有很大的帮助,但现在有一个问题,想请教您一下,使用您提供的训练好的模型进行跑您的测试代码时,会出现如下问题
root@c07bd16360cb:/home/qiuyj/ESRGAN# python test.py models/RRDB_ESRGAN_x4.pth
Traceback (most recent call last):
File "test.py", line 17, in
model.load_state_dict(torch.load(model_path), strict=True)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for RRDB_Net:
Missing key(s) in state_dict: "model.9.bias", "model.9.weight".
Unexpected key(s) in state_dict: "model.1.sub.2.RDB1.conv1.0.weight", "model.1.sub.2.RDB1.conv1.0.bias", "model.1.sub.2.RDB1.conv2.0.weight", "model.1.sub.2.RDB1.conv2.0.bias", "model.1.sub.2.RDB1.conv3.0.weight", "model.1.sub.2.RDB1.conv3.0.bias", "model.1.sub.2.RDB1.conv4.0.weight", "model.1.sub.2.RDB1.conv4.0.bias", "model.1.sub.2.RDB1.conv5.0.weight", "model.1.sub.2.RDB1.conv5.0.bias", "model.1.sub.2.RDB2.conv1.0.weight", "model.1.sub.2.RDB2.conv1.0.bias", "model.1.sub.2.RDB2.conv2.0.weight", "model.1.sub.2.RDB2.conv2.0.bias", "

生成lmdb文件时出现了除0的错误

问题出现在progress_bar.py文件中的update函数fps = self.completed / elapsed这里elapsed变成零了。我把elapsed = time.time() - self.start_time中的两个值打印出来发现是一样的:
Read images...
[ ] 0/36352, elapsed: 0s, ETA:
Start...
1554711715.5890906
1554711715.5890906
0.0
Traceback (most recent call last):
File "create_lmdb.py", line 22, in
pbar.update('Read {}'.format(v))
File "D:\code\BasicSR\codes\utils\progress_bar.py", line 43, in update
fps = self.completed / elapsed
ZeroDivisionError: float division by zero
其中我的路径设置是这样的:
img_folder = 'D:\code\BasicSR\codes\data\HR\*.png'
lmdb_save_path = 'D:\code\BasicSR\codes\data\HR.lmdb'
需要您的帮助!谢谢

Your pre-trained model on lossy JPEG images

Thanks for sharing your code and approach.

But testing your approach using everyday images is a hard task since the images are mostly JPEGs and have noisy artifact blocks and in 99% of cases we don't have access to the RAW noiseless version of the images.

Can you provide a pre-trained model on noisy images? I'm curious to see if the SRGAN-based methods only do nicely on the noiseless raw images or if they can do both DeNoising + SuperResolution too?

Thanks again.

What is the minimum requirements to run ESRGAN in general?

I was testing ESRGAN out on a workstation when I realized CUDA 2.1 is not supported for PyTorch.

I'm assuming that also means ESRGAN is not supported because of CUDA 2.1.

But to be exact, I don't see any minimum requirements to run ESRGAN. Thus, I have to come to this conclusion the hard way.

To prevent such things from happening, I would like to request on the README.md to list out the minimum requirements to properly run ESRGAN.

  • What Nvidia CUDA version is required?
  • What Nvidia architecture is needed? (Fermi, Volta, Pascal, Turing, etc.?)
  • What Nvidia card type and up can be used? (Quadro, NVS, GeForce?)

Thanks.

测试结果图片的质量

您好,当我直接用您训练好的模型拿来测试时,生成的高分图像质量比较差,有几个问题想请教,
1、LR图片的分辨率是128×64,格式是jpg格式的,不是等宽高的,这样对结果影响大吗?
2、如果想生成的分辨率是原来的两倍而不是四倍,需要从改变训练图片上入手吗?

the pix loss

Thank you very much for you job firstly
When I try to exchange l_g_pix = self.l_pix_w * self.cri_pix(self.fake_H, self.var_H) with l_g_pix = self.l_pix_w * self.cri_pix(self.var_H,self.fake_H), I found the value of l_g_pix is differend ,How to explain this?

Hope for reply

Runtime error: Torch: Not enough memory: you tried to allocate 2GB - on a 32gb machine?

Why is this happening? I am also getting a similar error when trying to run SFTGAN, only then it's trying to allocate 4gb. Also, I am not seeing the ram fill up in the task manager when I get this error. It also seems that the program is capable of reporting correct attempted memory allocation sizes for other errors. For instance, when I try running SFTGAN segmentation test on a 6144x6144 image, it reports attempting to commit 40gb and failing at it, and this time I am seeing the memory fill up completely via the task manager. Not with the current error though. Image size is 4096x4096 by the way. Any suggestions on how to get around this are much appreciated.

Thanks

cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

Fails to run on CUDA 9.0.
My current environment works fine on CUDA with TensorFlow-gpu and CNTK.
Rig: 8700K with 32 GB and 2080 RTX with 8GB.
Latest drivers.

File "G:/Projects/ESRGAN-master/test.py", line 39, in
output = model(img_LR).data.squeeze().float().cpu().clamp_(0, 1).numpy()
...........
RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED

Maybe a VRAM issue ?

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 9: invalid start byte

Then I want to lauch test.py I have this error:
''Traceback (most recent call last):
File "test.py", line 21, in
model = model.to(device)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 381, in to
return self._apply(convert)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
module._apply(fn)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
module._apply(fn)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 193, in apply
param.data = fn(param.data)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 379, in convert
return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\cuda_init
.py", line 163, in _lazy_init
_cudart = load_cudart()
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\cuda_init
.py", line 60, in load_cudart
lib = find_cuda_windows_lib()
File "C:\Users\Никита_Владимир-ПК\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\cuda_init
.py", line 33, in find_cuda_windows_lib
out = out.decode().strip()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 9: invalid start byte''
Why this is happening ? Tell me please. My PC spec`s^
Windows 10
AMD Ryzen 2400g 3.89 Ghz
Geforce 1060 4 GB
8 GB RAM

hidden grid on the result image

Grate work!! ,

but after zooming result images(JPG format) have some hidden grid noise that makes it ugly >
wil changing any parameter will solve this,

scscs

About result images in Google drive

Hello.

Thank you very much for sharing the model, code, and results!

I have a quick question:

Are result images in the Google drive (PIRM-test) are different from your PIRM 2018 submission? I re-calculated RMSE and PI, but results were slightly different from the report.

If so, I would like to know the difference.

Thank you!

run error

Hello, i try to run test.py with python 2.7 below errors occurred:

weiyang.su@deeplearning:~/Super_Resolution/ESRGAN-master$ python test.py models/RRDB_PSNR_x4.pth
models/RRDB_PSNR_x4.pth
Traceback (most recent call last):
File "test.py", line 18, in
model.load_state_dict(torch.load(model_path), strict=True)
File "/home/weiyang.su/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for RRDB_Net:
Missing key(s) in state_dict: "model.1.sub.1.bias", "model.1.sub.1.weight", "model.5.bias", "model.5.weight", "model.7.bias", "model.7.weight".
Unexpected key(s) in state_dict: "model.8.weight", "model.8.bias", "model.10.weight", "model.10.bias", "model.1.sub.2.RDB1.conv1.0.weight", "model.1.sub.2.RDB1.conv1.0.bias", "model.1.sub.2.RDB1.conv2.0.weight", "model.1.sub.2.RDB1.conv2.0.bias", "model.1.sub.2.RDB1.conv3.0.weight", "model.1.sub.2.RDB1.conv3.0.bias", "model.1.sub.2.RDB1.conv4.0.weight", "model.1.sub.2.RDB1.conv4.0.bias", "model.1.sub.2.RDB1.conv5.0.weight", "model.1.sub.2.RDB1.conv5.0.bias", "model.1.sub.2.RDB2.conv1.0.weight", "model.1.sub.2.RDB2.conv1.0.bias", "model.1.sub.2.RDB2.conv2.0.weight", "model.1.sub.2.RDB2.conv2.0.bias", "model.1.sub.2.RDB2.conv3.0.weight", "model.1.sub.2.RDB2.conv3.0.bias", "model.1.sub.2.RDB2.conv4.0.weight", "model.1.sub.2.RDB2.conv4.0.bias", "model.1.sub.2.RDB2.conv5.0.weight", "model.1.sub.2.RDB2.conv5.0.bias", "model.1.sub.2.RDB3.conv1.0.weight", "model.1.sub.2.RDB3.conv1.0.bias", "model.1.sub.2.RDB3.conv2.0.weight", "model.1.sub.2.RDB3.conv2.0.bias", "model.1.sub.2

do you face similar problem?

CUDA version

I can not train the code ( ESRGAN model), and I get this error
training_problem_after_fixing_dataset_problem
I think it's related to CUDA version, I am using CUDA 10.0

why not subtract the mean of the image.?

@xinntao Hi, I didn't find the operation about subtracting the mean of the image. I am confused that if the image should be normalized or not. I think it may be useful and easy to train the network with the zero mean of the input images.
Looking forward to your reply.
best wishes.

about the results you provided

When I compute the psnr between the HR images and the SR images you provided in Google Drive. The psnr of your SR baboon image in Google drive is 18.57dB, but in your paper the value is 20.35dB. Can you provide the psnr.py? or tell me what happened about my code? and I use skimage.measure.compare_psnr( )
image

Gpu usage low

Im getting low gpu usage from my GTX 1080ti

image

Anything i can do to fix that?

inference with jpg files

Hello, As I know GAN algorithm has problem on jpg images.
do you try your algorithm for jpg files? is there abnormal noise texture exist in output?

something about discriminator

hello,the discriminator ,in pix2pix uses patchgan but srgan do not use the structure and pix2pix use the
connection of fake image and real image while srgan only use fake image as input,how to choose two differnet structure ? thanks

evaluate D

I have some doubts about GAN.
D and G are alternately trained during the training.
How to evaluate that the D can make a correct judgment?Thank you!

differenct about ESRGAN and PSNR

hello, I check the 2 pretrained models that you provided, what is difference about 2 models. different training dataset or different loss function.

ImportError: No module named cv2

Hello,
I followed the various steps and installed all of the dependancies. When I run the test code I get: ImportError: No module named cv2

cv2 is located at: /usr/local/lib/python3.7/site-packages/cv2

I have a file called .bash_profile located at /Users/MyUserName/.bash_profile which I added this line to: export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Also I get an error after installing PsyTorch and running the first line of their test code to verify correct install: from future import print_function

That test fails with error: from: can't read /var/mail/future

I have no idea what's going on with this as it's my first time trying to run ESRGAN

I used Homebrew to install Python 3 then used the pip3 command to install the required dependencies. I did not use Anaconda as I've never used that before but have used Homebrew many times in the past on other projects.

Any help is much appreciated:-)

Image with alpha channel fails

Hi, you can work around this by moving the alpha to a separate grayscale image and process it separate and then stitch it together again. But it would be nicer if was a automated process.

the SR image of SRGAN BSD100

Thank you for your wonderful work. I am also very interested in GAN, how do you get the SR image of SRGAN's BSD100?

Add running at CPU

yolkis@YOLKIS:~/ESRGAN$ python3 test.py models/RRDB_ESRGAN_x4.pth
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=74 error=35 : CUDA driver version is insufficient for CUDA runtime version
Traceback (most recent call last):
File "test.py", line 19, in
model = model.cuda()
File "/home/yolkis/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in cuda
return self._apply(lambda t: t.cuda(device))
File "/home/yolkis/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/home/yolkis/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/home/yolkis/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 191, in _apply
param.data = fn(param.data)
File "/home/yolkis/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in
return self._apply(lambda t: t.cuda(device))
RuntimeError: cuda runtime error (35) : CUDA driver version is insufficient for CUDA runtime version at /pytorch/aten/src/THC/THCGeneral.cpp:74

White balance is affected

Hi, I did a quiick test for our game. The white balance of the image is affected by the upscale. Here I switch between the two. The upscale is 4 maps, one base color, one specular/glossness (alpha chanel processed seperate), normalmap and AO map.

https://www.youtube.com/watch?v=79Cy8jUOjRA

As you can see the white balance of the texture is affected

RuntimeError: cuda runtime error (30) : unknown error at ..\aten\src\THC\THCGeneral.cpp:51

Hi, I installed CUDAv10 on Windows 10, but I'm not able to run the test script:

x:\GIT\ESRGAN>python test.py models/RRDB_ESRGAN_x4.pth
THCudaCheck FAIL file=..\aten\src\THC\THCGeneral.cpp line=51 error=30 : unknown error
Traceback (most recent call last):
  File "test.py", line 21, in <module>
    model = model.to(device)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\nn\modules\module.py", line 381, in to
    return self._apply(convert)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
    module._apply(fn)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\nn\modules\module.py", line 187, in _apply
    module._apply(fn)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\nn\modules\module.py", line 193, in _apply
    param.data = fn(param.data)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\nn\modules\module.py", line 379, in convert
    return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
  File "c:\DEV\Utils\Python37\lib\site-packages\torch\cuda\__init__.py", line 162, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at ..\aten\src\THC\THCGeneral.cpp:51

Any idea why? (maybe using LSD instead? ;-)

Runtime Error

I'm getting this runtime error during processing: RuntimeError: CUDA out of memory. Tried to allocate 289.50 MiB (GPU 0; 4.00 GiB total capacity; 2.92 GiB already allocated; 0 bytes free; 2.18 MiB cached)

My GPU should have enough memory for the image, but ESRGAN is just not using it for some reason. I'm sure that I do something wrong here...

My System:
Windows 10
AMD Ryzen 1600 3.5 Ghz
Geforce 970 4 GB
16 GB RAM

a question about residual in your paper

In paper of edsr,rcan and so on, before residual there should be a conv.
For example, in edsr , (conv-act-conv)*n_blocks-conv , and there is a residual before and after this.
In rcan, (block1-block2-...-block20-conv) is a group , there is a residual before and after a group, which is called short residual, and the residual before and after (group1-group2-...-group10-conv) is called a long residual.
In your paper (P5, figure4 right, RRDB), there is a conv for short residual in the dense block, but no another conv for long residual, do you think it should be a conv after the third dense block?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.