|
NVIDIA DeepStream SDK API Reference
|
7.0 Release
|
Go to the documentation of this file.
13 #ifndef __YOLO_PLUGINS__
14 #define __YOLO_PLUGINS__
18 #include <cuda_runtime_api.h>
22 #include "NvInferPlugin.h"
24 #define CHECK(status) \
28 std::cout << "Cuda failure: " << cudaGetErrorString(status) << " in file " << __FILE__ \
29 << " at line " << __LINE__ << std::endl; \
36 const char* YOLOV3LAYER_PLUGIN_VERSION {
"1"};
37 const char* YOLOV3LAYER_PLUGIN_NAME {
"YoloLayerV3_TRT"};
44 YoloLayerV3 (
const uint& numBoxes,
const uint& numClasses,
const uint& gridSize);
45 const char*
getPluginType () const noexcept
override {
return YOLOV3LAYER_PLUGIN_NAME; }
46 const char*
getPluginVersion () const noexcept
override {
return YOLOV3LAYER_PLUGIN_VERSION; }
50 int index,
const nvinfer1::Dims* inputs,
51 int nbInputDims) noexcept
override;
57 const nvinfer1::Dims*
inputDims,
int nbInputs,
58 const nvinfer1::Dims* outputDims,
int nbOutputs,
59 nvinfer1::DataType type, nvinfer1::PluginFormat format,
int maxBatchSize) noexcept
override;
65 int32_t batchSize,
void const*
const* inputs,
void*
const* outputs,
68 void serialize (
void* buffer) const noexcept override;
69 void destroy () noexcept
override {
delete this; }
70 nvinfer1::IPluginV2*
clone() const noexcept override;
73 m_Namespace = pluginNamespace;
76 return m_Namespace.c_str();
81 uint m_NumClasses {0};
83 uint64_t m_OutputSize {0};
84 std::string m_Namespace {
""};
93 const char*
getPluginName () const noexcept
override {
return YOLOV3LAYER_PLUGIN_NAME; }
94 const char*
getPluginVersion () const noexcept
override {
return YOLOV3LAYER_PLUGIN_VERSION; }
96 const nvinfer1::PluginFieldCollection*
getFieldNames() noexcept
override {
97 std::cerr<<
"YoloLayerV3PluginCreator::getFieldNames is not implemented" << std::endl;
102 const char* name,
const nvinfer1::PluginFieldCollection* fc) noexcept
override
104 std::cerr<<
"YoloLayerV3PluginCreator::getFieldNames is not implemented.\n";
109 const char* name,
const void* serialData,
size_t serialLength) noexcept
override
111 std::cout <<
"Deserialize yoloLayerV3 plugin: " << name << std::endl;
116 m_Namespace = libNamespace;
119 return m_Namespace.c_str();
123 std::string m_Namespace {
""};
126 #endif // __YOLO_PLUGINS__
int initialize() noexcept override
nvinfer1::IPluginV2 * clone() const noexcept override
virtual const char * getPluginNamespace() const noexcept override
size_t getWorkspaceSize(int maxBatchSize) const noexcept override
const char * getPluginVersion() const noexcept override
const nvinfer1::PluginFieldCollection * getFieldNames() noexcept override
bool supportsFormat(nvinfer1::DataType type, nvinfer1::PluginFormat format) const noexcept override
const char * getPluginName() const noexcept override
YoloLayerV3(const void *data, size_t length)
NvDsInferDimsCHW inputDims
Holds the input dimensions for the model.
nvinfer1::IPluginV2 * deserializePlugin(const char *name, const void *serialData, size_t serialLength) noexcept override
void destroy() noexcept override
void configureWithFormat(const nvinfer1::Dims *inputDims, int nbInputs, const nvinfer1::Dims *outputDims, int nbOutputs, nvinfer1::DataType type, nvinfer1::PluginFormat format, int maxBatchSize) noexcept override
int getNbOutputs() const noexcept override
void terminate() noexcept override
void setPluginNamespace(const char *libNamespace) noexcept override
const char * getPluginType() const noexcept override
~YoloLayerV3PluginCreator()
nvinfer1::Dims getOutputDimensions(int index, const nvinfer1::Dims *inputs, int nbInputDims) noexcept override
void setPluginNamespace(const char *pluginNamespace) noexcept override
nvinfer1::IPluginV2 * createPlugin(const char *name, const nvinfer1::PluginFieldCollection *fc) noexcept override
size_t getSerializationSize() const noexcept override
void serialize(void *buffer) const noexcept override
const char * getPluginVersion() const noexcept override
int32_t enqueue(int32_t batchSize, void const *const *inputs, void *const *outputs, void *workspace, cudaStream_t stream) noexcept override
const char * getPluginNamespace() const noexcept override
YoloLayerV3PluginCreator()