|
|
NVIDIA DeepStream SDK API Reference
|
6.4 Release
|
Go to the documentation of this file.
23 #ifndef __YOLO_PLUGINS__
24 #define __YOLO_PLUGINS__
28 #include <cuda_runtime_api.h>
32 #include "NvInferPlugin.h"
34 #define CHECK(status) \
38 std::cout << "Cuda failure: " << cudaGetErrorString(status) << " in file " << __FILE__ \
39 << " at line " << __LINE__ << std::endl; \
46 const char* YOLOV3LAYER_PLUGIN_VERSION {
"1"};
47 const char* YOLOV3LAYER_PLUGIN_NAME {
"YoloLayerV3_TRT"};
54 YoloLayerV3 (
const uint& numBoxes,
const uint& numClasses,
const uint& gridSize);
55 const char*
getPluginType () const noexcept
override {
return YOLOV3LAYER_PLUGIN_NAME; }
56 const char*
getPluginVersion () const noexcept
override {
return YOLOV3LAYER_PLUGIN_VERSION; }
60 int index,
const nvinfer1::Dims* inputs,
61 int nbInputDims) noexcept
override;
67 const nvinfer1::Dims*
inputDims,
int nbInputs,
68 const nvinfer1::Dims* outputDims,
int nbOutputs,
69 nvinfer1::DataType type, nvinfer1::PluginFormat format,
int maxBatchSize) noexcept
override;
75 int32_t batchSize,
void const*
const* inputs,
void*
const* outputs,
78 void serialize (
void* buffer) const noexcept override;
79 void destroy () noexcept
override {
delete this; }
80 nvinfer1::IPluginV2*
clone() const noexcept override;
83 m_Namespace = pluginNamespace;
86 return m_Namespace.c_str();
91 uint m_NumClasses {0};
93 uint64_t m_OutputSize {0};
94 std::string m_Namespace {
""};
103 const char*
getPluginName () const noexcept
override {
return YOLOV3LAYER_PLUGIN_NAME; }
104 const char*
getPluginVersion () const noexcept
override {
return YOLOV3LAYER_PLUGIN_VERSION; }
107 std::cerr<<
"YoloLayerV3PluginCreator::getFieldNames is not implemented" << std::endl;
112 const char* name,
const nvinfer1::PluginFieldCollection* fc) noexcept
override
114 std::cerr<<
"YoloLayerV3PluginCreator::getFieldNames is not implemented.\n";
119 const char* name,
const void* serialData,
size_t serialLength) noexcept
override
121 std::cout <<
"Deserialize yoloLayerV3 plugin: " << name << std::endl;
126 m_Namespace = libNamespace;
129 return m_Namespace.c_str();
133 std::string m_Namespace {
""};
136 #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()