120 #ifndef _NVDSINFER_CUSTOM_IMPL_H_
121 #define _NVDSINFER_CUSTOM_IMPL_H_
126 #pragma GCC diagnostic push
127 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
128 #include "NvCaffeParser.h"
129 #include "NvUffParser.h"
130 #pragma GCC diagnostic pop
151 IModelParser() =
default;
154 virtual ~IModelParser() =
default;
165 nvinfer1::INetworkDefinition& network) = 0;
170 virtual bool hasFullDimsSupported()
const = 0;
176 virtual const char* getModelName()
const = 0;
209 std::vector<float> &perClassThreshold = perClassPreclusterThreshold;
224 std::vector<NvDsInferLayerInfo>
const &outputLayersInfo,
227 std::vector<NvDsInferObjectDetectionInfo> &objectList);
233 #define CHECK_CUSTOM_PARSE_FUNC_PROTOTYPE(customParseFunc) \
234 static void checkFunc_ ## customParseFunc (NvDsInferParseCustomFunc func = customParseFunc) \
235 { checkFunc_ ## customParseFunc (); }; \
236 extern "C" bool customParseFunc (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, \
237 NvDsInferNetworkInfo const &networkInfo, \
238 NvDsInferParseDetectionParams const &detectionParams, \
239 std::vector<NvDsInferObjectDetectionInfo> &objectList);
253 std::vector<NvDsInferLayerInfo>
const &outputLayersInfo,
256 std::vector<NvDsInferInstanceMaskInfo> &objectList);
262 #define CHECK_CUSTOM_INSTANCE_MASK_PARSE_FUNC_PROTOTYPE(customParseFunc) \
263 static void checkFunc_ ## customParseFunc (NvDsInferInstanceMaskParseCustomFunc func = customParseFunc) \
264 { checkFunc_ ## customParseFunc (); }; \
265 extern "C" bool customParseFunc (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, \
266 NvDsInferNetworkInfo const &networkInfo, \
267 NvDsInferParseDetectionParams const &detectionParams, \
268 std::vector<NvDsInferInstanceMaskInfo> &objectList);
284 std::vector<NvDsInferLayerInfo>
const &outputLayersInfo,
286 float classifierThreshold,
287 std::vector<NvDsInferAttribute> &attrList,
288 std::string &descString);
294 #define CHECK_CUSTOM_CLASSIFIER_PARSE_FUNC_PROTOTYPE(customParseFunc) \
295 static void checkFunc_ ## customParseFunc (NvDsInferClassiferParseCustomFunc func = customParseFunc) \
296 { checkFunc_ ## customParseFunc (); }; \
297 extern "C" bool customParseFunc (std::vector<NvDsInferLayerInfo> const &outputLayersInfo, \
298 NvDsInferNetworkInfo const &networkInfo, \
299 float classifierThreshold, \
300 std::vector<NvDsInferAttribute> &attrList, \
301 std::string &descString);
336 nvinfer1::IBuilder *
const builder,
338 nvinfer1::DataType dataType,
339 nvinfer1::ICudaEngine *& cudaEngine);
345 #define CHECK_CUSTOM_ENGINE_CREATE_FUNC_PROTOTYPE(customEngineCreateFunc) \
346 static void checkFunc_ ## customEngineCreateFunc (NvDsInferEngineCreateCustomFunc = customEngineCreateFunc) \
347 { checkFunc_ ## customEngineCreateFunc(); }; \
348 extern "C" bool customEngineCreateFunc ( \
349 nvinfer1::IBuilder * const builder, \
350 const NvDsInferContextInitParams const *initParams, \
351 nvinfer1::DataType dataType, \
352 nvinfer1::ICudaEngine *& cudaEngine);
489 nvinfer1::DataType dataType,
490 nvinfer1::ICudaEngine *& cudaEngine)
491 __attribute__((deprecated(
"Use 'engine-create-func-name' config parameter instead")));
unsigned int maxBatchSize
Holds the maximum number of frames to be inferred together in a batch.
std::vector< float > perClassPreclusterThreshold
Holds a per-class vector of detection confidence thresholds to be applied prior to clustering operati...
nvcaffeparser1::IPluginFactory * pluginFactory
void NvDsInferPluginFactoryRuntimeDestroy(nvinfer1::IPluginFactory *pluginFactory)
Destroys a Plugin Factory instance created by NvDsInferPluginFactoryRuntimeGet(). ...
Holds the initialization parameters required for the NvDsInferContext interface.
Holds the detection parameters required for parsing objects.
void NvDsInferPluginFactoryUffDestroy(NvDsInferPluginFactoryUff &pluginFactory)
Destroys a Plugin Factory instance created by NvDsInferPluginFactoryUffGet().
Specifies nvcaffeparser1::IPluginFactoryExt or nvuffparser::IPluginFactoryExt.
bool NvDsInferPluginFactoryRuntimeGet(nvinfer1::IPluginFactory *&pluginFactory)
Returns a new instance of a Plugin Factory interface to be used during parsing deserialization of CUD...
Specifies nvcaffeparser1::IPluginFactory or nvuffparser::IPluginFactory.
bool(* NvDsInferInstanceMaskParseCustomFunc)(std::vector< NvDsInferLayerInfo > const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, NvDsInferParseDetectionParams const &detectionParams, std::vector< NvDsInferInstanceMaskInfo > &objectList)
Type definition for the custom bounding box and instance mask parsing function.
NVIDIA DeepStream inference specifications
NvDsInferPluginFactoryType
Specifies the type of the Plugin Factory.
Holds a 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)
Type definition for the custom bounding box parsing function.
bool NvDsInferCudaEngineGet(nvinfer1::IBuilder *builder, NvDsInferContextInitParams *initParams, nvinfer1::DataType dataType, nvinfer1::ICudaEngine *&cudaEngine) __attribute__((deprecated("Use 'engine-create-func-name' config parameter instead")))
The NvDsInferCudaEngineGet interface has been deprecated and has been replaced by NvDsInferEngineCrea...
Specifies nvcaffeparser1::IPluginFactoryV2.
Holds a pointer to a heap-allocated Plugin Factory object required during Caffe model parsing...
bool NvDsInferPluginFactoryUffGet(NvDsInferPluginFactoryUff &pluginFactory, NvDsInferPluginFactoryType &type)
Returns a new instance of a Plugin Factory interface to be used during parsing of UFF models...
bool(* NvDsInferEngineCreateCustomFunc)(nvinfer1::IBuilder *const builder, const NvDsInferContextInitParams *const initParams, nvinfer1::DataType dataType, nvinfer1::ICudaEngine *&cudaEngine)
Type definition for functions that build and return a CudaEngine for custom models.
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
unsigned int numClassesConfigured
Holds the number of classes requested to be parsed, starting with class ID 0.
nvuffparser::IPluginFactoryExt * pluginFactoryExt
bool(* NvDsInferClassiferParseCustomFunc)(std::vector< NvDsInferLayerInfo > const &outputLayersInfo, NvDsInferNetworkInfo const &networkInfo, float classifierThreshold, std::vector< NvDsInferAttribute > &attrList, std::string &descString)
Type definition for the custom classifier output parsing function.
IModelParser * NvDsInferCreateModelParser(const NvDsInferContextInitParams *initParams)
Create a customized neural network parser for user-defined models.
bool NvDsInferInitializeInputLayers(std::vector< NvDsInferLayerInfo > const &inputLayersInfo, NvDsInferNetworkInfo const &networkInfo, unsigned int maxBatchSize)
Initializes the input layers for inference.
Holds information about the model network.
bool NvDsInferPluginFactoryCaffeGet(NvDsInferPluginFactoryCaffe &pluginFactory, NvDsInferPluginFactoryType &type)
Gets a new instance of a Plugin Factory interface to be used during parsing of Caffe models...
std::vector< float > perClassPostclusterThreshold
nvcaffeparser1::IPluginFactoryExt * pluginFactoryExt
nvuffparser::IPluginFactory * pluginFactory
void NvDsInferPluginFactoryCaffeDestroy(NvDsInferPluginFactoryCaffe &pluginFactory)
Destroys a Plugin Factory instance created by NvDsInferPluginFactoryCaffeGet().
nvcaffeparser1::IPluginFactoryV2 * pluginFactoryV2