四川城乡建设部网站,陕煤化建设集团网站,长沙这边网站建设,中装建设002822股吧首先需要训练#xff0c;训练会自动生成#xff1a;latest.pth 权重文件 根据权重文件生成“.pkl”文件#xff1b;
下面以faster_rcnn为例#xff0c;–out是只生成的权重文件地址#xff0c;result是生成的pkl文件名#xff1b;
python ./tools/test.py ./configs/… 首先需要训练训练会自动生成latest.pth 权重文件 根据权重文件生成“.pkl”文件
下面以faster_rcnn为例–out是只生成的权重文件地址result是生成的pkl文件名
python ./tools/test.py ./configs/faster_rcnn_r50_fpn_1x.py ./work_dirs/faster_rcnn_r50_fpn_1x/latest.pth --outresult.pkl绘制混淆矩阵 以faster_rcnn算法为例
# !python tools/analysis_tools/confusion_matrix.py -h!python tools/analysis_tools/confusion_matrix.py \configs/faster_rcnn/faster-rcnn_r50_fpn_2x_voc_cc.py \work_dirs/faster-rcnn_r50_fpn_2x_voc/result_epoch_24.pkl \work_dirs/faster-rcnn_r50_fpn_2x_voc \--show参考网站https://zhuanlan.zhihu.com/p/607576946
计算FLOPs和Params
python tools/get_flops.py ${CONFIG_FILE} [--shape ${INPUT_SHAPE}]其中“CONFIG_FILE”代表当前使用的算法“INPUT_SHAPE”代表输入图像的尺寸我每次输入都报错很难受。
案例
python tools/get_flops.py tools/analysis_tools/get_flops.py configs/faster_cnn/faster_cnn_r50_fpn_1x.coco.py由于每次输入[–shape ${INPUT_SHAPE}]都报错所以我没有输入在py文件里面改默认值作为输入。 后面我找到方法了如下
python tools/get_flops.py tools/analysis_tools/get_flops.py configs/faster_cnn/faster_cnn_r50_fpn_1x.coco.py --shape 1000 608其中“–shape 1000 608”代表输入图片的大小“31000608”代表3通道
参考文献https://zhuanlan.zhihu.com/p/607576946
输出 json result file
This command will output “results.bbox.json” file.
python tools/test.py [configs_file] [pth] --eval-options jsonfile_prefixresults_name --eval bbox