Home > samsung-code > benchmark_voc2007.m

benchmark_voc2007

PURPOSE ^

BENCHMARK_VOC2007 do benchmark test on PASCAL VOC2007 test set using the trained detection models

SYNOPSIS ^

function benchmark_voc2007( model_type, gp_enabled )

DESCRIPTION ^

 BENCHMARK_VOC2007 do benchmark test on PASCAL VOC2007 test set using the trained detection models
 
 Usage:
   BENCHMARK_VOC2007( MODEL_TYPE, GP_ENABLED ) benchmark using specific
   classifier model with/without the Gaussian process (GP) based fine-
   grained target search (FTS)

   MODEL_TYPE can be a string naming the classifier model type:
       'struct' - (linear) structured SVM, 
                  use the models in ./models_svm_linear
       'linear' - ordinary linear SVM
                  use the models in ./models_svm_struct

   GP_ENABLED can be 0 or 1 (default)
       0 - Only selective search is used to propose regions
       1 - GP-based FTS will be applied afterward.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function benchmark_voc2007( model_type, gp_enabled )
0002 % BENCHMARK_VOC2007 do benchmark test on PASCAL VOC2007 test set using the trained detection models
0003 %
0004 % Usage:
0005 %   BENCHMARK_VOC2007( MODEL_TYPE, GP_ENABLED ) benchmark using specific
0006 %   classifier model with/without the Gaussian process (GP) based fine-
0007 %   grained target search (FTS)
0008 %
0009 %   MODEL_TYPE can be a string naming the classifier model type:
0010 %       'struct' - (linear) structured SVM,
0011 %                  use the models in ./models_svm_linear
0012 %       'linear' - ordinary linear SVM
0013 %                  use the models in ./models_svm_struct
0014 %
0015 %   GP_ENABLED can be 0 or 1 (default)
0016 %       0 - Only selective search is used to propose regions
0017 %       1 - GP-based FTS will be applied afterward.
0018 %
0019 
0020 
0021 if ~exist( 'model_type', 'var' ) || isempty(model_type)
0022     model_type = 'struct';
0023 end
0024 
0025 if ~exist('gp_enabled','var') || isempty(gp_enabled)
0026     gp_enabled = 1;
0027 end
0028 
0029 detInitPath;
0030 
0031 if exist('caffe','file') == 3
0032     [RECALL,PREC,AP,categ_list]=detVOC2007(model_type, gp_enabled, 1);
0033 else
0034     [RECALL,PREC,AP,categ_list]=detVOC2007(model_type, gp_enabled,-1);
0035 end
0036 
0037 gp_flags_str = { 'with-gp', 'no-gp' };
0038 SUMMARY_FILENAME = fullfile('voc2007_results_cache', ...
0039     [model_type '_' gp_flags_str{2-gp_enabled} '.mat']);
0040 
0041 save( SUMMARY_FILENAME, 'RECALL', 'PREC', 'AP', 'categ_list' );
0042 fprintf( 'Results are saved to %s\n', SUMMARY_FILENAME );
0043 
0044 cellfun( @(t,a) fprintf('%10s : \t%.2f%%\n',t,a*100), ...
0045     [vec(categ_list);'mAP'], num2cell([AP;mean(AP)]) );
0046 
0047 clf
0048 for c = 1:length(categ_list)
0049     subplot( 4, ceil(length(categ_list)/4), c );
0050     plot( RECALL{c}, PREC{c} );
0051     xlabel( 'recall' );
0052     ylabel( 'prec' );
0053     title( sprintf('%s - AP: %f', categ_list{c}, AP(c) ) );
0054 end
0055 
0056 end

Generated on Thu 18-Dec-2014 22:27:44 by m2html © 2005