NVIDIA DeepStream SDK API Reference

4.0.2 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvdsinfer_custom_impl.h
Go to the documentation of this file.
1 
102 #ifndef _NVDSINFER_CUSTOM_IMPL_H_
103 #define _NVDSINFER_CUSTOM_IMPL_H_
104 
105 #include <string>
106 #include <vector>
107 #include "NvCaffeParser.h"
108 #include "NvUffParser.h"
109 
110 #include "nvdsinfer.h"
111 
112 #ifdef __cplusplus
113 extern "C"
114 {
115 #endif
116 
120 typedef struct
121 {
124  unsigned int numClassesConfigured;
127  std::vector<float> perClassThreshold;
129 
140 typedef bool (* NvDsInferParseCustomFunc) (
141  std::vector<NvDsInferLayerInfo> const &outputLayersInfo,
142  NvDsInferNetworkInfo const &networkInfo,
143  NvDsInferParseDetectionParams const &detectionParams,
144  std::vector<NvDsInferObjectDetectionInfo> &objectList);
145 
150 #define CHECK_CUSTOM_PARSE_FUNC_PROTOTYPE(customParseFunc) \
151  static void checkFunc_ ## customParseFunc (NvDsInferParseCustomFunc func = customParseFunc) \
152  { checkFunc_ ## customParseFunc (); }; \
153  extern "C" bool customParseFunc (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, \
154  NvDsInferNetworkInfo const &networkInfo, \
155  NvDsInferParseDetectionParams const &detectionParams, \
156  std::vector<NvDsInferObjectDetectionInfo> &objectList);
157 
171  std::vector<NvDsInferLayerInfo> const &outputLayersInfo,
172  NvDsInferNetworkInfo const &networkInfo,
173  float classifierThreshold,
174  std::vector<NvDsInferAttribute> &attrList,
175  std::string &descString);
176 
181 #define CHECK_CUSTOM_CLASSIFIER_PARSE_FUNC_PROTOTYPE(customParseFunc) \
182  static void checkFunc_ ## customParseFunc (NvDsInferClassiferParseCustomFunc func = customParseFunc) \
183  { checkFunc_ ## customParseFunc (); }; \
184  extern "C" bool customParseFunc (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, \
185  NvDsInferNetworkInfo const &networkInfo, \
186  float classifierThreshold, \
187  std::vector<NvDsInferAttribute> &attrList, \
188  std::string &descString);
189 
193 typedef enum
194 {
202 
207 typedef union
208 {
209  nvcaffeparser1::IPluginFactory *pluginFactory;
210  nvcaffeparser1::IPluginFactoryExt *pluginFactoryExt;
211  nvcaffeparser1::IPluginFactoryV2 *pluginFactoryV2;
213 
218 typedef union
219 {
220  nvuffparser::IPluginFactory *pluginFactory;
221  nvuffparser::IPluginFactoryExt *pluginFactoryExt;
223 
241 
250 
267 
276 
287 bool NvDsInferPluginFactoryRuntimeGet (nvinfer1::IPluginFactory *& pluginFactory);
288 
295 void NvDsInferPluginFactoryRuntimeDestroy (nvinfer1::IPluginFactory * pluginFactory);
296 
310 bool NvDsInferInitializeInputLayers (std::vector<NvDsInferLayerInfo> const &inputLayersInfo,
311  NvDsInferNetworkInfo const &networkInfo,
312  unsigned int maxBatchSize);
313 
315 
339 bool NvDsInferCudaEngineGet(nvinfer1::IBuilder *builder,
340  NvDsInferContextInitParams *initParams,
341  nvinfer1::DataType dataType,
342  nvinfer1::ICudaEngine *& cudaEngine);
343 
344 #ifdef __cplusplus
345 }
346 #endif
347 
348 #endif
349 
nvcaffeparser1::IPluginFactory * pluginFactory
void NvDsInferPluginFactoryRuntimeDestroy(nvinfer1::IPluginFactory *pluginFactory)
Destroy the PluginFactory instance returned in NvDsInferPluginFactoryRuntimeGet
Holds the initialization parameters required for the NvDsInferContext interface.
Holds the detection parameters required for parsing objects.
bool NvDsInferCudaEngineGet(nvinfer1::IBuilder *builder, NvDsInferContextInitParams *initParams, nvinfer1::DataType dataType, nvinfer1::ICudaEngine *&cudaEngine)
Build and return CudaEngine for custom models.
void NvDsInferPluginFactoryUffDestroy(NvDsInferPluginFactoryUff &pluginFactory)
Destroy the Plugin Factory instance returned in NvDsInferPluginFactoryUffGet
nvcaffeparser1::IPluginFactoryExt / nvuffparser::IPluginFactoryExt
bool NvDsInferPluginFactoryRuntimeGet(nvinfer1::IPluginFactory *&pluginFactory)
Returns an instance of a newly allocated Plugin Factory interface to be used during parsing deseriali...
nvcaffeparser1::IPluginFactory / nvuffparser::IPluginFactory
std::vector< float > perClassThreshold
Per class detection confidence threshold.
Copyright (c) 2017-2019, NVIDIA CORPORATION.
NvDsInferPluginFactoryType
Specifies the type of the Plugin Factory.
Holds the pointer to a heap allocated Plugin Factory object required during UFF model parsing...
bool(* NvDsInferParseCustomFunc)(std::vector< NvDsInferLayerInfo > const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, NvDsInferParseDetectionParams const &detectionParams, std::vector< NvDsInferObjectDetectionInfo > &objectList)
Function definition for the custom bounding box parsing function.
Only for caffe models.
Holds the pointer to a heap allocated Plugin Factory object required during Caffemodel parsing...
bool NvDsInferPluginFactoryUffGet(NvDsInferPluginFactoryUff &pluginFactory, NvDsInferPluginFactoryType &type)
Returns an instance of a newly allocated Plugin Factory interface to be used during parsing of UFF mo...
unsigned int numClassesConfigured
Number of classes requested to be parsed starting with classID 0.
nvuffparser::IPluginFactoryExt * pluginFactoryExt
bool(* NvDsInferClassiferParseCustomFunc)(std::vector< NvDsInferLayerInfo > const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, float classifierThreshold, std::vector< NvDsInferAttribute > &attrList, std::string &descString)
Function definition for the custom classifier output parsing function.
bool NvDsInferInitializeInputLayers(std::vector< NvDsInferLayerInfo > const &inputLayersInfo, NvDsInferNetworkInfo const &networkInfo, unsigned int maxBatchSize)
Initialize the input layers for inference.
Holds information about the model network.
Definition: nvdsinfer.h:94
bool NvDsInferPluginFactoryCaffeGet(NvDsInferPluginFactoryCaffe &pluginFactory, NvDsInferPluginFactoryType &type)
Returns an instance of a newly allocated Plugin Factory interface to be used during parsing of caffe ...
nvcaffeparser1::IPluginFactoryExt * pluginFactoryExt
nvuffparser::IPluginFactory * pluginFactory
void NvDsInferPluginFactoryCaffeDestroy(NvDsInferPluginFactoryCaffe &pluginFactory)
Destroy the Plugin Factory instance returned in NvDsInferPluginFactoryCaffeGet
nvcaffeparser1::IPluginFactoryV2 * pluginFactoryV2