1. 代码层面
TctDetect
项目,main.cpp
下:
//本机是单显卡,这里改为"false"
24 const bool TwoDetect = false;
---
//因为是单显卡,所以把79、80、82、83、84行注销掉
78 ObjectDetect od1(&pp, 1, inferConf.posEnginePath, inferConf.negEnginePath, inferConf.gpuid, inferConf.tileSize, inferConf.modelSize, size[0], size[1], inferConf.iouThres, inferConf.posConfThres, inferConf.negConfThres, inferConf.batchSize, inferConf.maxBatchNum, 1);
79 //ObjectDetect od2(&pp, 2, inferConf.posEnginePath, inferConf.negEnginePath, inferConf.gpuid2, inferConf.tileSize, inferConf.modelSize, size[0], size[1], inferConf.iouThres, inferConf.posConfThres, inferConf.negConfThres, inferConf.batchSize, inferConf.maxBatchNum, 1);
80 //vector<ObjectDetect*> ods = { &od1, &od2 };
81 vector<ObjectDetect*> ods = { &od1 };
82 //if (TwoDetect) {
83 // ObjectDetect od2(&pp, 2, inferConf.posEnginePath, inferConf.negEnginePath, inferConf.gpuid2, inferConf.tileSize, inferConf.modelSize, size[0], size[1], inferConf.iouThres, inferConf.posConfThres, inferConf.negConfThres, inferConf.batchSize, inferConf.maxBatchNum, 2);
84 // ods.push_back(&od2);
85 //}
2. Visual Studio配置修改
2.1. TctDetect项目
- 设为"启动项";
属性 --> 链接器 --> 命令行
,在原内容后面空格添加/FORCE:MULTIPLE
;
%(AdditionalOptions) /machine:x64 /FORCE:MULTIPLE
属性--> 调试 --> 环境
,添加:
PATH=E:\Dev\TCTDetect\libs\TensorRT-7.2.3.4\lib;E:\Dev\TCTDetect\libs\opencv452\build\x64\vc15\bin;E:\Dev\TCTDetect\libs\sdpc\lib\WINDOWS\x64\Release\dll;E:\Dev\TCTDetect\libs\openslide-win64-20171122\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin;