LLaVAVideo<T>

Models & Types · AiDotNet.VisionLanguage.VideoLanguage

LLaVA-Video: synthetic dataset-trained video instruction model.

Inheritance: NeuralNetworkBase<T> → VisionLanguageModelBase<T> → LLaVAVideo<T>

Implements: IVideoLanguageModel<T>

For Beginners

LLaVA-Video is a video-language model trained with synthetic data for video instruction following. Default values follow the original paper settings.

How It Works

LLaVA-Video (ByteDance, 2024) is a video instruction-tuned model trained with synthetic video-text datasets. It uses GPT-4V-generated video descriptions as training data to build robust video understanding capabilities, handling video question answering, temporal reasoning, and video captioning with high-quality instruction following.

References:

  • Paper: “Video Instruction Tuning With Synthetic Data” (ByteDance, 2024)

Example

// Create a LLaVA-Video model for video instruction following
// trained with synthetic video-text datasets for robust understanding
var architecture = new NeuralNetworkArchitecture<double>(
    inputType: InputType.TwoDimensional,
    taskType: NeuralNetworkTaskType.ImageClassification,
    inputHeight: 224, inputWidth: 224, inputDepth: 3, outputSize: 512);
            
// ONNX inference mode with pre-trained model
var model = new LLaVAVideo<double>(architecture, "llavavideo.onnx");
            
// Training mode with native layers
var trainModel = new LLaVAVideo<double>(architecture, new LLaVAVideoOptions());

Constructors

Constructor Summary
LLaVAVideo(NeuralNetworkArchitecture<T> architecture, LLaVAVideoOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
LLaVAVideo(NeuralNetworkArchitecture<T> architecture, string modelPath, LLaVAVideoOptions options)

Properties

Property Summary
int DecoderEmbeddingDim { get; }
int EmbeddingDimension { get; }
int MaxFrames { get; }
int MaxGenerationLength { get; }
string LanguageModelName { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
Tensor<T> EncodeImage(Tensor<T> image)
Tensor<T> GenerateFromImage(Tensor<T> image, string prompt) Generates from a single image using LLaVA-Video’s instruction-tuned visual-text fusion.
Tensor<T> GenerateFromVideo(IReadOnlyList<Tensor<T>> frames, string prompt) Generates output from video frames using LLaVA-Video’s temporal token pooling with cross-frame attention weighting.