fch1993
帖子: 213
注册时间: 2012-06-12 11:56

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

aslrj 写了:
mawen1250 写了:3. waifu2x-opt已经deprecated了,建议用Holy姐的w2xc,即便是纯CPU模式下也比waifu2x-opt快而且内存消耗少。
4. w2xc-r4用了API R3.3,所以需要VS R30及以上版本(现在R30是RC1)。
感谢mawen巨巨解答

我从doom9的帖子里找到了rc1版本和vs editor,换用waifu2x-w2xc r4版继续尝试

但在引入32bit的w2xc时提示 Python exception: Waifu2x: only constant format 32-bit float input supported
而引入64bit的w2xc时则提示 Failed to load c:/plugins/Win64/Waifu2x-w2xc.dll. GetLastError() returned 193.

我有注意到vs的rc1安装程序执行时安装的vs似乎只有32bit,所以64bit这个估计是不行的
于是从vs滤镜合集包 20151219 VS Plugins+Scripts Collection里抽取了r3 版本的32-bit w2xc测试,也是报相同错误
已经确认到是新加的那一行w2xc的处理语句的问题,查看了github上给出的用例
w2xc.Waifu2x(clip clip[, int noise=1, int scale=2, int block=512, bint photo=False, int processor=-1, int gpu=1, bint list_proc=False, bint log=False])
感觉可能是自己把用例的使用方法搞错了,希望mawen巨巨能指点一二
图片
image17.poco.cn/mypoco/myphoto/20160110/13/5657316420160110130337045.jpg
vsR30 RC1有64位啊。

你需要先安装64位的python 3.5.1。

VS是根据你安装的python的来确定安装的版本。
头像
mawen1250
核心会员
核心会员
帖子: 670
注册时间: 2011-07-24 20:33

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

64bit滤镜需要64bit VS需要64bit Python。
报错里已经说了,w2xc只支持32-bit float输入,需要先转换到每通道32-bit float的RGB(YUV也可以但不推荐,无论是速度还是质量都不如),最直接的是用:
core.resize.Bicubic(clip, format=vs.RGBS)
如果用我的mvsfunc可以是:
mvf.ToRGB(clip, depth=32)
头像
aslrj
帖子: 6
注册时间: 2015-06-22 9:13

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

fch1993 写了:vsR30 RC1有64位啊。

你需要先安装64位的python 3.5.1。

VS是根据你安装的python的来确定安装的版本。
原来是根据python的版本来判断的……感谢巨巨指点……TAT {:cat_5}
► 显示剧情透露 ————— 一坑未平,一坑又起。————
头像
aslrj
帖子: 6
注册时间: 2015-06-22 9:13

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

mawen1250 写了:64bit滤镜需要64bit VS需要64bit Python。
报错里已经说了,w2xc只支持32-bit float输入,需要先转换到每通道32-bit float的RGB(YUV也可以但不推荐,无论是速度还是质量都不如),最直接的是用:
core.resize.Bicubic(clip, format=vs.RGBS)
如果用我的mvsfunc可以是:
mvf.ToRGB(clip, depth=32)
虽然凭自己半吊子的英文勉强看懂是要32bit输入,可……
原来要先用这样的来转换……感谢mawen巨巨指点 {:cat_5}
► 显示剧情透露 ————— 一坑未平,一坑又起。————
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

照着楼上的代码抄了一遍在本机测试
import vapoursynth as vs
core = vs.get_core()
ret = core.ffms2.Source(source='F:/cut.mkv')
core.resize.Bicubic(ret, format=vs.RGBS)
ret = core.w2xc.Waifu2x(...)
core.resize.Bicubic(ret, format=vs.YUV)
ret.set_output()
VSEditor脚本测试崩溃,崩溃前界面上显示 Resize error 3074: unrecognized transfer characteristics
改跑一帧后显示Cannot output clips with varying dimensions
怀疑我写法有问题...

改用莴苣的插件后
......
ret = mvf.Depth(ret, depth=32)
ret = core.w2xc.Waifu2x(ret, noise=0, scale=2, block=128, photo=True, processor=1, gpu=0, list_proc=True, log=True)
ret = mvf.ToYUV(ret,depth=8)
ret.set_output()
没有报错,就是输出还是原来的分辨率,插件包里的插件都拷了
上次由 NAVras 在 2016-07-05 11:12,总共编辑 7 次。
头像
mawen1250
核心会员
核心会员
帖子: 670
注册时间: 2011-07-24 20:33

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

第一个脚本两个core.resize的输出都没有起到任何作用,然后这个Resize的报错可能和源的frame property有关,有可能是标记了Resize不支持的transfer characteristics,建议用text.FrameProps查看,有必要的话用std.SetFrameProp或mvf.SetColorSpace删除_Transfer这个property。

第二个脚本我不清楚什么问题,但起码你先给出最小重现问题的脚本,先加那么一大堆参数上去谁知道哪里会有问题?
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

感谢mawen巨巨的缩小范围的思路~终于把问题找出来了
----------------下面是之前的内容可以自动跳过了-------------------------------------------------
ret = mvf.Depth(ret, depth=32)
ret = core.w2xc.Waifu2x(ret, noise=0, scale=2, block=128, photo=True, processor=1, gpu=0, list_proc=True, log=True)
ret = mvf.ToYUV(ret,depth=8)
ret.set_output()
这个脚本不报错,但出来效果就和没中间waifu那截一样

