1. 模型生成
模型需要根据电脑的配置来生成
1.1. 准备
- 依赖资源路径:
E:\Dev\TCTDetect\models\convert
1.2. 生成
1.2.1 生成 331_best.engine
E:\Dev\TCTDetect\models\convert 路径cmd运行
//可先运行以下,查看命令含义
yolov5_convert_anchor_2_gamma.exe
//./yolov5 -s [.wts] [.engine] [s/m/l/x/s6/m6/l6/x6 or c/c6 gd gw] [input_h] [input_w] [class_num] [batch_size] <calib_dir>// serialize model to plan file
//后直接运行
yolov5_convert_anchor_2_gamma.exe -s 331_best.wts 331_best.engine m6 1536 1536 45 8
1.2.1 生成 negative_yolo.engine
yolov5_convert_anchor_2_gamma.exe -s negative_yolo.wts negative_yolo.engine m6 1536 1536 45 8
2. config文件配置
2.1. 将源码文件中的config文件复制到tctdetect_build
2.2. 修改config文件中内容
2.2.1. "pre_treat"标签下:
1. "process_num" 调整为 6;
2. "queue_limit" 调整为 12;
2.2.2. "inference"标签下:
3. positive_engine_name 修改为本机331_best.engine路径;
4. negative_engine_name修改为本机negative_yolo.engine路径;
5. 如果电脑为单显卡,gpuid和gpuid2都设置为0;
6. "batch_size"调整为 8(和模型生成参数一致);