弄了好几天终于能在FDDB数据集上测试自己用wider face数据集训练的的faster rcnn的检测器的性能了。

1、首先在官网http://vis-www.cs.umass.edu/fddb/index.html下载图片和标注文件,FDDB的标注文件,分为图片名称文件FDDB-fold-01.txt、对应的标注文件:FDDB-fold-01-ellispe.txt,各有10个,把10个文件按顺序合并,分别命名为Fold_all.txt和Elsp.txt.

2、读Fold.txt文件,依照顺序做人脸检测,将检测结果输出出来(我是将faster rcnn中test.py文件修改得到的检测结果)。

3、我的mxnet的faster rcnn生成的检测结果格式为<image name i> score x1 y1 x2 y2,与FDDB要求的格式http://vis-www.cs.umass.edu/fddb/README.txt不一致,所以写了个C++程序将我的输出格式转化为FDDB要求的格式

// ToFDDBResults.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<vector>
using namespace std;int _tmain(int argc, _TCHAR* argv[])
{ifstream InputFile("comp4_det_Foldall_face.txt");ofstream OutputFile("comp4_det_Foldall_face_results.txt");string line, ImageNameTemp;stringstream ss;int count = 1;vector<double> vec_score;vector<double> vec_x1;vector<double> vec_y1;vector<double> vec_x2;vector<double> vec_y2;double score, x1, y1, x2, y2;string ImageName;getline(InputFile, line);ss << line;ss >> ImageName >> score >> x1 >> y1 >> x2 >> y2;vec_score.push_back(score);vec_x1.push_back(x1);vec_y1.push_back(y1);vec_x2.push_back(x2);vec_y2.push_back(y2);ImageNameTemp = ImageName;while (getline(InputFile, line)){ss.str("");ss.clear();ss << line;ss >> ImageName >> score >> x1 >> y1 >> x2 >> y2;if (ImageName == ImageNameTemp){count++;vec_score.push_back(score);vec_x1.push_back(x1);vec_y1.push_back(y1);vec_x2.push_back(x2);vec_y2.push_back(y2);}else{OutputFile << ImageNameTemp << endl;OutputFile << count << endl;count = 1;for (int i = 0; i < vec_score.size(); i++){OutputFile << vec_x1[i] << " " << vec_y1[i] << " " << (vec_x2[i] - vec_x1[i]) << " "<< (vec_y2[i] - vec_y1[i]) << " " << vec_score[i] << endl;}vec_score.clear();vector<double>(vec_score).swap(vec_score);vec_x1.clear();vector<double>(vec_x1).swap(vec_x1);vec_y1.clear();vector<double>(vec_y1).swap(vec_y1);vec_x2.clear();vector<double>(vec_x2).swap(vec_x2);vec_y2.clear();vector<double>(vec_y2).swap(vec_y2);vec_score.push_back(score);vec_x1.push_back(x1);vec_y1.push_back(y1);vec_x2.push_back(x2);vec_y2.push_back(y2);}ImageNameTemp = ImageName;}OutputFile << ImageName << endl;OutputFile << count << endl;for (int i = 0; i < vec_score.size(); i++){OutputFile << vec_x1[i] << " " << vec_y1[i] << " " << (vec_x2[i] - vec_x1[i]) << " "<< (vec_y2[i] - vec_y1[i]) << " " << vec_score[i] << endl;}return 0;
}

4、在 http://vis-www.cs.umass.edu/fddb/results.html下载fddb evaluate代码,新建一个vs工程,配置好OPENCV,把evaluate中的源文件和头文件加进来,修改evaluate.cpp文件73行

string baseDir = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/";//FDDB图片路径,此路径下需包含文件夹2002,2003string listFile = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/Fold_all.txt";string detFile = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/comp4_det_Foldall_face_results.txt";//转化了格式后的结果文件string annotFile = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/Elsp.txt";

因为我直接在vs上运行,不在cmd上运行这个evaluate程序,所以注释以下几行 代码:

 //if(argc == 1)//{//  printUsage();//  return 0;//}

在项目的属性栏中做如下改动

编译,通过。生成ContROC.txt和 DiscROC.txt两个文件

5、安装GUNPLOT,我装的gp501-win32-mingw,

配置perl,参考https://jingyan.baidu.com/article/9f7e7ec0b798ae6f281554e9.html?st=2&os=0&bd_page_type=1&net_type=1安装好之后,修改下载的evaluate代码中的runEvaluate.pl文件:

#!/usr/bin/perl -wuse strict;#### VARIABLES TO EDIT ####
# where gnuplot is
my $GNUPLOT = "C:/Program Files (x86)/gnuplot/bin/gnuplot"; #gnuplot安装路径
# where the binary is
my $evaluateBin = "evaluate";
# where the images are
my $imDir = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing"; #FDDB图片路径
# where the folds are
my $fddbDir = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/FDDB-folds.txt";
# where the detections are
my $detDir = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/";
###########################my $detFormat = 0; # 0: rectangle, 1: ellipse 2: pixelssub 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 1,1\n";print GF "set output \"$pngFile\"\n";#print GF "set xtics 500\n";print GF "set ytics 0.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:2000]\n";print GF "set yr [0:1.0]\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 = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/ContROC.p";
my $gpFile1 = "C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/fddb/DistROC.p";
my $title = "tqy";# plot the two ROC curves using GNUplot
# plot the two ROC curves using GNUplot
makeGNUplotFile("C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/tempContROC.txt", $gpFile, $title, $detDir."ContROC.png");
makeGNUplotFile("C:/Users/qingyun.tang/Documents/Visual Studio 2013/Projects/FDDB_testing/FDDB_testing/tempDiscROC.txt", $gpFile1, $title, $detDir."DiscROC.png");

