-Replaced ISliceLayer based paddings(reflection,constant and zero) with the IPluginV2 version for TensorRT >= 8.2.0

-Fixed demo build issue on Windows

Signed-off-by: perseusdg <harshvardhan.chandira@gmail.com>
This commit is contained in:
Harshvardhan Chandirasekar
2022-01-20 00:52:22 +05:30
committed by perseusdg
parent decd73d298
commit 6a133d8dec
2 changed files with 7 additions and 8 deletions
+3 -3
View File
@@ -46,9 +46,9 @@ int main(int argc, char *argv[]) {
std::string cfgPath = YAMLgetConf<std::string>(conf,"cfg_input", "../tests/darknet/cfg/yolo4tiny.cfg");
std::string namePath = YAMLgetConf<std::string>(conf,"name_input","../tests/darknet/names/coco.names");
#elif _WIN32
std::string input = YAMLgetConf(conf, "win_input", "..\\..\\..\\demo\\yolo_test.mp4");
std::string cfgPath = YAMLgetConf(conf,"cfg_win_input","..\\..\\..\\tests\\darknet\\cfg\\yolo4tiny.cfg");
std::string namePath = YAMLgetConf(conf,"name_win_input","..\\..\\..\\tests\\darknet\\names\\coco.names");
std::string input = YAMLgetConf<std::string>(conf, "win_input", "..\\..\\..\\demo\\yolo_test.mp4");
std::string cfgPath = YAMLgetConf<std::string>(conf,"cfg_win_input","..\\..\\..\\tests\\darknet\\cfg\\yolo4tiny.cfg");
std::string namePath = YAMLgetConf<std::string>(conf,"name_win_input","..\\..\\..\\tests\\darknet\\names\\coco.names");
#endif
if(!fileExist(input.c_str()))
FatalError("The given input video does not exist.");
+4 -5
View File
@@ -571,7 +571,7 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
float(NV_TENSORRT_MINOR)/10 +
float(NV_TENSORRT_PATCH)/100;
#if ((NV_TENSORRT_MAJOR == 8 && NV_TENSORRT_MINOR >= 2) || NV_TENSORRT_MAJOR > 8)
/*#if ((NV_TENSORRT_MAJOR == 8 && NV_TENSORRT_MINOR >= 2) || NV_TENSORRT_MAJOR > 8)
auto *lRT = networkRT->addSlice(*input,Dims3{0,0,0},Dims3{l->output_dim.c,l->output_dim.h,l->output_dim.w},Dims3{0,0,0});
if(l->padding_mode == PADDING_MODE_REFLECTION){
lRT->setMode(SliceMode::kREFLECT);
@@ -581,8 +581,8 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
}
checkNULL(lRT);
return lRT;
#else
//todo add PADDING_MODE_CONSTANT AND PADDING_MODE_ZERO for tensorrt versions < 8.2
#else*/
//todo use ISliceLayer for padding,currently using ISliceLayer for reflection padding generates an error with monodepth2
if(l->padding_mode == PADDING_MODE_REFLECTION){
auto creator = getPluginRegistry()->getPluginCreator("ReflectionPaddingRT_tkDNN","1");
std::vector<PluginField> mPluginAttributes;
@@ -623,8 +623,7 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
}
return nullptr;
#endif
}
ILayer* NetworkRT::convert_layer(ITensor *input, Activation *l) {