金融公司网站建设模板下载手机系统优化软件
-
首先需要训练,训练会自动生成: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 --out=result.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”代表输入图片的大小,“3,1000,608”代表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_prefix=results_name" --eval bbox