diff --git a/plugin/InferPlugin.cpp b/plugin/InferPlugin.cpp index 700214ca..378854ab 100644 --- a/plugin/InferPlugin.cpp +++ b/plugin/InferPlugin.cpp @@ -158,6 +158,7 @@ bool initLibNvInferPlugins(void* logger, const char* libNamespace) { initializePlugin(logger, libNamespace); initializePlugin(logger, libNamespace); + initializePlugin(logger, libNamespace); initializePlugin(logger, libNamespace); initializePlugin(logger, libNamespace); initializePlugin(logger, libNamespace); diff --git a/plugin/README.md b/plugin/README.md index 8fbcf532..9f2bc1bf 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -6,6 +6,7 @@ |---|---|---| | [batchTilePlugin](batchTilePlugin) | BatchTilePlugin_TRT | 1 | | [batchedNMSPlugin](batchedNMSPlugin) | BatchedNMS_TRT | 1 | +| [batchedNMSDynamicPlugin](batchedNMSPlugin) | BatchedNMSDynamic_TRT | 1 | | [bertQKVToContextPlugin](bertQKVToContextPlugin) | CustomQKVToContextPluginDynamic | 1 | | [coordConvACPlugin](coordConvACPlugin) | CoordConvAC | 1 | | [cropAndResizePlugin](cropAndResizePlugin) | CropAndResize | 1 | diff --git a/plugin/batchedNMSPlugin/batchedNMSPlugin.cpp b/plugin/batchedNMSPlugin/batchedNMSPlugin.cpp index ec015ee0..dc561386 100644 --- a/plugin/batchedNMSPlugin/batchedNMSPlugin.cpp +++ b/plugin/batchedNMSPlugin/batchedNMSPlugin.cpp @@ -23,17 +23,20 @@ using namespace nvinfer1; using nvinfer1::plugin::BatchedNMSPlugin; +using nvinfer1::plugin::BatchedNMSDynamicPlugin; +using nvinfer1::plugin::BatchedNMSBasePluginCreator; using nvinfer1::plugin::BatchedNMSPluginCreator; +using nvinfer1::plugin::BatchedNMSDynamicPluginCreator; using nvinfer1::plugin::NMSParameters; namespace { const char* NMS_PLUGIN_VERSION{"1"}; -const char* NMS_PLUGIN_NAME{"BatchedNMS_TRT"}; +const char* NMS_PLUGIN_NAMES[] = {"BatchedNMS_TRT", "BatchedNMSDynamic_TRT"}; } // namespace -PluginFieldCollection BatchedNMSPluginCreator::mFC{}; -std::vector BatchedNMSPluginCreator::mPluginAttributes; +PluginFieldCollection BatchedNMSBasePluginCreator::mFC{}; +std::vector BatchedNMSBasePluginCreator::mPluginAttributes; BatchedNMSPlugin::BatchedNMSPlugin(NMSParameters params) : param(params) @@ -51,19 +54,76 @@ BatchedNMSPlugin::BatchedNMSPlugin(const void* data, size_t length) ASSERT(d == a + length); } +BatchedNMSDynamicPlugin::BatchedNMSDynamicPlugin(NMSParameters params) + : param(params) +{ +} + +BatchedNMSDynamicPlugin::BatchedNMSDynamicPlugin(const void* data, size_t length) +{ + const char *d = reinterpret_cast(data), *a = d; + param = read(d); + boxesSize = read(d); + scoresSize = read(d); + numPriors = read(d); + mClipBoxes = read(d); + ASSERT(d == a + length); +} + int BatchedNMSPlugin::getNbOutputs() const { return 4; } +int BatchedNMSDynamicPlugin::getNbOutputs() const +{ + return 4; +} + int BatchedNMSPlugin::initialize() { return STATUS_SUCCESS; } +int BatchedNMSDynamicPlugin::initialize() +{ + return STATUS_SUCCESS; +} + void BatchedNMSPlugin::terminate() {} -DimsExprs BatchedNMSPlugin::getOutputDimensions( +void BatchedNMSDynamicPlugin::terminate() {} + +Dims BatchedNMSPlugin::getOutputDimensions(int index, const Dims* inputs, int nbInputDims) +{ + ASSERT(nbInputDims == 2); + ASSERT(index >= 0 && index < this->getNbOutputs()); + ASSERT(inputs[0].nbDims == 3); + ASSERT(inputs[1].nbDims == 2 || (inputs[1].nbDims == 3 && inputs[1].d[2] == 1)); + // boxesSize: number of box coordinates for one sample + boxesSize = inputs[0].d[0] * inputs[0].d[1] * inputs[0].d[2]; + // scoresSize: number of scores for one sample + scoresSize = inputs[1].d[0] * inputs[1].d[1]; + // num_detections + if (index == 0) + { + Dims dim0{}; + dim0.nbDims = 0; + return dim0; + } + // nmsed_boxes + if (index == 1) + { + return DimsHW(param.keepTopK, 4); + } + // nmsed_scores or nmsed_classes + Dims dim1{}; + dim1.nbDims = 1; + dim1.d[0] = param.keepTopK; + return dim1; +} + +DimsExprs BatchedNMSDynamicPlugin::getOutputDimensions( int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) { ASSERT(nbInputs == 2); @@ -132,14 +192,39 @@ DimsExprs BatchedNMSPlugin::getOutputDimensions( return out_dim; } -size_t BatchedNMSPlugin::getWorkspaceSize( +size_t BatchedNMSPlugin::getWorkspaceSize(int maxBatchSize) const +{ + return detectionInferenceWorkspaceSize(param.shareLocation, maxBatchSize, boxesSize, scoresSize, param.numClasses, + numPriors, param.topK, DataType::kFLOAT, DataType::kFLOAT); +} + +size_t BatchedNMSDynamicPlugin::getWorkspaceSize( const PluginTensorDesc* inputs, int nbInputs, const PluginTensorDesc* outputs, int nbOutputs) const { return detectionInferenceWorkspaceSize(param.shareLocation, inputs[0].dims.d[0], boxesSize, scoresSize, param.numClasses, numPriors, param.topK, DataType::kFLOAT, DataType::kFLOAT); } -int BatchedNMSPlugin::enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc, +int BatchedNMSPlugin::enqueue( + int batchSize, const void* const* inputs, void** outputs, void* workspace, cudaStream_t stream) +{ + const void* const locData = inputs[0]; + const void* const confData = inputs[1]; + + void* keepCount = outputs[0]; + void* nmsedBoxes = outputs[1]; + void* nmsedScores = outputs[2]; + void* nmsedClasses = outputs[3]; + + pluginStatus_t status = nmsInference(stream, batchSize, boxesSize, scoresSize, param.shareLocation, + param.backgroundLabelId, numPriors, param.numClasses, param.topK, param.keepTopK, param.scoreThreshold, + param.iouThreshold, DataType::kFLOAT, locData, DataType::kFLOAT, confData, keepCount, nmsedBoxes, nmsedScores, + nmsedClasses, workspace, param.isNormalized, false, mClipBoxes); + ASSERT(status == STATUS_SUCCESS); + return 0; +} + +int BatchedNMSDynamicPlugin::enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc, const void* const* inputs, void* const* outputs, void* workspace, cudaStream_t stream) { const void* const locData = inputs[0]; @@ -175,7 +260,45 @@ void BatchedNMSPlugin::serialize(void* buffer) const ASSERT(d == a + getSerializationSize()); } -void BatchedNMSPlugin::configurePlugin( +size_t BatchedNMSDynamicPlugin::getSerializationSize() const +{ + // NMSParameters, boxesSize,scoresSize,numPriors + return sizeof(NMSParameters) + sizeof(int) * 3 + sizeof(bool); +} + +void BatchedNMSDynamicPlugin::serialize(void* buffer) const +{ + char *d = reinterpret_cast(buffer), *a = d; + write(d, param); + write(d, boxesSize); + write(d, scoresSize); + write(d, numPriors); + write(d, mClipBoxes); + ASSERT(d == a + getSerializationSize()); +} + +void BatchedNMSPlugin::configurePlugin(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, + const DataType* inputTypes, const DataType* outputTypes, const bool* inputIsBroadcast, + const bool* outputIsBroadcast, nvinfer1::PluginFormat format, int maxBatchSize) +{ + ASSERT(nbInputs == 2); + ASSERT(nbOutputs == 4); + ASSERT(inputDims[0].nbDims == 3); + ASSERT(inputDims[1].nbDims == 2 || (inputDims[1].nbDims == 3 && inputDims[1].d[2] == 1)); + ASSERT(std::none_of(inputIsBroadcast, inputIsBroadcast + nbInputs, [](bool b) { return b; })); + ASSERT(std::none_of(outputIsBroadcast, outputIsBroadcast + nbInputs, [](bool b) { return b; })); + + boxesSize = inputDims[0].d[0] * inputDims[0].d[1] * inputDims[0].d[2]; + scoresSize = inputDims[1].d[0] * inputDims[1].d[1]; + // num_boxes + numPriors = inputDims[0].d[0]; + const int numLocClasses = param.shareLocation ? 1 : param.numClasses; + // Third dimension of boxes must be either 1 or num_classes + ASSERT(inputDims[0].d[1] == numLocClasses); + ASSERT(inputDims[0].d[2] == 4); +} + +void BatchedNMSDynamicPlugin::configurePlugin( const DynamicPluginTensorDesc* in, int nbInputs, const DynamicPluginTensorDesc* out, int nbOutputs) { ASSERT(nbInputs == 2); @@ -199,7 +322,13 @@ void BatchedNMSPlugin::configurePlugin( numPriors = in[0].desc.dims.d[1]; } -bool BatchedNMSPlugin::supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) +bool BatchedNMSPlugin::supportsFormat(DataType type, PluginFormat format) const +{ + return ((type == DataType::kFLOAT || type == DataType::kINT32) && format == PluginFormat::kNCHW); +} + +bool BatchedNMSDynamicPlugin::supportsFormatCombination( + int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) { ASSERT(0 <= pos && pos < 6); const auto* in = inOut; @@ -213,11 +342,17 @@ bool BatchedNMSPlugin::supportsFormatCombination(int pos, const PluginTensorDesc case 4: return out[2].type == DataType::kFLOAT && out[2].format == PluginFormat::kLINEAR; case 5: return out[3].type == DataType::kFLOAT && out[3].format == PluginFormat::kLINEAR; } + return false; } const char* BatchedNMSPlugin::getPluginType() const { - return NMS_PLUGIN_NAME; + return NMS_PLUGIN_NAMES[0]; +} + +const char* BatchedNMSDynamicPlugin::getPluginType() const +{ + return NMS_PLUGIN_NAMES[1]; } const char* BatchedNMSPlugin::getPluginVersion() const @@ -225,12 +360,22 @@ const char* BatchedNMSPlugin::getPluginVersion() const return NMS_PLUGIN_VERSION; } +const char* BatchedNMSDynamicPlugin::getPluginVersion() const +{ + return NMS_PLUGIN_VERSION; +} + void BatchedNMSPlugin::destroy() { delete this; } -IPluginV2DynamicExt* BatchedNMSPlugin::clone() const +void BatchedNMSDynamicPlugin::destroy() +{ + delete this; +} + +IPluginV2Ext* BatchedNMSPlugin::clone() const { auto* plugin = new BatchedNMSPlugin(param); plugin->boxesSize = boxesSize; @@ -241,6 +386,17 @@ IPluginV2DynamicExt* BatchedNMSPlugin::clone() const return plugin; } +IPluginV2DynamicExt* BatchedNMSDynamicPlugin::clone() const +{ + auto* plugin = new BatchedNMSDynamicPlugin(param); + plugin->boxesSize = boxesSize; + plugin->scoresSize = scoresSize; + plugin->numPriors = numPriors; + plugin->setPluginNamespace(mNamespace.c_str()); + plugin->setClipParam(mClipBoxes); + return plugin; +} + void BatchedNMSPlugin::setPluginNamespace(const char* pluginNamespace) { mNamespace = pluginNamespace; @@ -251,6 +407,16 @@ const char* BatchedNMSPlugin::getPluginNamespace() const return mNamespace.c_str(); } +void BatchedNMSDynamicPlugin::setPluginNamespace(const char* pluginNamespace) +{ + mNamespace = pluginNamespace; +} + +const char* BatchedNMSDynamicPlugin::getPluginNamespace() const +{ + return mNamespace.c_str(); +} + nvinfer1::DataType BatchedNMSPlugin::getOutputDataType( int index, const nvinfer1::DataType* inputTypes, int nbInputs) const { @@ -261,12 +427,37 @@ nvinfer1::DataType BatchedNMSPlugin::getOutputDataType( return inputTypes[0]; } +nvinfer1::DataType BatchedNMSDynamicPlugin::getOutputDataType( + int index, const nvinfer1::DataType* inputTypes, int nbInputs) const +{ + if (index == 0) + { + return nvinfer1::DataType::kINT32; + } + return inputTypes[0]; +} + void BatchedNMSPlugin::setClipParam(bool clip) { mClipBoxes = clip; } -BatchedNMSPluginCreator::BatchedNMSPluginCreator() +void BatchedNMSDynamicPlugin::setClipParam(bool clip) +{ + mClipBoxes = clip; +} + +bool BatchedNMSPlugin::isOutputBroadcastAcrossBatch(int outputIndex, const bool* inputIsBroadcasted, int nbInputs) const +{ + return false; +} + +bool BatchedNMSPlugin::canBroadcastInputAcrossBatch(int inputIndex) const +{ + return false; +} + +BatchedNMSBasePluginCreator::BatchedNMSBasePluginCreator() : params{} { mPluginAttributes.emplace_back(PluginField("shareLocation", nullptr, PluginFieldType::kINT32, 1)); @@ -283,22 +474,90 @@ BatchedNMSPluginCreator::BatchedNMSPluginCreator() mFC.fields = mPluginAttributes.data(); } -const char* BatchedNMSPluginCreator::getPluginName() const +BatchedNMSPluginCreator::BatchedNMSPluginCreator() +{ + mPluginName = NMS_PLUGIN_NAMES[0]; +} + +BatchedNMSDynamicPluginCreator::BatchedNMSDynamicPluginCreator() +{ + mPluginName = NMS_PLUGIN_NAMES[1]; +} + +const char* BatchedNMSBasePluginCreator::getPluginName() const { - return NMS_PLUGIN_NAME; + return mPluginName.c_str(); } -const char* BatchedNMSPluginCreator::getPluginVersion() const +const char* BatchedNMSBasePluginCreator::getPluginVersion() const { return NMS_PLUGIN_VERSION; } -const PluginFieldCollection* BatchedNMSPluginCreator::getFieldNames() +const PluginFieldCollection* BatchedNMSBasePluginCreator::getFieldNames() { return &mFC; } -IPluginV2DynamicExt* BatchedNMSPluginCreator::createPlugin(const char* name, const PluginFieldCollection* fc) +IPluginV2Ext* BatchedNMSPluginCreator::createPlugin(const char* name, const PluginFieldCollection* fc) +{ + const PluginField* fields = fc->fields; + mClipBoxes = true; + + for (int i = 0; i < fc->nbFields; ++i) + { + const char* attrName = fields[i].name; + if (!strcmp(attrName, "shareLocation")) + { + params.shareLocation = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "backgroundLabelId")) + { + ASSERT(fields[i].type == PluginFieldType::kINT32); + params.backgroundLabelId = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "numClasses")) + { + ASSERT(fields[i].type == PluginFieldType::kINT32); + params.numClasses = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "topK")) + { + ASSERT(fields[i].type == PluginFieldType::kINT32); + params.topK = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "keepTopK")) + { + ASSERT(fields[i].type == PluginFieldType::kINT32); + params.keepTopK = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "scoreThreshold")) + { + ASSERT(fields[i].type == PluginFieldType::kFLOAT32); + params.scoreThreshold = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "iouThreshold")) + { + ASSERT(fields[i].type == PluginFieldType::kFLOAT32); + params.iouThreshold = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "isNormalized")) + { + params.isNormalized = *(static_cast(fields[i].data)); + } + else if (!strcmp(attrName, "clipBoxes")) + { + mClipBoxes = *(static_cast(fields[i].data)); + } + } + + auto* plugin = new BatchedNMSPlugin(params); + plugin->setClipParam(mClipBoxes); + plugin->setPluginNamespace(mNamespace.c_str()); + return plugin; +} + +IPluginV2DynamicExt* BatchedNMSDynamicPluginCreator::createPlugin(const char* name, const PluginFieldCollection* fc) { const PluginField* fields = fc->fields; mClipBoxes = true; @@ -350,18 +609,27 @@ IPluginV2DynamicExt* BatchedNMSPluginCreator::createPlugin(const char* name, con } } - BatchedNMSPlugin* plugin = new BatchedNMSPlugin(params); + auto* plugin = new BatchedNMSDynamicPlugin(params); plugin->setClipParam(mClipBoxes); plugin->setPluginNamespace(mNamespace.c_str()); return plugin; } -IPluginV2DynamicExt* BatchedNMSPluginCreator::deserializePlugin( +IPluginV2Ext* BatchedNMSPluginCreator::deserializePlugin(const char* name, const void* serialData, size_t serialLength) +{ + // This object will be deleted when the network is destroyed, which will + // call NMS::destroy() + auto* plugin = new BatchedNMSPlugin(serialData, serialLength); + plugin->setPluginNamespace(mNamespace.c_str()); + return plugin; +} + +IPluginV2DynamicExt* BatchedNMSDynamicPluginCreator::deserializePlugin( const char* name, const void* serialData, size_t serialLength) { // This object will be deleted when the network is destroyed, which will // call NMS::destroy() - BatchedNMSPlugin* plugin = new BatchedNMSPlugin(serialData, serialLength); + auto* plugin = new BatchedNMSDynamicPlugin(serialData, serialLength); plugin->setPluginNamespace(mNamespace.c_str()); return plugin; } diff --git a/plugin/batchedNMSPlugin/batchedNMSPlugin.h b/plugin/batchedNMSPlugin/batchedNMSPlugin.h index 7dfd1707..28621162 100644 --- a/plugin/batchedNMSPlugin/batchedNMSPlugin.h +++ b/plugin/batchedNMSPlugin/batchedNMSPlugin.h @@ -28,55 +28,84 @@ namespace nvinfer1 namespace plugin { -class BatchedNMSPlugin : public IPluginV2DynamicExt +class BatchedNMSPlugin : public IPluginV2Ext { public: BatchedNMSPlugin(NMSParameters param); - BatchedNMSPlugin(const void* data, size_t length); - ~BatchedNMSPlugin() override = default; + // IPluginV2 methods + const char* getPluginType() const override; + const char* getPluginVersion() const override; int getNbOutputs() const override; - - DimsExprs getOutputDimensions( - int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) override; - + Dims getOutputDimensions(int index, const Dims* inputs, int nbInputDims) override; + bool supportsFormat(DataType type, PluginFormat format) const override; + size_t getWorkspaceSize(int maxBatchSize) const override; + int enqueue( + int batchSize, const void* const* inputs, void** outputs, void* workspace, cudaStream_t stream) override; int initialize() override; - void terminate() override; - - size_t getWorkspaceSize( - const PluginTensorDesc* inputs, int nbInputs, const PluginTensorDesc* outputs, int nbOutputs) const override; - - int enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc, const void* const* inputs, - void* const* outputs, void* workspace, cudaStream_t stream) override; - size_t getSerializationSize() const override; - void serialize(void* buffer) const override; + void destroy() override; + void setPluginNamespace(const char* libNamespace) override; + const char* getPluginNamespace() const override; + void setClipParam(bool clip); - void configurePlugin( - const DynamicPluginTensorDesc* in, int nbInputs, const DynamicPluginTensorDesc* out, int nbOutputs) override; + // IPluginV2Ext methods + nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputType, int nbInputs) const override; + bool isOutputBroadcastAcrossBatch(int outputIndex, const bool* inputIsBroadcasted, int nbInputs) const override; + bool canBroadcastInputAcrossBatch(int inputIndex) const override; + void configurePlugin(const Dims* inputDims, int nbInputs, const Dims* outputDims, int nbOutputs, + const DataType* inputTypes, const DataType* outputTypes, const bool* inputIsBroadcast, + const bool* outputIsBroadcast, PluginFormat floatFormat, int maxBatchSize) override; + IPluginV2Ext* clone() const override; - bool supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) override; +private: + NMSParameters param{}; + int boxesSize{}; + int scoresSize{}; + int numPriors{}; + std::string mNamespace; + bool mClipBoxes{}; +}; - const char* getPluginType() const override; +class BatchedNMSDynamicPlugin : public IPluginV2DynamicExt +{ +public: + BatchedNMSDynamicPlugin(NMSParameters param); + BatchedNMSDynamicPlugin(const void* data, size_t length); + ~BatchedNMSDynamicPlugin() override = default; + // IPluginV2 methods + const char* getPluginType() const override; const char* getPluginVersion() const override; - + int getNbOutputs() const override; + int initialize() override; + void terminate() override; + size_t getSerializationSize() const override; + void serialize(void* buffer) const override; void destroy() override; - - IPluginV2DynamicExt* clone() const override; - - nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputType, int nbInputs) const override; - void setPluginNamespace(const char* libNamespace) override; - const char* getPluginNamespace() const override; - void setClipParam(bool clip); + // IPluginV2Ext methods + nvinfer1::DataType getOutputDataType(int index, const nvinfer1::DataType* inputType, int nbInputs) const override; + + // IPluginV2DynamicExt methods + IPluginV2DynamicExt* clone() const override; + DimsExprs getOutputDimensions( + int outputIndex, const DimsExprs* inputs, int nbInputs, IExprBuilder& exprBuilder) override; + bool supportsFormatCombination(int pos, const PluginTensorDesc* inOut, int nbInputs, int nbOutputs) override; + void configurePlugin( + const DynamicPluginTensorDesc* in, int nbInputs, const DynamicPluginTensorDesc* out, int nbOutputs) override; + size_t getWorkspaceSize( + const PluginTensorDesc* inputs, int nbInputs, const PluginTensorDesc* outputs, int nbOutputs) const override; + int enqueue(const PluginTensorDesc* inputDesc, const PluginTensorDesc* outputDesc, const void* const* inputs, + void* const* outputs, void* workspace, cudaStream_t stream) override; + private: NMSParameters param{}; int boxesSize{}; @@ -86,29 +115,44 @@ class BatchedNMSPlugin : public IPluginV2DynamicExt bool mClipBoxes{}; }; -class BatchedNMSPluginCreator : public BaseCreator +class BatchedNMSBasePluginCreator : public BaseCreator { public: - BatchedNMSPluginCreator(); - - ~BatchedNMSPluginCreator() override = default; + BatchedNMSBasePluginCreator(); + ~BatchedNMSBasePluginCreator() override = default; const char* getPluginName() const override; - const char* getPluginVersion() const override; - const PluginFieldCollection* getFieldNames() override; - IPluginV2DynamicExt* createPlugin(const char* name, const PluginFieldCollection* fc) override; - - IPluginV2DynamicExt* deserializePlugin(const char* name, const void* serialData, size_t serialLength) override; - -private: +protected: static PluginFieldCollection mFC; NMSParameters params; static std::vector mPluginAttributes; bool mClipBoxes; + std::string mPluginName; +}; + +class BatchedNMSPluginCreator : public BatchedNMSBasePluginCreator +{ +public: + BatchedNMSPluginCreator(); + ~BatchedNMSPluginCreator() override = default; + + IPluginV2Ext* createPlugin(const char* name, const PluginFieldCollection* fc) override; + IPluginV2Ext* deserializePlugin(const char* name, const void* serialData, size_t serialLength) override; }; + +class BatchedNMSDynamicPluginCreator : public BatchedNMSBasePluginCreator +{ +public: + BatchedNMSDynamicPluginCreator(); + ~BatchedNMSDynamicPluginCreator() override = default; + + IPluginV2DynamicExt* createPlugin(const char* name, const PluginFieldCollection* fc) override; + IPluginV2DynamicExt* deserializePlugin(const char* name, const void* serialData, size_t serialLength) override; +}; + } // namespace plugin } // namespace nvinfer1