NVIDIA DeepStream SDK API Reference

9.1 Release
sources/apps/apps-common/includes/deepstream_visionencoder.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __NVGSTDS_VISIONENCODER_H__
19 #define __NVGSTDS_VISIONENCODER_H__
20 
21 #include <gst/gst.h>
22 
23 #ifdef __cplusplus
24 extern "C"
25 {
26 #endif
27 
28 typedef struct
29 {
30  gboolean enable;
31  gchar *model_variant;
32  guint batch_size;
33  gchar *device;
35  gboolean verbose;
36  guint gpu_id;
37  gchar *backend; // "transformers", "triton", or "tensorrt"
38  gchar *triton_url; // Triton gRPC endpoint (host:port)
39  gchar *triton_model; // Model name in Triton repository
40  guint skip_interval; // Frame skip interval (0=none, 1=every other, 2=every 3rd, etc.)
41  gchar *embedding_classes; // Semicolon-separated list of classes to generate embeddings for
42  gchar *onnx_model; // Path to ONNX model for TensorRT engine building
43  gchar *tensorrt_engine; // Path to TensorRT engine file (for direct TensorRT backend)
44  gboolean query_only; // Init model but skip per-frame inference; REST queries still work
45  gboolean smart_infer; // Enable smart inference (cache embeddings for tracked objects)
46  guint cache_refresh_interval; // Re-infer cached objects every N frames (0 = never)
47  guint cache_max_size; // Maximum cached embeddings
48  gboolean ofa_predict; // Enable OFA-based temporal embedding prediction
49  gfloat ofa_motion_threshold; // Below this: trust cache; above: predict
50  gfloat ofa_high_motion_threshold; // Above this: force full re-inference
52 
53 typedef struct
54 {
55  GstElement *bin;
56  GstElement *queue;
57  GstElement *visionencoder;
59 
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* __NVGSTDS_VISIONENCODER_H__ */
NvDsVisionEncoderConfig::batch_size
guint batch_size
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:32
NvDsVisionEncoderConfig::cache_max_size
guint cache_max_size
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:47
NvDsVisionEncoderConfig
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:28
NvDsVisionEncoderBin::queue
GstElement * queue
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:56
NvDsVisionEncoderConfig::smart_infer
gboolean smart_infer
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:45
NvDsVisionEncoderConfig::enable
gboolean enable
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:30
NvDsVisionEncoderConfig::triton_model
gchar * triton_model
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:39
NvDsVisionEncoderConfig::embedding_classes
gchar * embedding_classes
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:41
NvDsVisionEncoderConfig::backend
gchar * backend
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:37
NvDsVisionEncoderBin::visionencoder
GstElement * visionencoder
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:57
NvDsVisionEncoderConfig::tensorrt_engine
gchar * tensorrt_engine
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:43
NvDsVisionEncoderConfig::skip_interval
guint skip_interval
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:40
NvDsVisionEncoderConfig::query_only
gboolean query_only
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:44
create_visionencoder_bin
gboolean create_visionencoder_bin(NvDsVisionEncoderConfig *config, NvDsVisionEncoderBin *bin)
NvDsVisionEncoderConfig::model_variant
gchar * model_variant
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:31
NvDsVisionEncoderBin::bin
GstElement * bin
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:55
NvDsVisionEncoderConfig::onnx_model
gchar * onnx_model
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:42
NvDsVisionEncoderConfig::ofa_predict
gboolean ofa_predict
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:48
NvDsVisionEncoderConfig::ofa_high_motion_threshold
gfloat ofa_high_motion_threshold
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:50
NvDsVisionEncoderBin
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:53
NvDsVisionEncoderConfig::triton_url
gchar * triton_url
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:38
NvDsVisionEncoderConfig::cache_refresh_interval
guint cache_refresh_interval
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:46
NvDsVisionEncoderConfig::device
gchar * device
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:33
NvDsVisionEncoderConfig::gpu_id
guint gpu_id
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:36
NvDsVisionEncoderConfig::ofa_motion_threshold
gfloat ofa_motion_threshold
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:49
NvDsVisionEncoderConfig::verbose
gboolean verbose
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:35
NvDsVisionEncoderConfig::min_crop_size
guint min_crop_size
Definition: sources/apps/apps-common/includes/deepstream_visionencoder.h:34