Skip to content

Commit 7b3fae6

Browse files
authored
[Enhance]: Add documentation of result_analysis.py (open-mmlab#4642)
* Add result_analysis docs * Update docs
1 parent 3ea47f4 commit 7b3fae6

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

docs/useful_tools.md

+63
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,69 @@ Examples:
4848
average iter time: 1.1959 s/iter
4949
```
5050

51+
## Result Analysis
52+
53+
`tools/analysis_tools/analyze_results.py` calculates single image mAP and saves or shows the topk images with the highest and lowest scores based on prediction results.
54+
55+
**Usage**
56+
57+
```shell
58+
python tools/analysis_tools/analyze_results.py \
59+
${CONFIG} \
60+
${PREDICTION_PATH} \
61+
${SHOW_DIR} \
62+
[--show] \
63+
[--wait-time ${WAIT_TIME}] \
64+
[--topk ${TOPK}] \
65+
[--show-score-thr ${SHOW_SCORE_THR}] \
66+
[--cfg-options ${CFG_OPTIONS}]
67+
```
68+
69+
Description of all arguments:
70+
71+
- `config` : The path of a model config file.
72+
- `prediction_path`: Output result file in pickle format from `tools/test.py`
73+
- `show_dir`: Directory where painted GT and detection images will be saved
74+
- `--show`:Determines whether to show painted images, If not specified, it will be set to `False`
75+
- `--wait-time`: The interval of show (s), 0 is block
76+
- `--topk`: The number of saved images that have the highest and lowest `topk` scores after sorting. If not specified, it will be set to `20`.
77+
- `--show-score-thr`: Show score threshold. If not specified, it will be set to `0`.
78+
- `--cfg-options`: If specified, the key-value pair optional cfg will be merged into config file
79+
80+
**Examples**:
81+
82+
Assume that you have got result file in pickle format from `tools/test.py` in the path './result.pkl'.
83+
84+
1. Test Faster R-CNN and visualize the results, save images to the directory `results/`
85+
86+
```shell
87+
python tools/analysis_tools/analyze_results.py \
88+
configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
89+
result.pkl \
90+
results \
91+
--show
92+
```
93+
94+
2. Test Faster R-CNN and specified topk to 50, save images to the directory `results/`
95+
96+
```shell
97+
python tools/analysis_tools/analyze_results.py \
98+
configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
99+
result.pkl \
100+
results \
101+
--topk 50
102+
```
103+
104+
3. If you want to filter the low score prediction results, you can specify the `show_score_the` parameter
105+
106+
```shell
107+
python tools/analysis_tools/analyze_results.py \
108+
configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py \
109+
result.pkl \
110+
results \
111+
--show-score-thr 0.3
112+
```
113+
51114
## Visualization
52115

53116
### Visualize Datasets

0 commit comments

Comments
 (0)