DollarPedestrianDetectionCode
Piotr Dollár et. al. collected the Caltech Pedestrian Detection Benchmark, a set of data and code to evaluate pedestrian detection algorithms. The data base consists of sequences of annotated images acquired by a camera mounted on a car. The authors provide the data, some code that allow others to test their detector on that data and the results of many state-of-the-art detectors, both in a synthetic form (ROC curves), as well as in the extensive form (the actual detection bounding boxes for each image). The authors also provide other data sets and results converted to match their format.
In order to have the system running you should download Piotr's Matlab Toolbox, the Evaluation/Labelling code and the data (image sequences, ground truth bounding boxes and detection results bounding boxes). You have link to these on the main page of the Caltech Pedestrian Detection Benchmark.
For the code to work you need to have Matlab with the Image Toolbox installed.
Getting ready
You should unpack the Piotr's Matlab Toolbox somewhere and add it to the Matlab Path:
addpath(genpath('/home/matteo/PMT/')); savepath;
You should unpack the Evaluation/Labelling code in a directory that we will call $code (later, you should run Matlab from that directory).
All the files (image data bases, annotations, detection results) should be put in some standard subdirectories of $code/.
You have to have one subdirectory for each db, for instance, you need one for INRIA: $code/data-INRIA/. The names are standard, they're defined in some matlab file.
Inside the particular db directory, you need to have:
- the video subdirectory, $code/data-INRIA/videos, containing more subdirectories and the ".seq" files with the images
- the annotations subdirectory, $code/data-INRIA/annotations, containing more subdirectories and the ground truth annotations
- the res subdirectory, $code/data-INRIA/res, containing more subdirectories with the results of the detections obtained running various algorithms
Annotations are in the format: (x0, y0, deltaX, deltaY, confidence). The confidence value is used to plot the ROC curves. There is one annotation file for each image. I don't know if the top-left corner is (0,0) or (1,1).
Operations you want to do
Set the db you're working on
[pth,setIds,vidIds,skip,minHt] = dbInfo( 'inriatest' )
Show db images with annotations
vbbPlayer
Compute the ROC curves for the specified algorithms, on the current db
dbEval
Display images with GT annotations, the detections of a specific algorithm and their evaluation (true positive, false positive, etc.)
dbBrowser
You should set some parameters in dbBrowser.m, such as which algorithm's results you want to plot and if you want to resize the detected bounding boxes. I am not sure when you want to resize the bounding boxes, if it depends on the algorithm you are testing or on the data base you are using.
rPth=[pth '/res/HOG']; % directory containing results thr=[]; % detection threshold resize={100/128, 42/64, 0}; % controls resizing of detected bbs
This file writes plots in $code/results and data in $code/eval.
How to evaluate the results of your algorithm
You should repeat, for all the images in a given set:
- read one image
- run your classifier on it
- write the annotations in your results directory, e.g. $code/data-INRIA/res/myDetector/set01/V000/I00000.txt
Read one or more imags from a ".seq" file and write it to a regular file
Is = seqIo( 'data-INRIA/videos/set00/V000.seq', 'toImgs', '.', 1, 0, 2, 'png' ) input seq file command dest directory frames to skip first frame last frame format