NVIDIA DeepStream SDK API Reference

6.1.1 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvdspreprocess_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
38 #ifndef __NVDSPREPROCESS_INTERFACE_H__
39 #define __NVDSPREPROCESS_INTERFACE_H__
40 
41 #include <cuda.h>
42 #include <cuda_runtime.h>
43 #include "nvbufsurface.h"
44 #include "nvbufsurftransform.h"
45 #include "gstnvdsmeta.h"
46 
47 #include "nvds_roi_meta.h"
48 #include "nvtx3/nvToolsExt.h"
49 #include <unordered_map>
50 
54 typedef struct CustomCtx CustomCtx;
55 
59 typedef enum
60 {
85 
91 typedef enum
92 {
100 
104 typedef enum
105 {
120 
126 typedef struct
127 {
135 
139 typedef struct
140 {
145  std::vector<int> network_input_shape;
149  guint64 buffer_size = 1;
155  std::string tensor_name;
157 
161 typedef struct
162 {
164  unsigned int width;
166  unsigned int height;
168  unsigned int channels;
170 
174 typedef struct
175 {
177  std::vector<NvDsRoiMeta> roi_vector;
179 
183 typedef struct
184 {
190 
194 typedef struct
195 {
197  guint unique_id;
201  std::unordered_map <std::string, std::string> user_configs;
205 
210 {
212  void *memory_ptr;
213 };
214 
220 {
221 public:
223  virtual NvDsPreProcessCustomBuf *acquire() = 0;
225  virtual gboolean release(NvDsPreProcessCustomBuf *) = 0;
226 };
227 
231 typedef struct
232 {
234  NvDsObjectMeta *obj_meta = nullptr;
236  NvDsFrameMeta *frame_meta = nullptr;
239  guint batch_index = 0;
241  gulong frame_num = 0;
243  NvBufSurfaceParams *input_surf_params = nullptr;
248  gpointer converted_frame_ptr = nullptr;
251 
253 
257 typedef struct
258 {
260  std::vector<NvDsPreProcessUnit> units;
262  GstBuffer *inbuf = nullptr;
264  gulong inbuf_batch_num = 0;
269  gboolean push_buffer = FALSE;
273  gboolean event_marker = FALSE;
275  GstBuffer *converted_buf = nullptr;
281  uint32_t pitch;
283  nvtxRangeId_t nvtx_complete_buf_range = 0;
285 
286 #endif //__NVDSPREPROCESS_INTERFACE_H__
287 
Holds metadata for a frame in a batch.
Definition: nvdsmeta.h:265
unsigned int height
Holds the input height for the model.
class for acquiring and releasing a buffer from tensor pool by custom lib.
NvBufSurface Interface
NVIDIA GStreamer DeepStream: ROI Meta used in nvdspreprocess plugin
NvDsRoiMeta roi_meta
New meta for rois provided.
NvBufSurfTransformConfigParams transform_config_params
transform config params for nvbufsurftransform api
Specifies 32-bit interleaved R-G-B-A format.
struct NvBufSurfTransformSyncObj * NvBufSurfTransformSyncObj_t
Holds the information about synchronization objects for asynchronous transform/composite APIs...
Specifies NHWC network input order.
Custom Initialization parameter for custom library.
void * memory_ptr
memory ptr where to store prepared tensor
NvDsPreProcessFormat scaling_pool_format
scaling pool color format
uint32_t pitch
Holds the pitch of the buffer.
NvDsDataType
Data type used for model in infer.
Definition: nvds_roi_meta.h:61
unsigned int channels
Holds the number of input channels for the model.
std::string tensor_name
Name of the tensor same as input layer name of model.
Hold the information of single buffer in the batch.
Definition: nvbufsurface.h:427
gchar * config_file_path
nvdspreprocess config file path
NvDsPreprocess operation succeeded.
std::vector< NvDsPreProcessUnit > units
Vector of units in the batch.
Invalid parameters were supplied.
Custom Tensor Preparation failed.
NvDsPreProcessFormat network_color_format
Holds the network input format.
Specifies 24-bit interleaved B-G-R format.
NVIDIA GStreamer DeepStream: Metadata Extension
Tensor Yet not ready to be attached as meta.
virtual NvDsPreProcessCustomBuf * acquire()=0
method to acquire a buffer from buffer pool
Holds information about a formed batch containing frames from different sources.
Definition: nvdsmeta.h:221
Holds Information about ROI Metadata.
Definition: nvds_roi_meta.h:93
NvDsPreProcessTensorParams params
tensor params from plugin
std::vector< int > network_input_shape
Hold the network shape - interpreted based on network input order For resnet10 : NCHW = infer-batch-s...
NvDsBatchMeta * batch_meta
Deepstream batch meta.
NvDsDataType data_type
DataType for tensor formation.
Specifies any other custom input order handled by custom lib.
struct CustomCtx CustomCtx
Context for custom library.
Holds model parameters for tensor preparation.
virtual gboolean release(NvDsPreProcessCustomBuf *)=0
method to release buffer from buffer pool
NvBufSurfaceMemType memory_type
Memory Type for tensor formation.
NvDsPreProcessStatus
Enum for the status codes returned by NvDsPreProcessImpl.
NvDsPreProcessNetworkInputOrder network_input_order
network order at which model will work
unsigned int width
Holds the input width for the model.
Holds metadata for an object in the frame.
Definition: nvdsmeta.h:323
Specifies 8-bit Luma format.
CustomSeqProcTensorParams seq_params
Additional Custom Parameters.
Specifies 24-bit interleaved R-G-B format.
Tensor params passed to custom library for tensor preparation.
custom transformation parameter for calling nvbufsurftransform api for scaling and converting the ROI...
Specifies 32-bit interleaved B-G-R-x format.
Holds configuration parameters for a transform/composite session.
NvDsPreProcessFormat
Defines model color formats.
NvBufSurfTransform Interface
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Definition: nvbufsurface.h:265
CUDA error was encountered.
Holds information about the model network.
Tensor params for Custom sequence processing for 3d conv network.
Holds information about the batch of frames to be inferred.
NvDsPreProcessTensorParams tensor_params
tensor params from read from config file
Custom Library interface implementation failed.
NvBufSurfTransformSyncObj_t sync_obj
sync objects for async transform
std::vector< NvDsRoiMeta > roi_vector
vector of rois which can be modified by custom lib
Specifies NCHW network input order.
TensorRT interface failed.
Custom Group Transformation failed.
Custom Buffer passed to the custom lib for preparing tensor.
guint unique_id
unique id of the preprocess plugin
Holds transform parameters for a transform call.
A preprocess unit for processing which can be Frame/ROI.
Resource error was encountered.
NvDsPreProcessNetworkInputOrder
Enum for the network input order according to which network shape will be provided to prepare raw ten...
std::unordered_map< std::string, std::string > user_configs
User config map key-value pair.
NvBufSurfTransformParams transform_params
transform params for nvbufsurftransform api
Failed to configure the tensor_impl instance possibly due to an erroneous initialization property...