NAVras
帖子: 141
注册时间: 2016-04-24 1:32

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

aslrj 写了: 图片
看说明不知是不是缺少了.lib文件,megui在整合ffms2时把lib文件删掉了(到github上面下一个新的ffms2)
还有向后翻一下,mawen大大已经说改用w2xc(或后来又出的caffe),层主的脚本是针对opt版的
我现在用的脚本是这样的 {:cat_11} 贴出来哪个大大暼一眼说不定还能发现有错,转换感觉还是mawen大大的插件好用一点
import vapoursynth as vs
import mvsfunc as mvf
c = vs.get_core()
ret = c.ffms2.Source(source='F:/cut.mkv')
ret = mvf.ToRGB(ret, depth=32)
ret = c.caffe.Waifu2x(ret, noise=3, scale=2, photo=False, cudnn=True, taa=False)
ret = c.resize.Lanczos(ret, 1440, 1080)
ret = mvf.ToYUV(ret, full=True, css="444", depth=10)
ret.set_output()
就是有一个问题我自己不太清楚,加上了full=True后颜色变得很鲜艳(有点深)
原图、false、true对比
图片
上次由 NAVras 在 2016-07-05 11:32,总共编辑 2 次。
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

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

mawen1250 写了:mvf.ToYUV(full=True)表示转换为full range的YUV输出,而一般YUV默认都是limited range,如果后续按limited range做转换、显示,颜色就错了。
在ToRGB也加了一个full=True后颜色变回正常了,这样可以嘛 {:cat_11}
上次由 NAVras 在 2016-07-05 11:23,总共编辑 1 次。
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

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

喔,对哦...没考虑waifu2x的部分~
我将full都改成false,我自己的那一小段输出颜色看起来是正常的了,,但看贴吧讨论说仍有黑色溢出原来贴吧黑色溢出是源本身问题
--------------------
最后回到了第一次写的样子 {:cat_11} 其他的参数都简化掉了让脚本自动判断,还是蛮准的
ret = mvf.ToRGB(ret, depth=32)
ret = mvf.ToYUV(ret, depth=10, css="444")
上次由 NAVras 在 2016-07-05 11:27,总共编辑 1 次。
ACG
帖子: 11
注册时间: 2016-06-28 14:49

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

有哪位好心的大神愿意帮帮我?我在用VS处理视频时显示无法载入:Failed to initialize VapourSynth
NAVras
帖子: 141
注册时间: 2016-04-24 1:32

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

ACG 写了:有哪位好心的大神愿意帮帮我?我在用VS处理视频时显示无法载入:Failed to initialize VapourSynth
安装完vs测试了嘛?
“確認vapoursynth安裝,運行python,然後一行一行的輸入,注意大小寫,成功的話會顯示vapoursynth版本號”
import vapoursynth as vs
core = vs.get_core()
print(core.version())
上次由 NAVras 在 2016-07-05 11:33,总共编辑 2 次。
ACG
帖子: 11
注册时间: 2016-06-28 14:49

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

哦哦,我又重新安装的,打开视频文件是没有问题了,不过现在又出了一个新问题:
-----------------------------------------------------------------------------------------------------------------
import vapoursynth as vs
import sys
import havsfunc as haf
import mvsfunc as mvf
import nnedi3_resample as nnrs
import vsTAAmbk as taa
import CSMOD as cs


core = vs.get_core(accept_lowercase=True,threads=4)

core.max_cache_size = 8000

a="0001.mp4"
src8 = core.lsmas.LWLibavSource(a,threads=4,repeat=True)
dering = haf.HQDeringmod(src8,nrmode=2,sharp=1,mrad=5)
src16 = mvf.ToRGB(dering,depth=32,full=False,matrix=6)
w2x = core.caffe.Waifu2X(src16,noise=1,scale=2,block=320,cudnn=True)
# w2x = core.caffe.Waifu2X(src16,noise=1,scale=2,block=320,GPU=1)
w2x = mvf.ToYUV(w2x,full=False,matrix=1,depyh=16)
w2x = core.fmtc.resample(w2x,1720,960,css="420")


dbmask = core.tcanny.TCanny(w2x,sigma=1.5,t_h=8,planes=0,op=2)
dbmask = core.generic.Maximum(dbmask,planes=0)
dbmask = core.generic.Maximum(dbmask,planes=0)
dbed = core.f3kdb.Deband(w2x,range=10,y=42,cb=42,cr=42,output_depth=16)
res = core.std.MaskedMerge(clipa=dbed,clipb=w2x,mask=dbmask,planes=[0,1,2],first_plane=True)


bright = mvf.Depth(res,8,dither=1)
dark = mvf.Depth(res,8,dither=0,ampo=1.5)
res = core.std.MaskedMerge(dark,bright,core.generic.Binarize(bright,96,planes=0),first_plane=True)

mask = core.tcanny.TCanny(clip=res,sigma=2.0,t_h=12,mode=0)
msak = core.generic.Maximum(clip=mask,planes=0)
msak = core.generic.Maximum(clip=mask,planes=0)
mask = core.generic.Minimum(clip=mask,planes=0)
-----------------------------------------------------------------------------------------------------------------
F5运行后显示"caffe"这个名字是没有属性的存在,而我 Waifu2X-caffe.dll 这个插件明明在呀····
ACG
帖子: 11
注册时间: 2016-06-28 14:49

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

报错显示:
————————————————————————————————————————————————————————

Failed to evaluate the script:
Python exception: No attribute with the name caffe exists. Did you mistype a plugin namespace?
Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 1491, in vapoursynth.vpy_evaluateScript (src\cython\vapoursynth.c:26897)
File "C:\Program Files\VapourSynth64-Portable-R32\Waifu2X-CUDA.vpy", line 18, in <module>
w2x = core.caffe.Waifu2X(src16,noise=1,scale=2,block=320,cudnn=True)
File "src\cython\vapoursynth.pyx", line 1105, in vapoursynth.Core.__getattr__ (src\cython\vapoursynth.c:20791)
AttributeError: No attribute with the name caffe exists. Did you mistype a plugin namespace?
————————————————————————————————————————————————————————
fch1993
帖子: 213
注册时间: 2012-06-12 11:56

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

报错告诉你没有找到caffee。
你确定滤镜加载了?

回到 “VapourSynth”