Close
Waifu2x
I recently discovered a neat little script http://waifu2x.udp.jp/ and it literally blew my mind! The quality of the script is just out of this world. It is able to remove jpeg artefacts and resize pictures by the factor of 2. However, it preserves an incredible amount of fine details, I have never seen before.

I have used it to clean up two jpeg_artifacts tagged posts to demonstrate what I mean. The code is open source and many different projects exist around it. I'm sure some of you already know this, but for everyone else, this is the swiss knife you need for picture cleanup!

Samples:
https://yande.re/post/show/325869
https://yande.re/post/show/325849

Cheers!
I can understand the filtering, but if anyone upscales image using this they'll likely get banned from this site.
I think you meant to say, if anyone uploads the upscaled images they'd get banned.
Knew about it since months and I only started to play with it three days ago. Results are decent.
Oh so we can post the cleaned images? I get it for the up scaled ones but cleaned ones are allowed right?
Scans are preferably cleaned.
WtfCakes said:
I think you meant to say, if anyone uploads the upscaled images they'd get banned.
No, the original meaning is correct. There is a level of hell reserved for people who upscale images.

animefan01 said:
I get it for the up scaled ones but cleaned ones are allowed right?
Yes, as long as they aren't filtered excessively.
ReikaChan said:
I recently discovered a neat little script http://waifu2x.udp.jp/ and it literally blew my mind! The quality of the script is just out of this world. It is able to remove jpeg artefacts and resize pictures by the factor of 2. However, it preserves an incredible amount of fine details, I have never seen before.

I have used it to clean up two jpeg_artifacts tagged posts to demonstrate what I mean. The code is open source and many different projects exist around it. I'm sure some of you already know this, but for everyone else, this is the swiss knife you need for picture cleanup!

Samples:
https://yande.re/post/show/325869
https://yande.re/post/show/325849

Cheers!
Woah, never tried the noise reduction part. It's so good. Which level do you use, low or high?

And yeah, it only works with very high frequency noise (like jpeg artifacts, or screening on resized scans). It won't work with screening in 300dpi and above.
Noise reduction is nice, mostly will be used for getting rid of jpg artifacts in my case.
Wonder if I can make a set up without having to rely on a webserver. Not a terrific programmer to begin with and fail at Lua. =\
Radioactive said:
No, the original meaning is correct. There is a level of hell reserved for people who upscale images.
What if you were wanting to use an image as a wallpaper?
Or blow up an image to use for a print.
Actually not a bad thing for cleaning up the jpg artifacts for some PS4 CG screenshots. No I'm not going to go and get a capture card.
WtfCakes said:
What if you were wanting to use an image as a wallpaper?
Or blow up an image to use for a print.
As long as Radioactive didn't catch you!
What if I announce it to him that I did? :3
Partially lost me a few days, and I find this.

Dx

Y que les puedo decir de este traductor....
here if you wanna use in your pc without internet
http://inatsuka.com/extra/koroshell/
ennc said:
here if you wanna use in your pc without internet
http://inatsuka.com/extra/koroshell/
Oh nice, I don't have to do anything at all.
Figured that it'll be very CPU taxing, not surprised.

Edit - Nevermind it keeps erroring out on me for some reason now.
Can't find the xxxx.json files...

Edit 2 - Need to have the program within the same drive partition, that's a tad annoying.
It noteworthy that the CPU version bundled with koroshell/waifu2x-converter Windows port doesn't denoise as well as the version on the http://waifu2x.udp.jp/ webserver.

It currently adds a strange grain to the image, fails to remove almost all color noise, and oversmooths more detail than the test server version, which makes me think it's literally broken.

Either it has something to do with entirely skipping the CUDA/Torch7 routine, or there is a flaw in the current implementation. Everyone should probably avoid that particular Windows version for the time being.

Edit: I see the problem. The version bundled with koroshell/waifu2x-converter(WL-Amigo) only supports the waifux2 model for filtering Y luminance, while the web version filters RGB. For obvious reasons, when filtering out heavy jpeg compression you really need those nasty color artifacts to be denoised as well.
The forked Windows version found at https://github.com/tanakamura/waifu2x-converter-cpp seems to function properly + RGB model support (links to pre-built binaries on the bottom of page), and it also supports CUDA/OpenCL making it very fast.

If for whatever reason you don't have a GPU supporting CUDA/OpenCL or have set the --disable-gpu parameter, make sure you also set the --block_size parameter to something other than 0, or performance will be horrible.

On my i5-3570K CPU, the smallest --block_size 128 seems fastest.

