nagadomi / waifu2x

Image Super-Resolution for Anime-Style Art
http://waifu2x.udp.jp/
MIT License
27.33k stars 2.71k forks source link

Jpeg noise removal not working #432

Open eyetest42 opened 1 year ago

eyetest42 commented 1 year ago

or at least it doesn't appear to be...

nagadomi commented 1 year ago

It works. What's the trouble? Please hard refresh your browser (maybe CTRL+F5) and try again, as today I have updated the front-end scripts.

horse14t commented 1 year ago

I have the same issue sometimes. I like to use the site to clean up jpgs for a fan wiki I like to edit. But sometimes when I want to compare the Medium noise removal with the High, one or the other doesn't work! Here's a image of the settings I was using: Waifu Issue

I tried both the Convert button and Download but it makes no difference. Adding upscaling does fix it however, I would prefer to use the None option for wiki images.

nagadomi commented 1 year ago

How does it not work? Server error? or it is not the expected conversion result?

horse14t commented 1 year ago

When I save the image after clicking either Convert or Download it is no different from the original file. There is no Server error or anything. Here's a comparison between the original artwork and the Waifu export with the High setting: Waifu Issue 2 Notice how there's no difference. Compare that to the Medium setting where there is a visible difference. Waifu Issue 3

nagadomi commented 1 year ago

I think it is the same problem as below. It is not a bug in the program, but a performance issue with the machine learning model.

It is a known issue of CUNet model(defualt model). level0~2 overfits the JPEG quality(noise level) of the input image.

noise_level=0: Expected input image compressed with JPEG quality 85-95 noise_level=1: Expected input image compressed with JPEG quality 65-85 noise_level=2: Expected input image compressed twice with JPEG quality 27-70

If the input image is compressed once with JPEG quality 80, denoising result is better with level1 than with level2. level2 may not remove weaker noise than expected... level3 simply denoise strongly.

(level1=Medium, level2=High) related: https://github.com/nagadomi/waifu2x/issues/320#issuecomment-570095404

nagadomi commented 1 year ago

I am currently reworking the training code and will probably be able to fix this issue in the next few months. The level2 should have included all noise patterns lower than level2.

horse14t commented 1 year ago

Sounds good! 👍Thank you!