RealESRGANVideoOptions

Options & Configuration · AiDotNet.Video.Options

Configuration options for Real-ESRGAN applied to video, frame by frame.

Inheritance: ModelOptions → NeuralNetworkOptions → RealESRGANVideoOptions

For Beginners

Real-ESRGAN is one of the most popular practical upscaling tools. It is trained on images degraded the way real photos and videos are (blur, noise, resizing, compression), so it cleans those artifacts while it upscales. For video it simply upscales every frame.

How It Works

Defaults follow Wang et al. 2021 and the authors’ release (xinntao/Real-ESRGAN, RealESRGAN_x4plus, options/train_realesrgan_x4plus.yml, and inference_realesrgan_video.py, which upscales each frame independently): an RRDBNet generator with 64 features, 23 residual-in-residual dense blocks and growth 32 at x4, a spectrally normalized U-Net discriminator with 64 channels, an L1 loss, a VGG19 perceptual loss and a vanilla GAN loss weighted 0.1, the L1 and perceptual losses against the unsharp-masked target, both networks trained with Adam (0.9, 0.99) at 1e-4, and a 0.999 moving average of the generator for inference.

Constructors

Constructor Summary
RealESRGANVideoOptions() Initializes a new instance with default values.
RealESRGANVideoOptions(RealESRGANVideoOptions 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 L1 and perceptual losses score the unsharp-masked target (true, l1_gt_usm and percep_gt_usm); the discriminator always sees the unsharpened target.
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.1).
double LearningRate { get; set; } Gets or sets the generator’s Adam learning rate (1e-4).
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 (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, ema_decay 0.999); 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 GrowthChannels { get; set; } Gets or sets the dense blocks’ growth channels (32).
int NumFeatures { get; set; } Gets or sets the generator’s feature channels (64).
int NumRRDBBlocks { get; set; } Gets or sets the residual-in-residual dense blocks (23).
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.