想通过该模型测试别的数据集,直接在config文件里的数据改掉就可以了
- 生成pkl文件,即保存的是坐标和得分
python tools/test.py G:/mmdetection-master/gfl/gfl_r50_fpn_1x_coco.py G:/mmdetection-master/gfl/epoch_20.pth --out=G:/mmdetection-master/gfl/result.pkl
2、通过添加–eval mAP 可显示测试结果,如下表格所示
python tools/test.py G:/mmdetection-master/gfl/gfl_r50_fpn_1x_coco.py G:/mmdetection-master/gfl/epoch_20.pth --out=G:/mmdetection-master/gfl/result.pkl --eval mAP
---------------iou_thr: 0.5---------------
+-------+------+------+--------+-------+
| class | gts | dets | recall | ap |
+-------+------+------+--------+-------+
| car | 7127 | 5993 | 0.598 | 0.535 |
+-------+------+------+--------+-------+
| mAP | | | | 0.535 |
+-------+------+------+--------+-------+
OrderedDict([('AP50', 0.535), ('mAP', 0.5354141592979431)])
3、添加下面这个可以直接保存图片
python tools/test.py G:/mmdetection-master/gfl.py G:/mmdetection-master/epoch_6.pth --eval mAP --show --show-dir G:/mmdetection-master/images/