在命令行中runEvaluate.pl的路径下输入perl runEvaluate.pl,得到ContROC.p与DistROC.p。

6、打开gnuplot软件:

a、file->open->contROC.p b、file->output->contROC.p

在对应目录中生成contROC.png;
a、file->open->discROC.p  b、file->output->discROC.p
在对应目录中生成discROC.png

7、如果想将自己的结果与官网上其他公司公布的结果画在一起,在官网上下载ContROC.p,DiscRoc.p等,用写字板打开之后,将自己的检测结果添加进去,同样用gnuplot画出来就行。

在windows平台上测试自己的人脸检测算法在FDDB数据集相关推荐

  1. 基于Tusimple数据集在windows cpu上跑通车道线检测算法LSTR

    基于Tusimple数据集在windows cpu上跑通车道线检测算法LSTR PS:基于CULane数据集在windows cpu上跑通车道线检测算法LSTR参考: https://blog.csd ...

  2. 使用FDDB人脸样本检测库,测试自己的人脸检测算法性能并生成ROC曲线。

    一,说明及环境 网上有关FDDB人脸检测库的使用以及ROC文件生成的文章太少,并且都无法检测opencv中自带的人脸检测算法.最近 工作的原因,需要用到FDDB库检测我们自己的人脸检测算法性能.所以认 ...

  3. 人脸检测算法_目前最强!开源人脸检测算法:RetinaFace

    加入极市专业CV交流群,与6000+来自腾讯,华为,百度,北大,清华,中科院等名企名校视觉开发者互动交流!更有机会与李开复老师等大牛群内互动! 同时提供每月大咖直播分享.真实项目需求对接.干货资讯汇总 ...

  4. RetinaFace,最强开源人脸检测算法

    作者 | CV君 来源 | 我爱计算机视觉(ID:aicvmlaicvmlaicvml) 人脸检测为目标检测的特例,是商业化最早的目标检测算法,也是目前几乎各大 CV 方向 AI 公司的必争之地. W ...

  5. 目前最强开源人脸检测算法RetinaFace

    点击我爱计算机视觉标星,更快获取CVML新技术 人脸检测为目标检测的特例,是商业化最早的目标检测算法,也是目前几乎各大CV方向AI公司的必争之地. WIDER FACE数据集是由香港中文大学发布的大型 ...

  6. 细数 Windows 平台上的 NoSQL 数据库

    从可查询的分布式解决方案,如MongoDB,到简单的分布式Key/Value存储解决方案,如Cassandra.此外,还有Riak,Tokyo Cabinet,Voldemort,CouchDB和Re ...

  7. windows平台上实现websocket服务器

    windows平台上实现websocket服务器 目前做个项目需要做个带串口的测试软件,主要功能是一台电脑利用串口控制一台待测试设备,然后通过串口对他进行调试,同时使用串口采集其他测量设备的数值,将测 ...

  8. windows平台上的密码算法识别工具

    2011-04-11 21:00:00|  分类: 网络与信息安全|举报|字号 订阅      下载LOFTER我的照片书  | 今天在看雪上面看到几个windows平台上的密码算法识别工具,我对它们 ...

  9. x264代码剖析(一):图文详解x264在Windows平台上的搭建

    x264代码剖析(一):图文详解x264在Windows平台上的搭建 X264源码下载地址:http://ftp.videolan.org/pub/videolan/x264/ 平台:win7 PC. ...

  10. (转)在Windows平台上安装Node.js及NPM模块管理

    本文转载自:http://www.cnblogs.com/seanlv/archive/2011/11/22/2258716.html 之前9月份的时候我写了一篇关于如何在Windows平台上手工管理 ...

最新文章

  1. python莫比乌斯环_python基础|模块
  2. 国民认证科技有限公司助力构建我国可信网络空间
  3. 在Windows上运行Spark程序
  4. 想学好Java开发,你要做到这三点
  5. boost::regex模块实现以编程方式生成代码片段,以便剪切并粘贴到正则表达式源中测试程序
  6. 数据库高可用(HA)技术有哪些?
  7. 基于单机hdfs安装hive
  8. JSP之内置对象、作用域
  9. matlab的三维数组(三维矩阵)
  10. 调试wifi简单记录
  11. 环境土壤物理模型HYDRUS1D/2D/3D实践技术
  12. mybatis插件破解
  13. 日语---之百度百科
  14. 基于python的opencv计算机视觉基础知识及例程代码【视觉入门看这一篇就够了】
  15. 程序员的插画成长之路并不平坦
  16. 华芯超算技术负责人分享分布式存储技术核心
  17. 调用阿里云web API实现滑块验证码
  18. 手机上怎么打开md格式的文件_IPHONE手机转为安卓手机,iCloud上的日历迁移方法...
  19. Assimp库调用mtl加载obj模型
  20. C#如何获取本机网络ip地址

热门文章

  1. does not point to a valid jvm installation
  2. ”易书网“开发总结——技术篇
  3. 最小生成树算法之Prim(普里姆)算法
  4. [解决方案]ios用fd抓包进app无网络
  5. Android模拟器 使用 Fiddler抓包
  6. Spring实战(第4版)pdf
  7. Asymptotic I Catalan Number
  8. jquery outerhtml
  9. 联合概率分布、边缘概率分布
  10. java工程师考华为证有用吗_华为初级认证网络工程师有什么用?大学生适合考吗?...