换了一个源还是没能放大,另有人说photo要RGB32改为false仍然不行...
我想我会不会是哪里写错了
于是改了一下
ret=core.w2xc.Waifu2x(src)
waifu参数这样是默认,输出画面正确拉伸
----------------------------------------------------------------------------------
list_proc=True 时不作处理直接输出处理器信息 {:cat_18} 我火星了
菜鸟一个,1天从AVS飞到VS,犯的错误有点弱智 ,大大轻喷~
上次由 NAVras 在 2016-07-05 11:18,总共编辑 5 次。
fch1993
帖子: 213
注册时间: 2012-06-12 11:56

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

NAVras 写了:我的锅..之前以为崩溃时内存满了
import vapoursynth as vs
import mvsfunc as mvf
core = vs.get_core()

ret = core.ffms2.Source(source='F:/cut.mkv')

ret = mvf.Depth(ret, depth=32)
ret = core.w2xc.Waifu2x(ret, noise=0, scale=2, block=128, photo=True, processor=1, gpu=0, list_proc=True, log=True)
ret = mvf.ToYUV(ret,depth=8)#不加这行pipe无法输出给x264

ret.set_output()

这个脚本不报错,但出来效果就和没中间waifu那截一样

第一个脚本加上ret = 后空跑崩溃,pipe:Cannot output clips with varying dimensions

换了一个别人压的NTSC源逐行还是没能放大,另有人说photo要RGB32于是改为false仍然不行...
我想我会不会是插件拷少了..或者哪里写错了

于是改了一下
ret=core.w2xc.Waifu2x(src)
waifu参数这样为默认,预览脚本时显卡驱动崩了(我的显卡虽有CUDA但是性能很差根本带不动),waifu2x至少是运行了
所以...会不会是waifu括号里参数有问题?
是有问题。
, list_proc=True

这个去掉就显示正常了。
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

fch1993 写了:
NAVras 写了:我的锅..之前以为崩溃时内存满了
import vapoursynth as vs
import mvsfunc as mvf
core = vs.get_core()

ret = core.ffms2.Source(source='F:/cut.mkv')

ret = mvf.Depth(ret, depth=32)
ret = core.w2xc.Waifu2x(ret, noise=0, scale=2, block=128, photo=True, processor=1, gpu=0, list_proc=True, log=True)
ret = mvf.ToYUV(ret,depth=8)#不加这行pipe无法输出给x264

ret.set_output()

这个脚本不报错,但出来效果就和没中间waifu那截一样

第一个脚本加上ret = 后空跑崩溃,pipe:Cannot output clips with varying dimensions

换了一个别人压的NTSC源逐行还是没能放大,另有人说photo要RGB32于是改为false仍然不行...
我想我会不会是插件拷少了..或者哪里写错了

于是改了一下
ret=core.w2xc.Waifu2x(src)
waifu参数这样为默认,预览脚本时显卡驱动崩了(我的显卡虽有CUDA但是性能很差根本带不动),waifu2x至少是运行了
所以...会不会是waifu括号里参数有问题?
是有问题。
, list_proc=True

这个去掉就显示正常了。


非常感谢!我自己折腾半天发现真是我自己理解错了list_proc的用法
黑之月yang
帖子: 29
注册时间: 2012-10-02 22:44

Re: VapourSynth-waifu2x-opt r1 - 人妻2x图像放大/降噪滤镜

aslrj 写了:最近对waifu2x起了兴趣,试用过霓虹的基于Avisynth的waifu2xAvisynth,但180p→360p拉伸也只有0.06fps的感人速度。
看到mawen巨巨基于VapourSynth的滤镜,于是今天下载了VapourSynth进行试用。
环境测试通过,基本滤镜的sample空测试 vspipe c:\test.vpy NUL 也成功跑过一遍

但我在之后的步骤中遇到了问题
mawen巨巨在github里的用例写着一个降噪的示例 waifu2x.Denoise(clip input[, int mode=1, int matrix=6, bint full, int block_width=1280, int block_height=1280, int threads=1])

我在.vpy中使用 ret = core.waifu2x.Denoise(ret, mode=1, matrix=6, block_width=1280, block_height=1280, threads=0)
执行时直接报错退出,如图
图片
image17.poco.cn/mypoco/myphoto/20160110/00/5657316420160110001649010.jpg

不知道是不是我错误地解读了mawen巨巨的用例……

顺便现在也是使用AE输出PNG图片序列之后,调用批处理的caffe-cui逐张处理再合并为视频流……总觉得莫名……额, >_<
————
刚才又尝试了一下w2xc.Waifu2x这个滤镜
直接提示 Python exception: Core only supports API R3.2 but the loaded plugin requires API R3.3; Filename: c:/plugins/Waifu2x-w2xc.dll; Name: Image Super-Resolution using Deep Convolutional Neural Networks

结果看了一下py是3.5.1 ,VapourSynth是r29……貌似都是最新的……


您好
我是vs初学者
查了一堆资料
终于做好的准备工作
可写脚本的时候出了很多问题
参照您写的脚本
还是有问题
提示也看不懂~~
可以指教下吗?
问题如下图
图片

回到 “VapourSynth”