diff --git a/README.md b/README.md index 39ef41a..8247edc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ NVIDIA DeepStream SDK 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 configuration for Y ### Future updates * DeepStream tutorials - * Updated INT8 calibration * Support for segmentation models * Support for classification models diff --git a/nvdsinfer_custom_impl_Yolo/yolo.cpp b/nvdsinfer_custom_impl_Yolo/yolo.cpp index 1bb203d..7118490 100644 --- a/nvdsinfer_custom_impl_Yolo/yolo.cpp +++ b/nvdsinfer_custom_impl_Yolo/yolo.cpp @@ -55,7 +55,7 @@ Yolo::createEngine(nvinfer1::IBuilder* builder, nvinfer1::IBuilderConfig* config assert(builder); nvinfer1::NetworkDefinitionCreationFlags flags = - (1U << static_cast(nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH)); + 1U << static_cast(nvinfer1::NetworkDefinitionCreationFlag::kEXPLICIT_BATCH); nvinfer1::INetworkDefinition* network = builder->createNetworkV2(flags); assert(network); @@ -64,7 +64,7 @@ Yolo::createEngine(nvinfer1::IBuilder* builder, nvinfer1::IBuilderConfig* config if (m_NetworkType == "onnx") { parser = nvonnxparser::createParser(*network, *builder->getLogger()); - if (!parser->parseFromFile(m_OnnxWtsFilePath.c_str(), static_cast(nvinfer1::ILogger::Severity::kWARNING))) { + if (!parser->parseFromFile(m_OnnxWtsFilePath.c_str(), static_cast(nvinfer1::ILogger::Severity::kWARNING))) { std::cerr << "\nCould not parse the ONNX model\n" << std::endl; #if NV_TENSORRT_MAJOR >= 8 @@ -99,7 +99,7 @@ Yolo::createEngine(nvinfer1::IBuilder* builder, nvinfer1::IBuilderConfig* config if (!m_ImplicitBatch && network->getInput(0)->getDimensions().d[0] == -1) { nvinfer1::IOptimizationProfile* profile = builder->createOptimizationProfile(); assert(profile); - for (int32_t i = 0; i < network->getNbInputs(); ++i) { + for (INT i = 0; i < network->getNbInputs(); ++i) { nvinfer1::ITensor* input = network->getInput(i); nvinfer1::Dims inputDims = input->getDimensions(); nvinfer1::Dims dims = inputDims; diff --git a/nvdsinfer_custom_impl_Yolo/yolo.h b/nvdsinfer_custom_impl_Yolo/yolo.h index 095aa9a..99008e2 100644 --- a/nvdsinfer_custom_impl_Yolo/yolo.h +++ b/nvdsinfer_custom_impl_Yolo/yolo.h @@ -41,6 +41,12 @@ #include "layers/pooling_layer.h" #include "layers/reorg_layer.h" +#if NV_TENSORRT_MAJOR >= 8 + #define INT int32_t +#else + #define INT int +#endif + struct NetworkInfo { std::string inputBlobName; diff --git a/nvdsinfer_custom_impl_Yolo/yoloPlugins.h b/nvdsinfer_custom_impl_Yolo/yoloPlugins.h index 8cee9ff..df35e70 100644 --- a/nvdsinfer_custom_impl_Yolo/yoloPlugins.h +++ b/nvdsinfer_custom_impl_Yolo/yoloPlugins.h @@ -38,12 +38,6 @@ } \ } -#if NV_TENSORRT_MAJOR >= 8 - #define INT int32_t -#else - #define INT int -#endif - namespace { const char* YOLOLAYER_PLUGIN_VERSION {"1"}; const char* YOLOLAYER_PLUGIN_NAME {"YoloLayer_TRT"};