RealBasicVSRSharpOptions
Options & Configuration · AiDotNet.Video.Options
Configuration options for RealBasicVSR-Sharp, the adversarial training stage of RealBasicVSR.
Inheritance: ModelOptions → NeuralNetworkOptions → RealBasicVSRSharpOptions
For Beginners
The “Sharp” variant trades mathematical accuracy for visual quality. While the base RealBasicVSR optimizes for pixel-perfect reconstruction (high PSNR), this variant uses perceptual and adversarial losses to produce results that look sharper and more natural to human eyes, even if individual pixels differ slightly.
How It Works
Defaults follow Chan et al., CVPR 2022, and the authors’ release (open-mmlab/mmagic, configs/real_basicvsr/realbasicvsr_c64b20-1x30x8_8xb1-lr5e-5-150k_reds.py): the RealBasicVSRNet of the first stage (64 channels, 20 propagation and 20 cleaning blocks), a spectrally normalized U-Net discriminator with 64 channels, L1 output and cleaning losses, a VGG19 perceptual loss and a vanilla GAN loss weighted 0.05, the output and perceptual losses against the unsharp-masked target, the generator trained with Adam (0.9, 0.99) at 5e-5 and the discriminator at 1e-4, SPyNet frozen, and a 0.999 moving average of the generator for inference.
Constructors
| Constructor | Summary |
|---|---|
RealBasicVSRSharpOptions() |
Initializes a new instance with default values. |
RealBasicVSRSharpOptions(RealBasicVSRSharpOptions other) |
Initializes a new instance by copying from another instance. |
Properties
| Property | Summary |
|---|---|
OnnxModelOptions OnnxOptions { get; set; } |
Gets or sets the ONNX runtime options. |
bool SharpenTarget { get; set; } |
Gets or sets whether the output and perceptual losses score the unsharp-masked target (true); the discriminator always sees the unsharpened target. |
double CleaningLossWeight { get; set; } |
Gets or sets the weight of the L1 loss of the cleaned frames against the 4x area-downsampled target (1.0). |
double DiscriminatorLearningRate { get; set; } |
Gets or sets the discriminator’s Adam learning rate (1e-4). |
double GANWeight { get; set; } |
Gets or sets the weight of the generator’s adversarial loss (0.05). |
double InferenceCleaningThreshold { get; set; } |
Gets or sets the mean absolute cleaning residue, in pixel levels 0-255, below which inference stops cleaning (5, the release’s test setting for this stage; training uses 255, i.e. |
double LearningRate { get; set; } |
Gets or sets the generator’s Adam learning rate (5e-5). |
double PerceptualWeight { get; set; } |
Gets or sets the weight of the VGG19 perceptual loss (1.0); zero omits the VGG19 from the model. |
double PixelLossWeight { get; set; } |
Gets or sets the weight of the L1 loss on the output (1.0). |
double UnsharpThreshold { get; set; } |
Gets or sets the unsharp-masking residue threshold in pixel levels (10). |
double UnsharpWeight { get; set; } |
Gets or sets the unsharp-masking weight (0.5). |
double? EmaMomentum { get; set; } |
Gets or sets the momentum of the generator’s moving average used for inference (0.001); null disables it and inference uses the trained weights. |
int DiscriminatorChannels { get; set; } |
Gets or sets the U-Net discriminator’s base channels (64). |
int MidChannels { get; set; } |
Gets or sets the generator’s feature channels (64). |
int NumCleaningBlocks { get; set; } |
Gets or sets the residual blocks of the cleaning module (20). |
int NumFrames { get; set; } |
Gets or sets the frames of a training clip (15). |
int NumPropagationBlocks { get; set; } |
Gets or sets the residual blocks per propagation branch (20). |
int UnsharpKernelSize { get; set; } |
Gets or sets the unsharp-masking Gaussian size (51). |
string ModelPath { get; set; } |
Gets or sets the path to the ONNX model file. |