Vapoursynth BasicVSR++ Resize

From wiki.selur.net
Revision as of 09:03, 15 November 2026 by Selur (talk | contribs) (New filter page (via create-page on MediaWiki MCP Server))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

BasicVSR++ is a recurrent video super-resolution network that uses neighbor frames to rebuild detail and always upscales by 4. It is one of the resizers of Vapoursynth Resizer and runs on an NVIDIA GPU through PyTorch.

Filtering → Vapoursynth → Frame → Resize

BasicVSR++ controls in Hybrid
BasicVSR++ controls in Hybrid

What it does

Frames are processed in sequences of Length frames; information is carried forward and backward through each sequence and aligned with optical flow. Because it is temporal, the result of a frame depends on its neighbors. Hybrid resizes the 4× result to the exact output size afterwards.

Requirements

  • Windows, Hybrid's torch add-on and an NVIDIA GPU with CUDA.

Settings

Control Parameter Range / values Hybrid default Meaning
Model model REDS, Vimeo-90K (BI), Vimeo-90K (BD), NTIRE 2021 Vimeo-90K (BI) Training set: BI = bicubic downscaling, BD = blur and downscaling; NTIRE 2021 is the large challenge model. All 4×.
Length length 1 – 1000 15 Frames per processed sequence.
Device device_index 0 – 4 0 CUDA device.
Tile (x/y) tile 0 – 8192 0 / 0 Splits the frame into tiles to save GPU memory; 0 = no tiling.
Tile pad tile_pad 0 – 64 16 Overlap of the tiles; only with tiling.
FP16 – on/off off Half precision (16-bit float clip); faster and needs less memory.
CPU Cache cpu_cache on/off off Keeps intermediate features in system RAM; saves GPU memory, slower.
Resizer – point, rect, linear, cubic, lanczos, blackman, blackmanminlobe, spline36, spline64, spline144, spline, gauss, sinc spline64 Kernel that brings the 4× result to the exact output size.

Example

Default settings on a 10-bit YUV 4:2:0 source (640x356), resized to 1280x712:

clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsBasicVSRPP) - 640x360
# adjusting color space from YUV420P10 to RGBS for vsBasicVSRPP
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s="470bg", range_in_s="limited", range_s="full")
# resizing using BasicVSRPP
from vsbasicvsrpp import basicvsrpp as BasicVSRPP
clip = BasicVSRPP(clip, model=1) # 2560x1440
clip = core.std.Crop(clip=clip, left=0, right=0, top=8, bottom=8) # removing added borders from mod requirement (vsBasicVSRPP) -  2560x1424
# resizing 2560x1424 to 1280x712
clip = core.fmtc.resample(clip, w=1280, h=712, kernel="spline64", interlaced=False, interlacedd=False)

How Hybrid calls it

  • Selected with Resize enabled and Resizer set to BasicVSR++ (see Vapoursynth Resizer).
  • The clip is converted to 32-bit float RGB (16-bit float with FP16) and padded to mod 8; the padding is cropped afterwards.
  • The output is always 4× the input. If that differs from the target, fmtconv resizes it with the Resizer kernel to the exact size. With separately filtered fields the target height is halved.
  • The model is always written; length, device, tiles and tile pad only when they differ from the defaults.
  • The restoration models of the plugin are in the separate BasicVSR++ filter.

Background

BasicVSR++

BasicVSR++ (Chan et al., CVPR 2022) improves BasicVSR with second-order grid propagation and flow-guided deformable alignment. It won tracks of the NTIRE 2021 video super-resolution and compressed video enhancement challenges.

vs-basicvsrpp

HolyWu's vs-basicvsrpp runs BasicVSR++ in VapourSynth with PyTorch. It accepts 16- or 32-bit float RGB; besides the four super-resolution models it has models for restoration tasks.

Sources