Alexkral / AviSynthAiUpscale

An AviSynth+ implementation of some Super-Resolution Convolutional Neural Networks.
GNU General Public License v3.0
130 stars 2 forks source link

Sharing vapoursynth test scripts? #5

Closed GoodManWEN closed 3 years ago

GoodManWEN commented 3 years ago

First I'd like to thanks for your very good work.

I was surprised at the speed of vapoursynth tests you showed and want to perform the test myself, however as a fresher to mpv and vs-placebo I got some import error at the very beginning, due to vapoursynth's weak error indication system I can't clearly identify where the error occurs. So I would like to ask you if you can share your test script.

As a side note my vs script and error message is as follows:

import vapoursynth as vs
core = vs.core

clip = core.lsmas.LWLibavSource(r'test.hevc')
# format: YUV444P16, width = 1920px height= 1080px
clip = core.placebo.Shader(clip, width=clip.width*2, height=clip.height*2, 
shader=r'‪absolute\path\to\AiUpscale_Fast_2x_LineArt.glsl')
clip.set_output()

error message:

2021-05-30 00:47:35.143
Failed to evaluate the script:
Python exception: placebo.Shader: Failed reading shader file!

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2244, in vapoursynth.vpy_evaluateScript
File "C:\Documents\Compress\test.vpy", line 7, in 
clip = core.placebo.Shader(clip, width=clip.width*2, height=clip.height*2,
File "src\cython\vapoursynth.pyx", line 2069, in vapoursynth.Function.__call__
vapoursynth.Error: placebo.Shader: Failed reading shader file!

Platform: latest vs-placebo/aiupscale release at May 30th, python3.8 on windows10. thanks!

Alexkral commented 3 years ago

I'm also quite new to vs myself so I can't help you with the error. Anyway the results are for a 960x540 clip. This is the script I used for vs-placebo:

import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path = r"E:\Test\plugins\ffms2.dll")
core.std.LoadPlugin(path = r"E:\Test\plugins\libvs_placebo.dll")
clip = core.ffms2.Source(r"E:\Test\clips\540.mp4")
clipYUV = core.resize.Bicubic(clip, format = vs.YUV444P16)
clipYUV = core.placebo.Shader(clipYUV, shader = r"E:\Test\shaders\AiUpscale_Fast_2x_LineArt.glsl", width = clip.width * 2, height = clip.height * 2)
res = core.resize.Bicubic(clipYUV, format = vs.YUV420P8, dither_type = "none")
res.set_output()

Then, to process 1000 frames:

vspipe -e 999 -p Placebo.vpy .

GoodManWEN commented 3 years ago

It doesn't seem to have a big difference between our codes. Anyway thanks for sharing. : )