edit:某天撞见的,不保证内容正确性
import vapoursynth as vs
import sys
import h**sfunc 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.l**as.LWLib**Source(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=2,scale=4,block=512,cudnn=True)
## w2x = core.caffe.Waifu2x(src16,noise=1,scale=2,block=320,GPU=1)
w2x = core.caffe.Waifu2x(src16,noise=2,scale=4,block=512,cudnn=True)
## w2x = core.caffe.Waifu2x(src16,noise=1,scale=2,block=320,GPU=1)
w2x = mvf.ToYUV(w2x,full=False,matrix=1,depth=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)
ms** = core.generic.Maximum(clip=mask,planes=0)
ms** = core.generic.Maximum(clip=mask,planes=0)
mask = core.generic.Minimum(clip=mask,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)
res.set_output()
vspipe.exe--y4m Waifu.vpy - | x264_64--demuxer y4m--preset slower--output"res.mkv"