SRGAN icon indicating copy to clipboard operation
SRGAN copied to clipboard

The result of jpg is poor

Open Jean332 opened this issue 7 years ago • 11 comments

I found almost each SRGAN doesn't well in jpg's img.I want to know what's the problem? Is it because the SRGAN's structure,or the dataset? If I convert the DIV2K‘s form into jpg, will it help? and how should I modified the code? If it doesn't work well in the image which is original LR, not being lossless compression from a HR image,In this case I think its applied value is much little…

Jean332 avatar Feb 25 '18 08:02 Jean332

if I remember correctly, there is another issue discuss this problem.

zsdonghao avatar Feb 25 '18 15:02 zsdonghao

Yes,there is.And it discussed the problem of jpg,but not tell about how to improve it.I really wanna find it out.

Jean332 avatar Feb 25 '18 15:02 Jean332

I also found same problem, but currently no good way to resolve it

suke27 avatar Mar 03 '18 03:03 suke27

It is possible to use tl.vis.read_images and tl.vis.save_images to convert all JPG into PNG?

wagamamaz avatar Mar 12 '18 14:03 wagamamaz

Oh, my. I also faced the same problem, now my boss is storming me for solving it And! Even if you replaced the LR image from the training set with jpg images, it shall not reach your expectations. Because the source code did not really read the LR images for training, it generates, the digital zoomed 1/4 pics from HR image crops So, I'm searching for a way to lower the quality of the training set. If you have found a way, please notify me. By the way, I found the camera did not provide enough information as the pics provided by DIV2K sets. That's obvious, I zoomed a 192192 pic to 9696 then make a SR, compared with an original 96*96 pic made SR, the zoomed one looks vivid, which implies that the camera did some compression or interpolation before transmitting! Since I'm working with camera, it proved the SR cannot work with home camera well.

Heermosi avatar Jul 17 '18 08:07 Heermosi

@Heermosi even we input jpg files as input, also can not this problem, do you have any new progress?

suke27 avatar Jul 17 '18 12:07 suke27

@suke27 @Jean332 Currently I changed the util.fn_downsample to make jpg inputs. The main reason for the bad repair results from poor input image quality. Now from current training results, the generated files are still very poor, even poorer than the srgan_ginit results visually.

I think may be ...... small random noises must be applied, so that the GAN itself may learn how to overcome the trivial glitches.

I cannot expect much, in fact the result we expected implied too much prior knowledge. For example, we can ignore the jpg degrade because we can identify the details, the part of objects. However if the D network is much too strong to overcome all the generated noises, it would become less sensitive to the generated quality of the pics.

What I expect a human should be doing in a GAN style: The target should be, the D network detects and abstracts the pic into parts. Then the G network replace the parts into most clear version in place or so, finally fuse each part and adjust the lines to make it looks natural. (However, you may not expect the network works exactly as people do)

Fine, I want some new progress, But it seems no one has reached a good result. So I just contribute clues here....

Being urged by Boss is really headaching ... I thought I'll be fired if I cannot find a way out..

Heermosi avatar Jul 19 '18 02:07 Heermosi

@wagamamaz Really, you don't need to save it into files. You only need to use python-opencv to convert it into jpg encoding, then back. That's enough. ---- Though the JPG trained result is still poor.

Heermosi avatar Jul 19 '18 05:07 Heermosi

@Heermosi "I thought I'll be fired if I cannot find a way out.." sorry to hear that, what is your target, just super resolution? if so, you can consider other solution. GAN is not stable

suke27 avatar Jul 19 '18 06:07 suke27

@suke27

  1. Yesterday, the good news is, my boss looked happy with current progress ... ignorant of the limit of real application. Thank you for your consideration

  2. It's true, GAN is not so pleasant. The target is simple: extending the detection range of objects. Fine, except for better graphic quality, it seems cannot be helped. Or, there is a proposed way, an ICCV 2017 paper referenced in thread #18, I've not tried yet Training with low quality input is not a good choice.... it cannot over come the difficulty

  3. I think there must be something ignored or, there is some limit to GAN (such as what happened to human, the concept drift). May be the GAN guessed true images equals to burry boundaries which leads to a disaster.

Heermosi avatar Jul 20 '18 05:07 Heermosi

@Heermosi do you have any progress on GAN SR for jpg files? have you tried Deep Generative Adversarial Compression Artifact Removal, it is work well for jpg files?

suke27 avatar Sep 29 '18 10:09 suke27