Skip to navigation

Gst-nvdstextembedder

View as Markdown

The Gst-nvdstextembedder plugin is a DeepStream-compatible GStreamer Python plugin that generates text embeddings, designed to work alongside Gst-nvdsvisionencoder-c for text-to-image search applications. It supports text-to-image search, person-attribute search (e.g. “person wearing red shirt”), zero-shot classification, and semantic search. Texts can be set via the texts property, or encoded on demand using a custom GStreamer “embedding” query that returns results synchronously without modifying element properties.

Inputs and Outputs

  • Inputs

    • texts property, or a custom “embedding” GstQuery, containing a JSON array of text strings to encode
  • Control parameters

    • device, model-name, batch-size, use-fp16, verbose
  • Output

    • embeddings property containing a JSON array of computed embedding vectors (or the synchronous query result for on-demand encoding)

Features

The following table summarizes the features of the plugin.

Gst-nvdstextembedder plugin features

FeatureDescriptionRelease
Text-to-embedding encodingGenerates text embedding vectors using SigLIP2 Giant (1536-dim, default) or DFN5B-CLIP (1024-dim) modelsDS 9.2
On-demand embedding querySupports a custom GstQuery for synchronous on-demand text encoding without changing element propertiesDS 9.2
Vision-encoder pairingDesigned to work alongside Gst-nvdsvisionencoder-c so text and image embeddings share a common vector spaceDS 9.2

Gst Properties

The following table describes the Gst properties of the Gst-nvdstextembedder plugin.

Gst-nvdstextembedder plugin gst properties

PropertyMeaningType and RangeExample Notes
textsJSON array of texts to encode (e.g. ’[“query1”, “query2”]‘)Stringtexts=’[“person wearing red shirt”]‘
embeddings (read-only)JSON array of computed embeddingsString
batch-sizeMaximum batch size for inferenceInteger,
1 to 128
batch-size=64
verboseEnables verbose loggingBooleanverbose=0
deviceDevice used for inference (cuda or cpu)Stringdevice=cuda
use-fp16Enables FP16 inference for faster processingBooleanuse-fp16=1
model-nameEncoder selection, set from curl/API (e.g. an ONNX model name). Use a name containing “siglip2-giant” or “giant” for SigLIP2 Giant (1536-dim), or “dfn5b-clip” for DFN5B-CLIP (1024-dim)Stringmodel-name=siglip2-giant
embedding-dim (read-only)Model embedding dimensionInteger,
0 to 65536
num-texts (read-only)Number of texts currently loadedInteger,
0 to 2,147,483,647
model-loaded (read-only)Whether the model is loaded and readyBoolean
last-query-result (read-only)JSON string of the last embedding query resultString
onnx-model-pathPath to the DFN-CLIP ONNX model file (used when model-name contains “dfnclip”)Stringonnx-model-path=/path/to/model.onnx
tokenizer-dirPath to the tokenizer directory with tokenizer.json (used when model-name contains “dfnclip”)Stringtokenizer-dir=/path/to/tokenizer