MMDetection中的操作
1. 训练
python tools/train.py [configs_file] --gpus 1 --work_dir work_dirs
2. 测试
(1)Output pkl file
This command will output “results_name.pkl” file.
python tools/test.py [configs_file] [pth] --out results_name.pkl --eval bbox
python tools/test.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth --out=work_dirs/result.pkl --eval bbox
(2) Output 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
python tools/test.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth --eval bbox --eval-options "jsonfile_prefix=results"
3. 输出coco metric
python tools/analysis_tools/eval_metric.py [configs_file] [pkl_file] --eval bbox
python tools/analysis_tools/eval_metric.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py work_dirs/faster_rcnn_coco_result.pkl --eval bbox
4. 绘制PR曲线
python plot_pr_curve.py
5. Log Analysis
python tools/analysis_tools/analyze_logs.py plot_curve work_dirs/20211018_114826.log.json --keys loss_cls loss_bbox --out work_dirs/losses.pdf
6. Result Analysis(报错,页面太小)
python tools/analysis_tools/analyze_results.py work_dirs/faster_rcnn_r50_fpn_1x_coco.py work_dirs/faster_rcnn_coco_result.pkl work_dirs/show_dir
7. Visualize Datasets(显示images和GTs)
python tools/misc/browse_dataset.py configs/_base_/datasets/coco_detection.py --output-dir work_dirs/show_dataset_dir