UFM<T>

Models & Types · AiDotNet.Video.Motion

UFM unified flow and matching demonstrating unified training beats specialized models.

Inheritance: NeuralNetworkBase<T> → VideoNeuralNetworkBase<T> → OpticalFlowBase<T> → UFM<T>

For Beginners

UFM (Unified Flow Matching) provides a unified framework for optical flow that handles both forward and backward flow estimation in a single model pass.

How It Works

References:

  • Paper: “UFM: Unified Flow and Matching” (2025)

UFM is the first to demonstrate that unified training for optical flow and feature matching outperforms specialized models on both tasks.

Example

// Create a UFM model for unified flow and matching
var ufm = new UFM<double>();
            
// Or configure with custom parameters
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.ThreeDimensional,
    taskType: NeuralNetworkTaskType.Regression,
    inputHeight: 256, inputWidth: 256, inputDepth: 3, outputSize: 2);
var model = new UFM<double>(architecture);

Constructors

Constructor Summary
UFM() Creates a new UFM model for native training and inference.
UFM(NeuralNetworkArchitecture<T> architecture, UFMOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> EstimateFlow(Tensor<T> frame0, Tensor<T> frame1)