Skip to content

Commit a5cef12

Browse files
committed
添加一个更加具体的使用示例
1 parent 1cb084c commit a5cef12

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

readme.md

+43
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,49 @@ A Python-based **RGB/Co-RGB/RGB-D** salient object detection evaluation toolbox.
6767
5. 可选:
6868
1. 使用 `tools/converter.py` 直接从生成的npy文件中导出latex表格代码.
6969

70+
### 一个基本的执行流程
71+
72+
这里以我自己本地的configs文件夹中的RGB SOD的配置(需要根据实际情况进行必要的修改)为例.
73+
74+
```shell
75+
# 检查配置文件
76+
python tools/check_path.py --method-jsons configs/methods/rgb-sod/rgb_sod_methods.json --dataset-jsons configs/datasets/rgb_sod.json
77+
78+
# 在输出信息中没有不合理的地方后,开始进行评估
79+
# --dataset-json 数据集配置文件 configs/datasets/rgb_sod.json
80+
# --method-json 方法配置文件 configs/methods/rgb-sod/rgb_sod_methods.json
81+
# --metric-npy 输出评估结果数据到 output/rgb_sod/metrics.npy
82+
# --curves-npy 输出曲线数据到 output/rgb_sod/curves.npy
83+
# --record-txt 输出评估结果文本到 output/rgb_sod/results.txt
84+
# --record-xlsx 输出评估结果到excel文档 output/rgb_sod/results.xlsx
85+
# --metric-names 所有结果仅包含指标 mae fm em sm wfm 对应的信息
86+
# --include-methods 评估过程仅包含 configs/methods/rgb-sod/rgb_sod_methods.json 中包含的方法 MINet_R50_2020 GateNet_2020
87+
# --include-datasets 评估过程仅包含 configs/datasets/rgb_sod.json 中包含的数据集 PASCAL-S ECSSD
88+
python eval.py --dataset-json configs/datasets/rgb_sod.json --method-json configs/methods/rgb-sod/rgb_sod_methods.json --metric-npy output/rgb_sod/metrics.npy --curves-npy output/rgb_sod/curves.npy --record-txt output/rgb_sod/results.txt --record-xlsx output/rgb_sod/results.xlsx --metric-names mae fm em sm wfm --include-methods MINet_R50_2020 GateNet_2020 --include-datasets PASCAL-S ECSSD
89+
90+
# 得到曲线数据文件,即这里的 output/rgb_sod/curves.npy 文件后,就可以开始绘制图像了
91+
92+
# 简单的例子,下面指令执行后,结果保存为 output/rgb_sod/simple_curve_pr.pdf
93+
# --style-cfg 使用图像风格配置文件 examples/single_row_style.yml,这里子图较少,直接使用单行的配置
94+
# --num-rows 图像子图都位于一行
95+
# --curves-npys 将使用曲线数据文件 output/rgb_sod/curves.npy 来绘图
96+
# --mode pr: 绘制是pr曲线;fm: 绘制的是fm曲线
97+
# --save-name 图像保存路径,只需写出名字,代码会加上由前面指定的 --style-cfg 中的 `savefig.format` 项指定的格式后缀名
98+
python plot.py --style-cfg examples/single_row_style.yml --num-rows 1 --curves-npys output/rgb_sod/curves.npy --mode pr --save-name output/rgb_sod/simple_curve_pr
99+
100+
# 复杂的例子,下面指令执行后,结果保存为 output/rgb_sod/complex_curve_pr.pdf
101+
# --style-cfg 使用图像风格配置文件 examples/single_row_style.yml,这里子图较少,直接使用单行的配置
102+
# --num-rows 图像子图都位于一行
103+
# --curves-npys 将使用曲线数据文件 output/rgb_sod/curves.npy 来绘图
104+
# --our-methods 在图中使用红色实线加粗标注指定的方法 MINet_R50_2020
105+
# --num-col-legend 图像子图图示中信息的列数
106+
# --mode pr: 绘制是pr曲线;fm: 绘制的是fm曲线
107+
# --separated-legend 使用独立的图示
108+
# --sharey 使用共享的 y 轴刻度,这将仅在每行的第一个图上显示刻度值
109+
# --save-name 图像保存路径,只需写出名字,代码会加上由前面指定的 --style-cfg 中的 `savefig.format` 项指定的格式后缀名
110+
python plot.py --style-cfg examples/single_row_style.yml --num-rows 1 --curves-npys output/rgb_sod/curves.npy --our-methods MINet_R50_2020 --num-col-legend 1 --mode pr --separated-legend --sharey --save-name output/rgb_sod/complex_curve_pr
111+
```
112+
70113
## 相关文献
71114

72115
```text

0 commit comments

Comments
 (0)