https://github.com/Maclory/SPSR
第一步:看评价指标的readme
https://github.com/Maclory/SPSR/tree/master/metrics
- 下载PI评估模型 place model.mat into MetricEvaluation/utils/sr-metric.
Configuration.yml
的介绍和使用
Pairs:
Dataset:
- Set5
- Set14
GTFolder:
- ../data/GT/Set5/HR
- ../data/GT/Set14/HR
SRFolder:
- ../data/SPSR_Paper/Set5
- ../data/SPSR_Paper/Set14
Name: Test
Echo: True
Pairs: The orders of the Dataset, GTFolder and SRFolder must match each other.
Dataset: The Datasets that need to be evaluated.
GTFolder: The folder path of ground-truth images.
SRFolder: The folder path of SR images.
Name: The evaluation's name.
Echo: Whether to echo scores while evaluating or not.回传数值么?
- 我们还提供
generate_configuration.py
来在有多个SR方法要计算时自动生成配置文件。
将不同方法的SR文件夹放到your_SR_Folder
中,并将ground-truth
文件夹放到your_GT_Folder
中 - 编辑
MethodDict
值。关键是方法,而值是要评估的数据集列表。The key is the method and the value is the list of datasets you want to evaluate.
MethodDict=dict()
MethodDict['EnhanceNet']=['BSD100', 'General100', 'Set14']
MethodDict['SRGAN']=['BSD100', 'General100', 'Set14', 'Set5', 'Urban100']
- 编辑
dataDict
的值.
fileName = method+'.yml'
dataDict=dict()
dataDict['Pairs']=dict()
dataDict['Pairs']['Dataset']=MethodDict[method]
dataDict['Pairs']['SRFolder']=[]
dataDict['Pairs']['GTFolder']=[]
dataDict['Name']=evaluation_name
dataDict['Echo']=True
for dataset in MethodDict[method]:
dataDict['Pairs']['SRFolder'].append(str(os.path.join('your_SR_Folder',method,dataset)))
dataDict['Pairs']['GTFolder'].append(str(os.path.join('your_GT_Folder','GT',dataset,'HR')))
dataDict['Name']是评估值的名称。
dataDict['Echo']是一个bool值,用于控制在求值时是否将分数输出到终端。
your_SR_Folder是存储SR结果的文件夹。
your_GT_Folder是存放GT数据集的文件夹。
python generate_configuration.py
python evaluate_sr_results.py Configuration.yml
- 如果使用bash的话
bash Run.bash
- The results will be generated in the
../evaluate/
folder as follows:
Name-%Y%m%d%H%M%S.log: Log files of evaluation.
Name-%Y%m%d%H%M%S: Folders to store evaluation data. .csv and .xlsx are provided.
第二步:怎么用这个工具箱
待定