PLLaVA<T>

Models & Types · AiDotNet.VisionLanguage.VideoLanguage

PLLaVA: parameter-free pooling extension from images to video.

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

Implements: IVideoLanguageModel<T>

For Beginners

PLLaVA is a video-language model that extends image LLMs to video using parameter-free pooling. Default values follow the original paper settings.

How It Works

PLLaVA (HKU, 2024) extends image-based LLaVA models to video through parameter-free pooling operations. Without adding any learnable parameters, it aggregates frame-level visual tokens using average pooling along the temporal dimension, providing a simple yet effective baseline for video dense captioning and video question answering.

References:

  • Paper: “PLLaVA: Parameter-free LLaVA Extension from Images to Videos” (HKU, 2024)

Example

// Create a PLLaVA model for video dense captioning
// with parameter-free pooling to extend image LLMs to video
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 PLLaVA<double>(architecture, "pllava.onnx");
            
// Training mode with native layers
var trainModel = new PLLaVA<double>(architecture, new PLLaVAOptions());

Constructors

Constructor Summary
PLLaVA(NeuralNetworkArchitecture<T> architecture, PLLaVAOptions options, IGradientBasedOptimizer<T, Tensor<T>, Tensor<T>> optimizer)
PLLaVA(NeuralNetworkArchitecture<T> architecture, string modelPath, PLLaVAOptions 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 PLLaVA’s parameter-free approach.
Tensor<T> GenerateFromVideo(IReadOnlyList<Tensor<T>> frames, string prompt) Generates output from video frames using PLLaVA’s parameter-free adaptive pooling.