Comments (5)
@suke27 @rahidz
Yes, if the input images are JPEG images, which means it was compressed by JPEG algorithms, the output is "blocky" with checkboard.
During training, the ESRGAN has not seen these blocky JPEG artifacts and was not trained with the objective to remove them. Therefore, in testing, the ESRGAN "enhancing" the jpg artifacts already present, as @rahidz said.
Turning it to PNG format cannot remove these checkerboard (8 pixels by 8 pixels) in JPEG compression. After upsampling the image, the checkerboard artifacts appear (8*4=32pixels, so you will see 32 by 32 pixels checkerboard artifacts).
It is a limitation that ESRGAN (also other SR algorithms using the bicubic downsampling kernels) cannot handle the problems. Acturally, the ESRGAN (and many other SR algorithms) is limited to a very strong assumption - the perfect bicubic downsampling kernels. Howevere, in real world, the input images have diverse down-sampling kernels and are also with blur, JPEG compression and noise.
So the algorithms are not satisfactory for images in real world. These problems are also the research topics that the community wants to solve.
You can try to improve it by 1) removing the JPEG artifacts first by other algorithms like ARCNN; 2) finetuning the network with datasets with JPEG artifacts, so that the ESRGAN can handle them.
from esrgan.
For some jpg files I try, the output is very “blocky”’ like there’s small but very noticeable square blocks covering the entire image. I assume this is simply ESRGAN “enhancing” the jpg artifacts already present, since this doesn't noticeably occur for all jpg files in my experience.
I’ve noticed slight improvement by converting the jpg to a png before I start, but it’s still not great.
from esrgan.
@xinntao for suggestion 2) finetuning the network with datasets with JPEG artifacts, so that the ESRGAN can handle them.
I try to finetune using jpg dataset for SRGAN, but not work well, also block and noise exist
but same training method for EDSR works well.
from esrgan.
@suke27 You can try to first pre-train the network with L2/L1 loss with JPEG compressed images. And then use the pre-trained model to train a GAN-based model.
I think, L2/L1 loss is a clear and effective loss to guide the network to remove the JPEG compression artifacts (Therefore, finetuning with jpg dataset works well for EDSR). But for SRGAN, the VGG + Adv loss may be not enough to remove the JPEG artifacts. So I think first pre-training the network with JPEG compressed images to let the network learn to remove JPEG artifacts will work.
from esrgan.
I was able to get around this by taking my HR training set, down sampling 4x, then converting it to .jpg with a low quality (high compression) and using that as my LR set. This way the network is seeing jpg artifacts as inputs and a non jpg artifact version as a target and it learns to convert between them. It actually worked very well too.
from esrgan.
Related Issues (20)
- Is there a way to do I/O with YUV instead of RGB?
- Inference ESRGAN with Multiple GPUs
- 有关参数的设置
- CUDA runs out of memory HOT 4
- _pickle.UnpicklingError: invalid load key, '<'. run in google colab HOT 4
- Can you put the complete training code of ESRGAN in this repo? BasicSR is too complex and not very friendly for beginners HOT 2
- 为什么我使用自己修改的rrdb之后训练进行插值会得到这个bug
- Not recognising my upscale model.
- When I use RDN as the generator for training, the details of the generated image will appear R, G or B color spots.
- Please stop changing the state keys HOT 1
- Do you have a x2 pre-trained model?
- When I trained Real-ESRNet, I encountered this problem. HOT 1
- Not an issue just a question about image extend
- fail on MacOS(VENTURA) with NDArray > 2**32
- Shortcut connection / Residual structure in unnecessary for RRDB
- Error: Found no NVIDIA driver on your system #3699
- What is differents between RealESRGAN_x4plus.pth and RealESRGAN_x4plusD.pth
- Why the result is not statisfactory as like the result in paper? HOT 1
- Can esrgan use the 4x-ultrasharp model? HOT 1
- Agrandar imagen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esrgan.