Commit 02623626 authored by Ross Girshick's avatar Ross Girshick
Browse files

* fix caffe net paths

* add origin note to selective search proposals code
* remove outdated nms threshold tuning code
parent 0743a72c
.nfs*
feat_cache/*
graveyard
*.mat
bin/*
selective_search/SelectiveSearchCodeIJCV
data/caffe_nets
data/rcnn_models
data/selective_search_data
data/window_files
......@@ -6,6 +6,8 @@ Created by Ross Girshick, Jeff Donahue, Trevor Darrell and Jitendra Malik at UC
R-CNN is a state-of-the-art visual object detection system that combines bottom-up region proposals with rich features computed by a convolutional neural network. At the time of its release, R-CNN improved the previous best detection performance on PASCAL VOC 2012 by 30% relative, going from 40.9% to 53.3% mean average precision. Unlike the previous best results, R-CNN achieves this performance without using contextual rescoring or an ensemble of feature types.
R-CNN was initially described in an [arXiv tech report](http://arxiv.org/abs/1311.2524) and will appear in a forthcoming CVPR 2014 paper.
### Citing R-CNN
If you find R-CNN useful in your research, please consider citing:
......
function [best_thresh, best_ap, res] = nms_tune_threshold(cls, testset, year)
conf = voc_config('pascal.year', year, ...
'eval.test_set', testset);
cachedir = conf.paths.model_dir;
VOCopts = conf.pascal.VOCopts;
load([cachedir cls '_boxes_' testset '_' year]);
threshs = 0.1:0.05:0.5;
best_ap = 0;
res = zeros(length(threshs), 2);
for i = 1:length(threshs)
thresh = threshs(i);
ap_auc = compute_at_nms_thresh(cls, boxes, thresh, VOCopts);
res(i,:) = [thresh ap_auc];
if ap_auc > best_ap
best_thresh = thresh;
best_ap = ap_auc;
fprintf('!!! %s AP = %.3f @ thresh = %.3f\n', cls, best_ap, thresh);
end
end
function ap_auc = compute_at_nms_thresh(cls, boxes, thresh, VOCopts)
image_ids = textread(sprintf(VOCopts.imgsetpath, VOCopts.testset), '%s');
% write out detections in PASCAL format and score
fid = fopen(sprintf(VOCopts.detrespath, 'comp3', cls), 'w');
for i = 1:length(image_ids);
bbox = boxes{i};
keep = nms(bbox, thresh);
bbox = bbox(keep,:);
for j = 1:size(bbox,1)
fprintf(fid, '%s %f %d %d %d %d\n', image_ids{i}, bbox(j,end), bbox(j,1:4));
end
end
fclose(fid);
tic;
[recall, prec, ap_auc] = x10VOCevaldet(VOCopts, 'comp3', cls, true);
%ap_auc = xVOCap(recall, prec);
......@@ -7,7 +7,7 @@ ip.addOptional('end', 0, @isscalar);
ip.addOptional('crop_mode', 'warp', @isstr);
ip.addOptional('crop_padding', 16, @isscalar);
ip.addOptional('net_file', ...
'./external/caffe/snapshots/v1/finetune_voc_2007_trainval_iter_70000', ...
'./data/caffe_nets/finetune_voc_2007_trainval_iter_70k', ...
@isstr);
ip.addOptional('cache_name', ...
'v1_finetune_voc_2007_trainval_iter_70000', @isstr);
......
......@@ -18,3 +18,10 @@ dets = rcnn_detect(im, rcnn_model);
% show top scoring bicycle detection
showboxes(im, dets{2}(1,:));
title(sprintf('bicycle conf = %.3f', dets{2}(1,end)));
fprintf('\n> Press any key to see the top scoring person detection.');
pause;
% show top scoring person detection
showboxes(im, dets{15}(1,:));
title(sprintf('person conf = %.3f', dets{15}(1,end)));
......@@ -20,7 +20,6 @@ function [rcnn_model, rcnn_k_fold_model] = ...
ip = inputParser;
ip.addRequired('imdb', @isstruct);
ip.addParamValue('cache_name', 'none', @isstr);
ip.addParamValue('svm_C', 10^-3, @isscalar);
ip.addParamValue('bias_mult', 10, @isscalar);
ip.addParamValue('pos_loss_weight', 2, @isscalar);
......@@ -30,8 +29,11 @@ ip.addParamValue('checkpoint', 0, @isscalar);
ip.addParamValue('crop_mode', 'warp', @isstr);
ip.addParamValue('crop_padding', 16, @isscalar);
ip.addParamValue('net_file', ...
'./external/caffe/snapshots/v1/finetune_voc_2007_trainval_iter_70000', ...
'./data/caffe_nets/finetune_voc_2007_trainval_iter_70k', ...
@isstr);
ip.addParamValue('cache_name', ...
'v1_finetune_voc_2007_trainval_iter_70000', @isstr);
ip.parse(imdb, varargin{:});
opts = ip.Results;
......
function boxes = selective_search_boxes(im, fast_mode)
% Based on the demo.m file included in the Selective Search
% IJCV code.
if ~exist('fast_mode', 'var') || isempty(fast_mode)
fast_mode = true;
end
......
function vis_crops(imdb)
opts.net_file = './external/caffe/snapshots/v1/finetune_voc_2007_trainval_iter_70000';
opts.net_file = './data/caffe_nets/finetune_voc_2007_trainval_iter_70k';
opts.net_def_file = './model-defs/rcnn_batch_256_output_pool5.prototxt';
% load the region of interest database
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment