28.10.2024, 22:34
(28.10.2024, 16:52)Selur Wrote: [ -> ]Uploaded a new dev version which should with both VSGAN and VSMLRT:Thank you, buti am confused, so i would like option c correct. But why resize again at the end, can i just leave it where the second model left off. I dont wanna use resize for a third time for no reason. Unless i am miss understanding this.
a. when 'Multi' and 'no adjust' are disabled: apply one model, adjust the resolution to the set resize resolution with the selected (adjustment) resizer.
b. when 'Multi' is enabled and 'no adjust' is disabled: apply all the models and between the models undo the resizing with the selected (adjustment) resizer.
After the last model, the resolution is adjusted to the set resize resolution with the selected (adjustment) resizer.
c. when 'Multi' and 'no adjust' are enabled: apply all the models and only after the last adjust the resolution to the set resize resolution with the selected (adjustment) resizer.
This should allow doing what you wanted to achieve. (assuming I didn't make a mistake)
Cu Selur
1. input Video 852x489
1. Apply model which does double the size 1704x960
2. Apply another model which doubles the size. 3408x1920
3. Video is done final size 3408x1920
Edit just tested it this doesnt seem right where did it get 6848x3840 resolution from lol also 852 multiplied by 2 is 1704 not 1712, it says the input is 856x480 but it is 852x480 , Both models are x2 and also at the end is resizing again which defeats the whole purpose again.
Code:
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
clip = core.std.AddBorders(clip=clip, left=2, right=2, top=0, bottom=0) # add borders to archive mod 8 (vsVSMLRT) - 856x480
# changing range from limited to full range for vsVSMLRT
clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full")
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_FULL)
# adjusting color space from YUV420P10 to RGBH for vsVSMLRT
clip = core.resize.Bicubic(clip=clip, format=vs.RGBH, matrix_in_s="709", range_s="full")
# resizing using VSMLRT, target: 3408x1920
from vsmlrt import Backend
clip = vsmlrt.inference([clip],network_path="I:/AI_Upscale/Tools/Hybrid/64bit/onnx_models/2x_Ani4Kv2_G6i2_Compact_107500_FP16.onnx", backend=Backend.TRT(fp16=True,device_id=0,num_streams=1,verbose=True,use_cuda_graph=False,workspace=1073741824,builder_optimization_level=3,engine_folder="I:/AI_Upscale/.Upscale Projects/Engines")) # 1712x960
clip = vsmlrt.inference([clip],network_path="I:/AI_Upscale/Tools/Hybrid/64bit/onnx_models/cugan_pro-denoise3x-up2x_op18_fp16_clamp_colorfix.onnx", backend=Backend.TRT(fp16=True,device_id=0,num_streams=1,verbose=True,use_cuda_graph=False,workspace=1073741824,builder_optimization_level=3,engine_folder="I:/AI_Upscale/.Upscale Projects/Engines")) # 6848x3840
clip = core.std.Crop(clip=clip, left=8, right=8, top=0, bottom=0) # removing borders (vsVSMLRT) - 6832x3840
# resizing 6832x3840 to resize resolution 3408x1920
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="full")
clip = core.fmtc.resample(clip=clip, w=3408, h=1920, kernel="spline64", interlaced=False, interlacedd=False)
# changing range from full to limited range for vsVSMLRT
clip = core.resize.Bicubic(clip, range_in_s="full", range_s="limited")
# adjusting output color from: RGBS to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709", range_s="limited", dither_type="error_diffusion")
# set output frame rate to 29.97fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# output
clip.set_output()
This part should not be there it should stop before this with the resizing stuff:
Code:
# resizing 6832x3840 to resize resolution 3408x1920
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, range_s="full")
clip = core.fmtc.resample(clip=clip, w=3408, h=1920, kernel="spline64", interlaced=False, interlacedd=False)
Input is also 852x480 but here its read like 48x48
Edit 2, ReEditing the Resize tab refreshed the 48x48, There seems to be a bug where upon source load it doesnt show proper size in Vaporsynth>Resize tab, instead you have to go back to Crop/Resize, change the resize value once in order to trigger the proper resolution and not 48x48. Might be just visual bug tho.
Should just give option to disable this completly and let the models do its thing. Currently it disables upscale as well, its weird why we mixing upscale and resize imo in the first place. What the models upscale is what we should get. IF we want to resize at the end to get a final resolution sure have it as an option but i dont think it should be forced.