Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th May 2015, 00:36   #1  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
waifu2x for AviSynth 2.6

Just found out someone ported waifu2x to AviSynth: https://github.com/sunnyone/Waifu2xAvisynth

Just spreading the news just in case someone is not already aware.
Reel.Deel is offline   Reply With Quote
Old 30th May 2015, 00:55   #2  |  Link
Sparktank
47.952fps@71.928Hz
 
Sparktank's Avatar
 
Join Date: Mar 2011
Posts: 940
Fascinating.

I saw the other thread and was hoping somoene might try to port it.
Thanks for the info.
__________________
Win10 (x64) build 19041
NVIDIA GeForce GTX 1060 3GB (GP106) 3071MB/GDDR5 | (r435_95-4)
NTSC | DVD: R1 | BD: A
AMD Ryzen 5 2600 @3.4GHz (6c/12th, I'm on AVX2 now!)
Sparktank is offline   Reply With Quote
Old 30th May 2015, 00:58   #3  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Laziness wins again! (I was going to attempt this.) There's a website, too: http://waifu2x-avisynth.sunnyone.org/

Translation of usage:
waifu2x(clip, int nr=0, int scale=2, string models=".", int jobs=0)

nr: 0, 1, or 2 for no/light/more noise reduction.
scale: A power of 2. 1 disables scaling (noise reduction only)
models: Location of models, defaults to plugin folder.
jobs: Threads, 0=# of cores in system.

Last edited by foxyshadis; 30th May 2015 at 01:03.
foxyshadis is offline   Reply With Quote
Old 30th May 2015, 01:19   #4  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
It seems not all of the parameters are in order, here's the correct order: waifu2x(clip, nr, scale, jobs, models)

Also only YV12, YV16, and YV24 are supported. I wonder why not Y8? Y8 is useful for processing RGB as individual planes. Sure one can use YV12 but it can be less efficient. I might ask the author if he can add support for it.

One question for those of you who can read code, I see that unlike the original that only scales up to 2x, this implementation can scale 4x, 6x, 8x...etc. How is that done? Is it done in one shot or is waifu2x called multiple times?
Reel.Deel is offline   Reply With Quote
Old 30th May 2015, 01:31   #5  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by Reel.Deel View Post
It seems not all of the parameters are in order, here's the correct order: waifu2x(clip, nr, scale, jobs, models)

Also only YV12, YV16, and YV24 are supported. I wonder why not Y8? Y8 is useful for processing RGB as individual planes. Sure one can use YV12 but it can be less efficient. I might ask the author if he can add support for it.

One question for those of you who can read code, I see that unlike the original that only scales up to 2x, this implementation can scale 4x, 6x, 8x...etc. How is that done? Is it done in one shot or is waifu2x called multiple times?
Good catch. It just runs the 2x filter multiple times, so 2, 4, 8, 16, etc. It could support 16-bit as well, the meat of the processing is done in (very unoptimized) 32-bit float.
foxyshadis is offline   Reply With Quote
Old 30th May 2015, 02:08   #6  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Thanks for the info foxyshadis. I overlooked that scale has be a power of 2 not a multiple of 2.

I wonder how well it will perform with video? A good point was brought up in #avs-plus.
Quote:
a lot of "smart" upscalers end up with awful shimmering due to not quite doing the same thing on each frame
Hopefully that's not the case here, otherwise it'll only be usable on single images for the time being.

(not at home so I haven't had a chance to try it out)
Reel.Deel is offline   Reply With Quote
Old 30th May 2015, 02:59   #7  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
Quote:
Originally Posted by Reel.Deel View Post
I wonder how well it will perform with video? A good point was brought up in #avs-plus.

Hopefully that's not the case here, otherwise it'll only be usable on single images for the time being.
From what I've seen it oil paintings realistic scenes. So it's likely only for still anime.
kuchikirukia is offline   Reply With Quote
Old 30th May 2015, 12:59   #8  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by kuchikirukia View Post
From what I've seen it oil paintings realistic scenes. So it's likely only for still anime.
It really only turns things into oil paintings when noise reduction is set to 2 (maybe even 1 for some sources) but that's not what I was referring to. waifu2x works well on single images but when you process video it might create shimmering artifacts due to interpolation differences between frames. Shimmering cannot be seen on a single frame but if you flip back between two frames sometimes you can seen lines and other details slightly jumping up and down (bobbing). Anyways I don't know if this is the case with waifu2x, I wanted to try and see but it's painfully slow (even slower than the online version) so I gave up.
Reel.Deel is offline   Reply With Quote
Old 30th May 2015, 13:16   #9  |  Link
SEt
Registered User
 
Join Date: Aug 2007
Posts: 374
My waifu can't have so strong halos! I think she needs some more training... Also she is quite hungry now – stand alone version ate my 12 GB of RAM like nothing and crashed on moderately sized image.

Noise reduction is nice though – does good job on re-compressed images, but can't cure quantized to zero chroma.
SEt is offline   Reply With Quote
Old 30th May 2015, 18:01   #10  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
This thing is absurdly slow. 50 seconds per frame for 480x270->960x540 on a Haswell! I wanted to redo an entire scene at 4x, but I didn't want to die of old age first.

4 second sample, shows no shimmering that I could see, so at least it's fairly stable.
foxyshadis is offline   Reply With Quote
Old 30th May 2015, 22:43   #11  |  Link
burfadel
Registered User
 
Join Date: Aug 2006
Posts: 2,229
Maybe someone could make a temporal version of NNEDI3. Interpolation based on forward and backward frame data, as well as top and bottom fields. Sure, it might not be as good as this, but it would have to be faster!
burfadel is offline   Reply With Quote
Old 31st May 2015, 18:28   #12  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
While doing some testing on waifu2x there was strong evidence that its neural network may be significantly overtrained for the purposes of digital video. There can be a change uf up to 1 db in psnr simply by switching between different downscaling algorithms, and it gets conflicting psnr results compared to all other upscalers I have compared with, it always prefers neutral bicubic downscaling.

In one test it prefered neutral bicubic to sharp bicubic by ~0.6 db, while all other scalers prefered sharp cubic downscaling to neutral. This would strongly indicate that it was trained almost exclusively on content scaled using a catmull-rom kernel. Unsurprisingly, it does produce very nice results when fed with input it has been trained for.

I will probably do some more rigorous testing on more varied content, but its speed makes testing it aggravating.
*.mp4 guy is offline   Reply With Quote
Old 1st June 2015, 10:11   #13  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by burfadel View Post
Maybe someone could make a temporal version of NNEDI3. Interpolation based on forward and backward frame data, as well as top and bottom fields. Sure, it might not be as good as this, but it would have to be faster!
Sometimes people forget that we already have a super-resolution filter for Avisynth and it's called QTGMC. Motion-compensated deinterlacing is really just a special case of super-resolution, after all.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!

Last edited by colours; 1st June 2015 at 10:14.
colours is offline   Reply With Quote
Old 3rd June 2015, 15:17   #14  |  Link
CkJ
Registered User
 
Join Date: Jul 2014
Posts: 26
*Original


*Nnedi3


*Waifu2x

Last edited by CkJ; 6th June 2015 at 05:39. Reason: change imagehost
CkJ is offline   Reply With Quote
Old 4th June 2015, 23:00   #15  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
@CkJ

How about using a little more safe for work image site the next time, did not expect female genitalia popping up in my face when clicking those links :P
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 5th June 2015, 03:28   #16  |  Link
CkJ
Registered User
 
Join Date: Jul 2014
Posts: 26
Quote:
Originally Posted by mastrboy View Post
@CkJ

How about using a little more safe for work image site the next time, did not expect female genitalia popping up in my face when clicking those links :P
sorry, I use adblock so don't see that popup
CkJ is offline   Reply With Quote
Old 6th June 2015, 00:04   #17  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Take care what you link, even if it gets blocked by adblock (protip - not everybody has it active). There is a fullscreen extremely not safe for work ad, consider actually putting a warning in the post, because that thing could really get somebody in trouble if they browsed that at work.

BTW, imagebam is a bad host for images for another reason: it doesn't have a reasonable "show just this image 1:1" mode, it forces you to download when you want to see the original.

Try imgbox - it shouldn't have nasty ads if you specify you are uploading family-safe content. And there are probably other less annoying imagehosts.

Last edited by mandarinka; 6th June 2015 at 00:08.
mandarinka is offline   Reply With Quote
Old 6th June 2015, 06:10   #18  |  Link
creaothceann
Registered User
 
Join Date: Jul 2010
Location: Germany
Posts: 357
e.g. imgur, which lets you link directly to the picture.
creaothceann is offline   Reply With Quote
Old 6th June 2015, 18:56   #19  |  Link
mandarinka
Registered User
 
mandarinka's Avatar
 
Join Date: Jan 2007
Posts: 729
Quote:
Originally Posted by creaothceann View Post
e.g. imgur, which lets you link directly to the picture.
Imgur converts your image to jpg if you upload a PNG that is too big (over 1 MB), so it isn't really suitable here.
mandarinka is offline   Reply With Quote
Old 6th June 2015, 19:09   #20  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by mandarinka View Post
Imgur converts your image to jpg if you upload a PNG that is too big (over 1 MB), so it isn't really suitable here.
Unless you have an account, in which case the threshold for automatic JPEG conversion is a few megabytes higher.
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline   Reply With Quote
Reply

Tags
waifu2x

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.