Skip to content

Commit

Permalink
apps: recognition: fixes auto-download of VOC data
Browse files Browse the repository at this point in the history
  • Loading branch information
vedaldi committed Aug 21, 2013
1 parent 9c5e874 commit 27cc4d0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
8 changes: 3 additions & 5 deletions apps/recognition/experiments.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,20 @@ function experiments()
end
end


% print table
% print HTML table
pf('<table>\n') ;
ph('method', 'VOC07', 'Caltech 101', 'Scene 67', 'FMD') ;
pr('FV', ...
ge([tag '-voc07-fv'],'ap11'), ...
ge([tag '-caltech101-fv']), ...
ge([tag '-scene67-fv']), ...
ge([tag '-fmd-fv'])) ;
pr('FV+aug', ...
pr('FV + aug.', ...
ge([tag '-voc07-fv-aug'],'ap11'), ...
ge([tag '-caltech101-fv-aug']), ...
ge([tag '-scene67-fv-aug']), ...
ge([tag '-fmd-fv-aug'])) ;
pr('FV + SP', ...
pr('FV + s.p.', ...
ge([tag '-voc07-fv-sp'],'ap11'), ...
ge([tag '-caltech101-fv-sp']), ...
ge([tag '-scene67-fv-sp']), ...
Expand Down Expand Up @@ -217,4 +216,3 @@ function ph(varargin)
fprintf('<tr>') ;
for i=1:numel(varargin), fprintf('<th>%s</th>',varargin{i}) ; end
fprintf('</tr>\n') ;

34 changes: 32 additions & 2 deletions apps/recognition/setupVoc.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,45 @@
% IMDB = SETUPVOC(DATASETDIR, 'EDITION', '2007')

opts.edition = '2007' ;
opts.autoDownload = true ;
opts.lite = false ;
opts = vl_argparse(opts, varargin) ;

switch opts.edition
case {'2007', '2008', '2010', '2011', '2012'}
case '2007'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2007/VOCtrainval_06-Nov-2007.tar', ...
'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2007/VOCtest_06-Nov-2007.tar'} ;
case '2008'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2008/VOCtrainval_14-Jul-2008.tar'} ;
case '2009'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2009/VOCtrainval_11-May-2009.tar'} ;
case '2010'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2010/VOCtrainval_03-May-2010.tar'} ;
case '2011'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2011/VOCtrainval_25-May-2011.tar'} ;
case '2012'
urls = {'http://pascallin.ecs.soton.ac.uk/challenges/VOC/voc2012/VOCtrainval_11-May-2012.tar'} ;
otherwise
error('Unknown PASCAL VOC edition ''%s''.', opts.edition) ;
end

% Download and unpack
vl_xmkdir(datasetDir) ;
if exist(fullfile(datasetDir, ['VOC' opts.edition], 'Annotations'))
% ok
elseif exist(fullfile(datasetDir, 'VOCdevkit', ['VOC' opts.edition], 'Annotations'))
% ok
datasetDir = fullfile(datasetDir, 'VOCdevkit') ;
elseif opts.autoDownload
for i = 1:length(urls)
fprintf('Downloading VOC data ''%s'' to ''%s''. This will take a while.', urls{i}, datasetDir) ;
untar(urls{i}, datasetDir) ;
end
datasetDir = fullfile(datasetDir, 'VOCdevkit') ;
else
error('VOC data not found in %s', datasetDir) ;
end

imdb.images.id = [] ;
imdb.images.set = uint8([]) ;
imdb.images.name = {} ;
Expand All @@ -23,7 +53,7 @@
imdb.imageDir = fullfile(datasetDir, ['VOC', opts.edition], 'JPEGImages') ;

% Get the list of images
map = containers.Map() ;
map = containers.Map() ;
j = 0 ;
for si = 1:numel(imdb.meta.sets)
setName = imdb.meta.sets{si} ;
Expand Down

0 comments on commit 27cc4d0

Please sign in to comment.