Selur's Little Message Board

Full Version: Weighted Resize ALL - not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Selur,

   I'm using Hybrid dev-version 2023.10.21.1, and I noted that Weighted Resize "Mode: ALL" using the resizer RealESRGAN is not working any more.
   Fortunately it is working if I use "Mode: SPLIT".
   I attached the 2 generated scripts, they are almost the same,  the only main difference is that the following command

Code:
    clip = core.std.Merge(clipa=clipSmoothed,clipb=clip,weight=0.5)

   is replaced by the following command in the "Split" version

Code:
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444PS, matrix_s="709", range_s="limited")
clipSmoothed = core.resize.Bicubic(clip=clipSmoothed, format=vs.YUV444PS, matrix_s="709", range_s="limited")
clip = core.std.Merge(clipa=clipSmoothed,clipb=clip,weight=[0.5,0.5,0.5])

   in effect the raised error is the following:  Merge: both clips must have the same constant format and dimensions, passed YUV420P16[1920x760] and RGBS[1920x760]

Dan
Seems like I broke and fixed that, since using my current dev, I get:

for 'mode=all':
Code:
# no resizing since resolution is already archived
from vsrealesrgan import realesrgan as RealESRGAN
# adjusting color space from YUV420P8 to RGBS for vsRealESRGAN
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# resizing using RealESRGAN
clip = RealESRGAN(clip=clip, device_index=0) # 2560x1408
# resizing 2560x1408 to 640x352
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=640, h=352, kernel="spline64", interlaced=False, interlacedd=False)
clipSmoothed = core.resize.Bicubic(clip=clipSmoothed, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
clip = core.std.Merge(clipa=clipSmoothed,clipb=clip,weight=0.5)
# Weighted resize - END
and for 'mode = split':
Code:
# no resizing since resolution is already archived
from vsrealesrgan import realesrgan as RealESRGAN
# adjusting color space from YUV420P8 to RGBS for vsRealESRGAN
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_s="limited")
# resizing using RealESRGAN
clip = RealESRGAN(clip=clip, device_index=0) # 2560x1408
# resizing 2560x1408 to 640x352
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=640, h=352, kernel="spline64", interlaced=False, interlacedd=False)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV444PS, matrix_s="470bg", range_s="limited")
clipSmoothed = core.resize.Bicubic(clip=clipSmoothed, format=vs.YUV444PS, range_s="limited")
clip = core.std.Merge(clipa=clipSmoothed,clipb=clip,weight=[0.5,0.5,0.5])
# Weighted resize - END
and both seem to work fine here.
=> send you a link for testing. (upload still running, will be finished in 5min)

Cu Selur
The last dev-version is working!

Thanks,
Dan