Selur's Little Message Board
[BUG] Weighted Resize ALL - not working - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: [BUG] Weighted Resize ALL - not working (/thread-3459.html)



Weighted Resize ALL - not working - Dan64 - 05.11.2023

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

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

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

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


RE: Weighted Resize ALL - not working - Selur - 05.11.2023

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

for 'mode=all':
# 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':
# 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


RE: Weighted Resize ALL - not working - Dan64 - 05.11.2023

The last dev-version is working!

Thanks,
Dan