微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ubuntu下fddb评测

sing Caffe and python to reproduce the results of MTCNN on FDDB dataset.

References

  1. The implementation ofMTCNNusing python & caffe,thank the authorDuinoDu/mtcnn.
  2. (alternatively) We can convert the ellipse annotations into the rectangle annotations for better visualization. Thank the authorankanbansal/fddb-for-yolo.

Better visualization

We can use theconvertEllipsetoRectangle.pyto convert the FDDB-folds/FDDB-fold-01-ellipseList.txt into FDDB-folds/FDDB-fold-01-rectList.txt and show the converted bounding Boxes on the images.

Run MTCNN on general image

We can use thedemo.pyto run mtcnn framwork on general images. This file comes fromDuinoDu/mtcnn/demo.py.

Run MTCNN on FDDB dataset

We can use therunFDDB.pyto run mtcnn framwork onFDDB dataset.

The official evaluation of your results

Download the officialevaluation codeand use the commond 'make' in the evaluation folder. To evaluate the results/preditions of your framework,just use the following codes.

./evaluate -a ../data/FDDB-folds/ellipseList.txt -d ../data/FDDB-folds/predict.txt -l ../data/FDDB-folds/foldList.txt -f 0

Then tempContROC.txt and tempdiscROC.txt will be generated in the /data/FDDB-folds/.


注明添加然后就要进行到本文的重点了:运行评估程序,生成ROC曲线

在FDDB官网上下载评估程序:http://vis-www.cs.umass.edu/fddb/evaluation.tgz

尽管FDDB官网上FAQ做了说明,虽然我用mingw成功编译了evaluation,但是后续用perl生成ROC曲线脚本仍然有非windows的命令,所以这里我放弃了mingw的方法

转而使用了我最熟悉的vs。

建立VS工程FDDBEvaluation,将evaluation中的源码添加到工程,配置OPENCV等,修改main函数里以下内容


string baseDir = "F:/Data/FDDB/";
string listFile = "D:/fold_all.txt";
string detFile = "D:/output.txt";
string annotFile = "D:/Elsp_all.txt";

还要注意 detFormat = DET_RECTANGLE; 如果你的检测输出是椭圆,这里就要改成椭圆。

编译通过,运行。

运行结束之后,生成两个ROC文件

discRoc.txt和ContRoc.txt,这就是最终要画图ROC的数据。

4. 生成ROC图数据

安装perl,我装的是strawBerry-perl-5.22.0.1-64bit,网上搜索下载就行。

然后,修改官网提供的runEvaluate.pl,否则有些命令执行不了。。。

修改后是这样的:

#!/usr/bin/perl -w
use strict;
#### VARIABLES TO EDIT ####
# where gnuplot is
my $GNUPLOT = "D:/Program Files (x86)/gnuplot/bin/gnuplot";
# where the binary is
my $evaluateBin = "evaluate";
# where the images are
my $imDir = "F:/Data/FDDB";
# where the folds are
my $fddbDir = "F:/Data/FDDB/FDDB-folds";
# where the detections are
my $detDir = "D:/";
###########################


my $detFormat = 0; # 0: rectangle,1: ellipse 2: pixels


sub makeGNUplotFile
{
my $rocFile = shift;
my $gnuplotFile = shift;
my $title = shift;
my $pngFile = shift;


open(GF,">$gnuplotFile") or die "Can not open $gnuplotFile for writing\n";
#print GF "$GNUPLOT\n";
print GF "set term png\n";
print GF "set size .75,1\n";
print GF "set output \"$pngFile\"\n";
#print GF "set xtics 100\n";
#print GF "set logscale x\n";
print GF "set ytics .1\n";
print GF "set grid\n";
#print GF "set size ratio -1\n";
print GF "set ylabel \"True positive rate\"\n";
print GF "set xlabel \"False positives\"\n";
#print GF "set xr [0:500]\n";
print GF "set yr [0:1]\n";
print GF "set key right bottom\n";
print GF "plot \"$rocFile\" using 2:1 title \"$title\" with lines lw 2 \n";
close(GF);
}


my $gpFile = "D:/ContROC.p";
my $gpFile1 = "D:/discROC.p";
my $title = "zhouzhou";

# plot the two ROC curves using GNUplot
makeGNUplotFile("D:/ContROC.txt",$gpFile,$title,$detDir."ContROC.png");
makeGNUplotFile("D:/discROC.txt",$gpFile1,$detDir."discROC.png");

然后,cmd->perlrunEvaluate.pl

酱紫地:

然后就发现生成了两个.p文件


5. 画ROC曲线

安装GUNPLOT

Draw the ROC curves

  1. Install the toolBoxGnuplot.
  2. Using the following commond.
gnuplot contROC.p 
gnuplot discROC.p

We will get the tempContROC-MTCNN.png(tempdiscROC-MTCNN.png) and the ROC curves like this:

原文地址:https://www.jb51.cc/ubuntu/349370.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