ICDAR 场景文本检测评价工具DetEval详解
首先安装DetEval工具,不同系统下载源如下:
Linux binaries for Ubuntu 14.04 https://perso.liris.cnrs.fr/christian.wolf/software/deteval/download/deteval-linux.tgz
带有源代码的Linux版:
https://perso.liris.cnrs.fr/christian.wolf/software/deteval/download/deteval-src-unix.tgz
Mac:
https://perso.liris.cnrs.fr/christian.wolf/software/deteval/download/deteval-macos.zip
Windows:
https://perso.liris.cnrs.fr/christian.wolf/software/deteval/download/deteval-setup.exe
测试文件,下文所有示例将使用此官方测试文件:
https://perso.liris.cnrs.fr/christian.wolf/software/deteval/download/testxmls.tgz
这是最重要的参考文件,安装可以跟着这个走:
https://perso.liris.cnrs.fr/christian.wolf/software/deteval/index.html
原理的话可以参考这篇博文:https://blog.csdn.net/weixin_35653315/article/details/71524828
以及这篇论文:
【Object count/Area Graphs for the Evaluation of Object Detection and Segmentation Algorithms】
命令解析
DetEval工具限定输入为XML文件
有四种运行模式:
固定参数evalfixed命令
最基本的命令,此命令下使用固定参数tr=0.8 tp=0.4
evalfixed detected.xml groundtruth.xml
测试输入:
evalfixed det1.xml gt.xml
输出结果:
<evaluation noImages="500">
<icdar2003 r="0.310036" p="0.236342" hmean="0.268219" noGT="580" noD="1012"/>
<score r="0.118966" p="0.0768775" hmean="0.093399" noGT="580" noD="1012"/>
</evaluation>
综合评价方法evalplots命令
此命令下的评价方法使用不同的tp与tr参数,同时计算the area under curve。具体计算方法参考论文。
evalplots detected.xml groundtruth.xml
测试输入:
evalplots det1.xml gt.xml
输出结果:
=============================================================
The plot data have been written into the directories
evalcurve-tr and evalcurve-tp.
=============================================================
Overall recall = 18.3
Overall precision = 15.9
Final single performance value: = 17.0
特别地,使用–doplot=true选项可直接显示图片
evalplots --doplot=true results-run1.xml groundtruth.xml
ROC曲线rocplot命令
画ROC曲线,受试者工作特征曲线(receiver operating characteristic curve)
此方法仅在检测算法参数可调的情况下成立,使用–doplot=true选项自动生成ROC曲线
rocplot groundtruth.xml det-param-034.xml det-param-076.xml det-param-110.xml det-param-234.xml det-param-343.xml
rocplot groundtruth.xml det-param-*.xml
比较不同检测评价结果readdeteval命令
readdeteval -c l evaluation-of-run1.xml evaluation-of-run2.xml
-c后接不同参数有不同输出
a … print all differences
g … print only results for images where recall or precision is higher in the first evaluation result XML file than in the second one.
l … print only results for images where recall or precision is lower in the first evaluation result XML file than in the second one.
想要看评估结果详细报告evaldetection命令
对数据集的评估分两步完成:在第一个评估步骤中,工具evaldetection为每个条目(每个图像)生成详细结果,并将它们收集在一个文件中。在第二步中,工具readdeteval读取评估报告并生成全局性能数字(统计数据)。
usage:
evaldetection [options] detection-xml groundtruth-xml
-p <options> Set the evaluation parameters:
-p <a>,<b>,<c>,<d>,<e>,<f>,<g>,<h>,<i>,<j>
Default values: 0.8,0.4,0.8,0.4,0.4,0.8,0,1
-d <count> How many levels in the image name path do we ignore
(detection-xml)
-g <count> How many levels in the image name path do we ignore
(groundtruth-xml)
-z Ignore detected rectangles having zero coordinates
-v Print version string
evaldetection results-run1.xml groundtruth.xml > eval-details.xml
第二步,使用readdeteval解析detail文件
readdeteval eval-detail.xml
备注:使用evalfixed也会自动生成eval-detail.xml文件,evalfixed命令集成了evaldection和readdeteval命令。