File "E:\VideoTest\Deoldify\tempPreviewVapoursynthFile17_09_44_253.vpy", line 54, in
clip = ddcolor(clip=clip, model=0)
My guess it that your are running out of VRAM while throwing feeding ddcolor with 2400x1632 content.
Otherwis the script:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import ctypes
import os
import site
core = vs.core
# Adding torch dependencies to PATH
path = site.getsitepackages()[0]+'/torch_dependencies/bin/'
ctypes.windll.kernel32.SetDllDirectoryW(path)
path = path.replace('\\', '/')
os.environ["PATH"] = path + os.pathsep + os.environ["PATH"]
# Loading Plugins
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="D:/Programs/Hybrid/64bit/vsfilters/Support/libimwri.dll")
# source: 'E:/VideoTest/Deoldify/TestBW0.jpg'
# current color space: YUV420P8, bit depth: 8, resolution: 800x544, fps: 25, scanorder: progressive, yuv luminance scale: full, matrix: 709
# Loading E:\VideoTest\Deoldify\TestBW0.jpg using vsImageReader
clip = core.imwri.Read(["E:/VideoTest/Deoldify/TestBW0.jpg"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24
frame = clip.get_frame(0)
# Setting color transfer (170), if it is not set.
if '_Transfer' not in frame.props or not frame.props['_Transfer']:
clip = core.std.SetFrameProps(clip, _Transfer=6)
# Setting color primaries info (to 470), if it is not set.
if '_Primaries' not in frame.props or not frame.props['_Primaries']:
clip = core.std.SetFrameProps(clip, _Primaries=5)
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
clip = core.std.SetFrameProp(clip=clip, prop="_FieldBased", intval=0) # progressive
# Blind Face Restoration using CodeFormer
# Using background resizer FeMaSR(2x)
clipBG = clip
from vsfemasr import femasr as FeMaSR
# adjusting color space from RGB24 to RGBH for vsFeMaSR
clipBG = core.resize.Bicubic(clip=clipBG, format=vs.RGBH, range_s="full")
# Step 1: current: 800x544, target: 1600x1088
# resizing using FeMaSR
clipBG = FeMaSR(clip=clipBG, device_index=0, num_streams=3) # 1600x1088
# resizing 1600x1088 to 1600x1088
# adjusting resizing
clipBG = core.resize.Bicubic(clip=clipBG, format=vs.RGBS, range_s="full")
clipBG = core.fmtc.resample(clip=clipBG, w=1600, h=1088, kernel="spline64", interlaced=False, interlacedd=False)
clipBG = core.resize.Bicubic(clip=clipBG, format=vs.RGB24, range_s="full", dither_type="error_diffusion")
from vscodeformer import codeformer as CodeFormer
clip = CodeFormer(clip=clip, upscale=2, weight=0.000, num_streams=3, bg_clip=clipBG) # 1600x1088
# Resizing using fmtconv - spline36
clip = core.fmtc.resample(clip=clip, kernel="spline36", w=2400, h=1632, interlaced=False, interlacedd=False) # resolution 2400x1632 before RGB24 after RGB48
# adjusting color space from RGB48 to RGBH for vsDDColor
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, range_s="full")
# adding colors using DDColor
from vsddcolor import ddcolor
clip = ddcolor(clip=clip, model=0)
# adjusting output color from: RGBH to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="full", dither_type="error_diffusion")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Output
clip.set_output()
CodeFormer+FeMaSR + ddcolor works here, untill I use a too high resolution.
I leave the options as they are for the time being, since as it is now it works and lowering the ComboBox option count and at the same time having to add an additional CheckBox and model entry doesn't really simplify things.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.