TCT模型部署步骤(3:代码修改)

1. 代码层面

  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项目

  1. 设为"启动项";
  2. 属性 --> 链接器 --> 命令行,在原内容后面空格添加/FORCE:MULTIPLE
 %(AdditionalOptions) /machine:x64 /FORCE:MULTIPLE 
  1. 属性--> 调试 --> 环境,添加:
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;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值