On my GTX770 GPU, either the default --block_size 0 or --block_size 1024 are fastest.

You may want to update the models_rgb folder with the json files found at: https://github.com/nagadomi/waifu2x/tree/v1.0/models/anime_style_art_rgb The latest version from 2 days ago seems to offer slightly better detail retention. These also appear to be the ones which are currently in-use on the http://waifu2x.udp.jp/ test server.

An alternative fork supporting RGB + CUDA can be found at:
https://github.com/lltcggie/waifu2x-caffe/releases
Requires cudnn64_65.dll from the NVIDIA Registered Developer Program to use CUDA on that one though (crashes for me without it). The license for cuDNN v2 appears to allow redistribution, so I've rehosted it here: https://www.mediafire.com/?2uhcwb9i1lzd18c

The GUI with that one is Japanese only, but you can reference this for a rough translation: http://i.imgbox.com/I1Zsg82c.png The caffe version is also slightly different in that it seems fastest with a block size of 256 on my GTX770.

Compared to the tanakamura version which uses bicubic, the caffe version seems to use a lower quality method for 4:2:0 YUV subsampled JPEG -> RGB conversion (bilinear?). To get near-identical results between tanakamura/caffe/web, you'll need to save your images as RGB before filtering.
@Cyberbeing
You walked all the path I walked a month ago lol. Then I built myself a waifu2x server with 1 master CUDA card and 12 OpenCL card, cope with highly customized trained waifu but I'm still reluctant to disclose this to anyone due to risk of having flooded with upscaled stuff.
Share it with the mods and they'll take care of the pics that need to be fixed. Make a request thread for image fixing... I mean, this is the best image board online IMO and it's a shame that some of the best images are ruined by such problems, so I think that we should use this to this place's advantage. At least, you guys should. Whatever.
There's kind of a tutorial for anyone that knows or bothers with ubuntu or presumably any linux platform.

Web server one is even more lawlsy than the one used in either koroshell or caffe.

Yeah I know the image I used it on is long forsaken to the land of jpg artifacts but still was worth a try.
Yeah, not going to spend the money to make a server solely for waifu2x. Though I realize I don't need to get Xeon E3 at min or ECC RAM to go with it and chucking my 770 in, it feels like I have no other uses for a server and dedicating it solely to it is a tad waste to me.
Either it has something to do with entirely skipping the CUDA/Torch7 routine, or there is a flaw in the current implementation. Everyone should probably avoid that particular Windows version for the time being.
Just going to note that CUDA isn't any actual routine or algorithm, it's a framework used for gpu accelerated processing.
Not a fan of CUDA honestly and would prefer OpenCL platforms but eh. AMD's compute is better and Intel also supports OpenCL, while their IGPUs aren't the greatest, the Iris ones are decent enough to do some light work GPU accelerations like these. Especially for laptops.
animefan01 said:
Share it with the mods and they'll take care of the pics that need to be fixed. Make a request thread for image fixing... I mean, this is the best image board online IMO and it's a shame that some of the best images are ruined by such problems, so I think that we should use this to this place's advantage. At least, you guys should. Whatever.
Well, for now, it is pretty much under testing. Plus, I don't have the mean to dissipate the monstrous amount of heat it dissipates if it is running 24/7. It rips 50A@110V of electricity at 85% load, it eats more than a small commercial oven.

It's pretty much for my testing and learing (aka, self pleasure)
DarkRoseofHell said:
Web server one is even more lawlsy than the one used in either koroshell or caffe.
If you are talking about your https://dl.dropboxusercontent.com/u/35156/test/tooikirameki_Page_01.jpg image, the webserver doesn't seem to support CMYK jpegs (inversed colors). The tanakamura & caffe versions also don't seem to support proper CMYK->RGB conversion either (over saturated), so you would really need to re-save it as a RGB image first in Photoshop before filtering: http://i.imgbox.com/PKA0iPCL.png

Even so, that image does show how waifu2x denoising is less than perfect and can still get confused when jpeg artifacts are intense enough. It does a decent job, but there is a lot of low-medium frequency residual which would need to be cleaned up in some other way afterwords: http://i.imgbox.com/90icit2D.png

Fooling around a bit, if you do 3-passes of waifu2x high denoising + some manual patching + history brush, you'll end up with something decent given the source: http://i.imgbox.com/0Wm8Rh6t.png

If you spent even more time on history brush you could probably make it look even better, but *effort*. Definitely not a one-stop-shop for general image denoising, but it does seem useful in certain cases.

DarkRoseofHell said:
Just going to note that CUDA isn't any actual routine or algorithm, it's a framework used for gpu accelerated processing.
I wasn't referring to the CUDA framework, but rather the CUDA kernel (i.e. the GPGPU code itself). I originally thought that since the waifu2x docs stated CUDA+Torch7 as a requirement, it could have been using a higher quality filtering routine on the GPU than the CPU for speed reasons or performing some kind of CPU+GPU hybrid processing, but that didn't end up being the case. In reality, Waifux2 was designed for byte identical output between GPU & CPU-only processing. Not always the case when dealing with GPGPU, but I'm happy it is.
Checkmate said:
Well, for now, it is pretty much under testing. Plus, I don't have the mean to dissipate the monstrous amount of heat it dissipates if it is running 24/7. It rips 50A@110V of electricity at 85% load, it eats more than a small commercial oven.

It's pretty much for my testing and learing (aka, self pleasure)
What cards and how is the setup done?
And are you talking about 50A on the computer side or the actual wall. The actual wall is 5500W, on the server side 50A on the 12V lane is only 600W. Most house circuitry only can handle at most 20A before the circuit breaker says "nope" and shuts off.

On the server side you could invest in a platinum / titanium platform at 1200W+ and it'd reduce heat output by a decent amount.
On the GPU/ASICs you're probably going to have to go with a custom loop. GPUs don't work unless they're given a load though, so unless someone is 24/7 sending in massive amount of images to process it shouldn't be that big of an issue.
WtfCakes said:
What if I announce it to him that I did? :3
I've got a voodoo doll with your name on it. Where are my hammer and nails?
Cyberbeing said:
If you are talking about your https://dl.dropboxusercontent.com/u/35156/test/tooikirameki_Page_01.jpg image, the webserver doesn't seem to support CMYK jpegs (inversed colors). The tanakamura & caffe versions also don't seem to support proper CMYK->RGB conversion either (over saturated), so you would really need to re-save it as a RGB image first before filtering: http://i.imgbox.com/PKA0iPCL.png

Even so, that image does show how waifu2x denoising is less than perfect and can still get confused when jpeg artifacts are intense enough. It does a decent job, but there is a lot of low-medium frequency residual which would need to be cleaned up in some other way afterwords: http://i.imgbox.com/90icit2D.png

Fooling around a bit, if you do 3-passes of waifu2x high denoising + some manual patching + history brush, you'll end up with something decent given the source: http://i.imgbox.com/0Wm8Rh6t.png
The color changes are what I meant, but yeah it does a decent job but the artifacts are rather absurdly over the top to begin with so I just did it for giggles.
It seems silly to begin fixing images that are already here. I think it is much more helpful to fix those images which are left out of the site because the quality is not good. There is a lot of beautiful images and I simply would like to fix them all and upload them (for example: doujin covers) but I just don't have that time.

Now with a tool like this everybody could do it. And that is great.
blooregardo said:
It seems silly to begin fixing images that are already here. I think it is much more helpful to fix those images which are left out of the site because the quality is not good. There is a lot of beautiful images and I simply would like to fix them all and upload them (for example: doujin covers) but I just don't have that time.
Or twitter stuff D:
Twitter's compression is evil.
DarkRoseofHell said:
What cards and how is the setup done?
And are you talking about 50A on the computer side or the actual wall. The actual wall is 5500W, on the server side 50A on the 12V lane is only 600W. Most house circuitry only can handle at most 20A before the circuit breaker says "nope" and shuts off.

On the server side you could invest in a platinum / titanium platform at 1200W+ and it'd reduce heat output by a decent amount.
On the GPU/ASICs you're probably going to have to go with a custom loop. GPUs don't work unless they're given a load though, so unless someone is 24/7 sending in massive amount of images to process it shouldn't be that big of an issue.
I'm talking about 50A at wall. Of course, I did this on my 2 x 30A breaker, my house is much different than all others house hahahaha. Also, this run on 4 x 1300W Gold EVGA PSU. Not quite platinum.

Anyhow, I don't plan to share it out yet.
Checkmate said:
I'm talking about 50A at wall. Of course, I did this on my 2 x 30A breaker, my house is much different than all others house hahahaha. Also, this run on 4 x 1300W Gold EVGA PSU. Not quite platinum.

Anyhow, I don't plan to share it out yet.
You gone for quite the overkill... all you need is a single videocard yeah http://waifu2x.booru.pics/

Putting that aside, I'm looking for a coder to make a API written in php. The lua web interface is complete garbage and crashes half the time. I'd be nice to have a button on booru's that people can click to upscale instantly, doesn't have to replace the main image.