NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvinferserver/gstnvinferserver_meta_utils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-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 
27 #ifndef __GSTNVINFERSERVER_META_UTILS_H__
28 #define __GSTNVINFERSERVER_META_UTILS_H__
29 
30 #include <vector>
31 #include <string>
32 
33 #include "infer_utils.h"
34 #include "infer_datatypes.h"
35 #include "nvdsinferserver_plugin.pb.h"
36 #include "infer_post_datatypes.h"
37 #include "nvdsmeta.h"
38 #include "nvdsinfer.h"
39 
40 namespace dsis = nvdsinferserver;
41 namespace ic = nvdsinferserver::config;
42 
43 namespace gstnvinferserver {
44 
78  NvDsFrameMeta* frameMeta, NvDsObjectMeta* parentObj,
79  const NvDsInferDetectionOutput& detection_output, float scaleX, float scaleY,
80  uint32_t offsetLeft, uint32_t offsetTop, uint32_t roiLeft, uint32_t roiTop, uint32_t roiWidth,
81  uint32_t roiHeight, uint32_t imageWidth, uint32_t imageHeight, uint32_t uniqueId, const ic::PluginControl& config);
82 
105  NvDsObjectMeta* objMeta, NvDsFrameMeta* frameMeta, NvDsRoiMeta* roiMeta,
106  const InferClassificationOutput& objInfo, uint32_t uniqueId, const std::string& classifierType,
107  uint32_t imageWidth, uint32_t imageHeight);
108 
122  InferClassificationOutput& cache, const InferClassificationOutput& newRes);
123 
145  NvDsObjectMeta* objMeta, NvDsFrameMeta* frameMeta, NvDsRoiMeta* roiMeta,
146  const NvDsInferSegmentationOutput& segmentation_output, dsis::SharedIBatchBuffer& buf);
147 
170  NvDsObjectMeta* objMeta, NvDsFrameMeta* frameMeta, NvDsRoiMeta* roiMeta, uint32_t uniqueId,
171  const std::vector<dsis::SharedIBatchBuffer>& tensors, uint32_t batchIdx,
172  const NvDsInferNetworkInfo& inputInfo, bool maintainAspectRatio, bool symmetricPadding);
173 
187  NvDsBatchMeta* batchMeta, uint32_t uniqueId,
188  const std::vector<dsis::SharedIBatchBuffer>& tensors, const NvDsInferNetworkInfo& inputInfo);
189 }
190 
191 #endif /* __GSTNVINFERSERVER_META_UTILS_H__ */
gstnvinferserver::attachSegmentationMetadata
void attachSegmentationMetadata(NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, const NvDsInferSegmentationOutput &segmentation_output, dsis::SharedIBatchBuffer &buf)
Attach the segmentation output as user metadata.
gstnvinferserver
Definition: sources/gst-plugins/gst-nvinferserver/gstnvinferserver.h:45
nvdsinferserver
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
Definition: sources/gst-plugins/gst-nvinferserver/gstnvinferserver_impl.h:69
gstnvinferserver::attachTensorOutputMeta
void attachTensorOutputMeta(NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, uint32_t uniqueId, const std::vector< dsis::SharedIBatchBuffer > &tensors, uint32_t batchIdx, const NvDsInferNetworkInfo &inputInfo, bool maintainAspectRatio, bool symmetricPadding)
Attaches the raw tensor output to the GstBuffer as metadata.
gstnvinferserver::attachFullTensorOutputMeta
void attachFullTensorOutputMeta(NvDsBatchMeta *batchMeta, uint32_t uniqueId, const std::vector< dsis::SharedIBatchBuffer > &tensors, const NvDsInferNetworkInfo &inputInfo)
Attach the full inference output tensors to the batch metadata.
NvDsInferSegmentationOutput
Holds information parsed from segmentation network output for one frame.
Definition: sources/includes/nvdsinfer_context.h:599
gstnvinferserver::attachClassificationMetadata
void attachClassificationMetadata(NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, const InferClassificationOutput &objInfo, uint32_t uniqueId, const std::string &classifierType, uint32_t imageWidth, uint32_t imageHeight)
Attach the classification output as NvDsClassifierMeta.
NvDsInferDetectionOutput
Holds information on all objects detected by a detector network in one frame.
Definition: sources/includes/nvdsinfer_context.h:571
NvDsInferNetworkInfo
Holds information about the model network.
Definition: sources/includes/nvdsinfer.h:119
_NvDsBatchMeta
Holds information about a formed batch containing frames from different sources.
Definition: sources/includes/nvdsmeta.h:262
gstnvinferserver::attachDetectionMetadata
void attachDetectionMetadata(NvDsFrameMeta *frameMeta, NvDsObjectMeta *parentObj, const NvDsInferDetectionOutput &detection_output, float scaleX, float scaleY, uint32_t offsetLeft, uint32_t offsetTop, uint32_t roiLeft, uint32_t roiTop, uint32_t roiWidth, uint32_t roiHeight, uint32_t imageWidth, uint32_t imageHeight, uint32_t uniqueId, const ic::PluginControl &config)
Attach detection metadata for the objects in a frame.
gstnvinferserver::mergeClassificationOutput
void mergeClassificationOutput(InferClassificationOutput &cache, const InferClassificationOutput &newRes)
Merge the object history with the new classification result.
NvDsRoiMeta
Holds Information about ROI Metadata.
Definition: sources/includes/nvds_roi_meta.h:95
nvdsinferserver::SharedIBatchBuffer
std::shared_ptr< IBatchBuffer > SharedIBatchBuffer
Definition: sources/includes/nvdsinferserver/infer_datatypes.h:209
_NvDsFrameMeta
Holds metadata for a frame in a batch.
Definition: sources/includes/nvdsmeta.h:306
_NvDsObjectMeta
Holds metadata for an object in the frame.
Definition: sources/includes/nvdsmeta.h:365