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. |
20th July 2020, 13:39 | #1 | Link |
Registered User
Join Date: Oct 2018
Posts: 335
|
Avisynth AiUpscale v1.2.0
This is a script to test some Super-resolution convolutional neural networks implemented as hlsl pixel shaders, through Avisynth Shader.
Download Github repository with explanation on its usage: https://github.com/Alexkral/AviSynthAiUpscale I became interested in this after reading some posts in which it was assumed that implementing the FSRCNNX shaders using AviSynth Shader was not possible, because they were written in GLSL. After all, GLSL and HLSL are not that different, and the mpv hook format doesn't change this. So I was able to do it without too much trouble, also with the other FSRCNN shaders by igv and haasn. That is what I thought to share at the time, but since igv provides the code not only to train the networks, but also to convert the weights into mpv hooks, I became interested in training different models. This also I think has worked very well (quite boring I must say, except for the part related to experimentation), and I could have shared the result but, how not, I became interested in adding other kinds of networks, which also allowed me to do other kinds of experiments. Finally, I realized that using a specific dataset for training allowed to obtain better results for specific content, which made me repeat the entire training process for the "Illustration" models. So it's been a while since I started with this, every single part has needed to be redone multiple times, lots of training and retraining, having to deal with things that I didn't even know existed, such as the chroma positioning when resizing or some AviSynth Shader specific problems, so I can't be happier to have finished it at last. Special thanks to MysteryX, igv and Shiandow for writing such amazing code without which this couldn't be possible. Here are some results on performance tested with AVSMeter for a YV12 clip with default settings (chroma upscaled with Lanczos). GPU is a Nvidia GTX 1080: Code:
1080p -> 2160p AiUpscale Fast = 38.47 fps AiUpscale Medium = 25.30 fps AiUpscale HQ = 17.16 fps Last edited by Alexkral; 28th March 2021 at 03:13. Reason: update |
20th July 2020, 15:12 | #2 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
thanks!
I did try it and it work with server that don't has gpu, is this ok? but anyway it a good thing edit: FFT3DGPU also work! seems directx things can work with cpu only
__________________
See My Avisynth Stuff Last edited by real.finder; 20th July 2020 at 15:17. |
22nd July 2020, 02:02 | #3 | Link |
Registered User
Join Date: Feb 2012
Posts: 82
|
Your AiUpscale looks very interesting, so I'm interested to test it against other upscaling options.
You mention that it is able to adjust the target width and height. The 4x Upscaling looks good. If that is the case could you please provide a sample script that upscales from 720x576SD to 1920x1080HD and HD to UHD. |
22nd July 2020, 02:44 | #4 | Link | |
Registered User
Join Date: Oct 2018
Posts: 335
|
Quote:
Code:
AiUpscale (clip, Luma = "VDSR", Width = 1920, Height = 1080) For HD to UHD it is the same. |
|
22nd July 2020, 05:07 | #5 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,435
|
Thanks for this. I'm having problems getting it working
Shader: Failed to open pixel shader Shaders\Photo\Medium\2x\feature_1.cso AiUpscale.avsi, line 393 line 217 line 218 line 239 I think it's some path related issue. Win8 AiUpscale.avsi and Shaders folder are in the avisynth+ plugins directory. AviSynthShader works ok for me separately . (The .avsi says "AviSinth+ plugins folder", but I'm assuming it's obviously a typo, the github page says "AviSynth+ plugins directory", but maybe you can edit it for the next release) Does mpv need to be installed ? I installed it anyways but still same error; I normally use a "portable" version, but I might uninstall if you technically don't need it. I have mpv.conf in AppData\Roaming\mpv and edited some entries . profile = gpu-hq glsl-shader = "<PATH TO HOOK>" Where the actual path of mpv.hooks is located; and I tried different things such as specifying the directory above (container mpv.hooks folder), and "/" vs. "" slashes , I tried escaping colon, tried ' instead of " , I tried specifying specific .glsl files in the mpv.hooks directory Last edited by poisondeathray; 22nd July 2020 at 05:14. |
22nd July 2020, 06:19 | #6 | Link |
Registered User
Join Date: Oct 2018
Posts: 335
|
That's weird, the path seems correct.
AiUpscale.avsi and the Shaders folder should be in the same folder as AviSynth Shader, on my PC that is the AviSynth+\plugins64+ folder. I have only tested it on Win7 and Win10 x64, but I don't see any reason why it won't work with x86. Other than that you could try opening VirtualDub2 with administrator privileges to see if that makes any difference, and then open the script. mpv is only needed to use the hooks, if you extract them in the same folder as mpv.conf, you would have to edit it for example like this: profile = gpu-hq glsl-shader = "~~/AiUpscale_Fast_2x_Photo.glsl" Last edited by Alexkral; 22nd July 2020 at 06:25. |
22nd July 2020, 17:20 | #7 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
I think the script need to use ScriptDir() http://avisynth.nl/index.php/Interna...ions#ScriptDir
__________________
See My Avisynth Stuff |
22nd July 2020, 19:33 | #8 | Link | |||
Registered User
Join Date: Sep 2007
Posts: 5,435
|
Quote:
My plugins are in a custom directory location, not default (registry entries are ok , everything else works, other scripts/plugins). Could that be related? Quote:
Quote:
I tried moving them and this configuration too, same error |
|||
22nd July 2020, 21:16 | #9 | Link |
Registered User
Join Date: Oct 2018
Posts: 335
|
Just to be clear, the mpv hooks are not required at all for AviSynth AiUpscale to work, and the path in mpv.conf is also not used. They are included only to be used with mpv.
Please change line 109 in AiUpscale.avsi to this and report if this fixes the problem: Code:
Global Path = ".\Shaders\" |
22nd July 2020, 23:31 | #10 | Link | ||
Registered User
Join Date: Sep 2007
Posts: 5,435
|
Quote:
Quote:
Shader: Failed to open pixel shader .\Shaders\Photo\Medium\2x\feature_1.cso (rest of message is the same) |
||
23rd July 2020, 00:44 | #11 | Link |
Registered User
Join Date: Oct 2018
Posts: 335
|
Sorry but I can't figure out how to fix this since AviSynth doesn't provide anything to find out the path to the plugins directory. It should work if you specify the full path to the Shaders folder (ended with a backslash and in quotes) on line 109, but obviously that's not going to help others with the same problem.
|
23rd July 2020, 00:52 | #12 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,435
|
Quote:
Global Path = "<full path...\Shaders\>" I don't understand why either, because I'm pretty sure other working scripts use that variable method too. Thanks again |
|
23rd July 2020, 03:36 | #13 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
Quote:
__________________
See My Avisynth Stuff |
|
23rd July 2020, 04:26 | #14 | Link | |
Registered User
Join Date: Oct 2018
Posts: 335
|
Quote:
|
|
23rd July 2020, 06:01 | #15 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
you sure? it's work fine here from the avsi
__________________
See My Avisynth Stuff |
23rd July 2020, 06:03 | #16 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
poisondeathray, can you try it? https://github.com/realfinder/AviSyn...AiUpscale.avsi
__________________
See My Avisynth Stuff |
23rd July 2020, 06:25 | #17 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,435
|
Quote:
Shader: Failed to open pixel shader F:\test\Shaders\Photo\Medium\2x\feature_1.cso If I copy/paste Shaders folder to that F:\test folder, it works |
|
23rd July 2020, 06:32 | #18 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,589
|
Quote:
anyway make an avsi named AviSynthPluginsDir.avsi and put this in it Code:
global AviSynthPluginsDir = VersionNumber() < 2.60 ? RT_GetWorkingDir() : ScriptDir() and replace ScriptDir() with AviSynthPluginsDir in AiUpscale.avsi
__________________
See My Avisynth Stuff Last edited by real.finder; 23rd July 2020 at 06:38. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|