弄了好几天终于能在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(