AVID<T>

Models & Types · AiDotNet.Video.Inpainting

AVID diffusion-based video inpainting supporting arbitrary-length videos.

Inheritance: NeuralNetworkBase<T> → VideoNeuralNetworkBase<T> → VideoInpaintingBase<T> → AVID<T>

For Beginners

AVID (Adaptive Video Inpainting via Diffusion) fills in missing or damaged regions of video using diffusion models. It adaptively propagates content from neighboring frames and regions.

How It Works

References:

  • Paper: “AVID: Any-Length Video Inpainting with Diffusion Model” (Zhang et al., CVPR 2024)

AVID uses a diffusion U-Net with temporal attention to iteratively denoise masked video regions, processing long videos through an autoregressive temporal pipeline with overlapping windows that maintains temporal consistency across the full sequence.

Example

// Create an AVID model for diffusion-based video inpainting
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.ThreeDimensional,
    taskType: NeuralNetworkTaskType.Generative,
    inputHeight: 256, inputWidth: 256, inputDepth: 3);
var options = new AVIDOptions();
var avid = new AVID<double>(architecture, options);
            
// Or load a pre-trained ONNX model for inference
var avidOnnx = new AVID<double>(architecture, "avid_model.onnx");

Constructors

Constructor Summary
AVID(NeuralNetworkArchitecture<T> architecture, AVIDOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer) Creates an AVID model for native training and inference.
AVID(NeuralNetworkArchitecture<T> architecture, string modelPath, AVIDOptions options) Creates an AVID model for native training and inference.

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> ForwardForTraining(Tensor<T> input)
Tensor<T> Inpaint(Tensor<T> frames, Tensor<T> masks)