function PROC_SSDB_Feat_Soup_To_Nuts(FunctionName,NewLabel, options);
%function PROC_SSDB_Feat_Soup_To_Nuts(FunctionName,NewLabel, options);
%
%Builds feature, trains and tests classifier, shows results.
here = pwd;
cd /cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector
d.bOverwrite = 0;
d.TestNumber = 1;
d.SoupToNutsShowGraphs = 0;
options = ResolveMissingOptions(options,d);
SSPartsToDo = [1,2,3,4,11,12,13,14,18,19,20];
p = randperm(length(SSPartsToDo));
for i = SSPartsToDo(p)
  options.bMandateSourceIndex = i;
  PROC_StreetScenesDBToNewFeature(FunctionName, NewLabel, options);
end
Root =  '/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector';
names = {'car','pedestrian','bicycle'};
for iObjType = 1:3
  on = names{iObjType};
  Template = sprintf('%s_%s_f*.mat',NewLabel, on);
  objidx = iObjType;
  opts.RandSeed = 1;
  opts.bRandsplit = 1; %0 means that we will take the first 2/3 for training
  opts.ClassifierName = 'libsvm';
  opts.bNormalizeDataSamples = 3;
  options = ResolveMissingOptions(options,opts);
  varn = 'C1X';
  ROCsavename = sprintf('RocsPlus/%s_Test%.3d_%s.mat',NewLabel,options.TestNumber,on);
  addpath('/cbcl/scratch01/liorwolf/libsvm/libsvm-mat-2.8-1/');
  GetShapeBasedROCPerformance_Advanced(Root, Template, varn, objidx, options, ROCsavename);
end
if(options.SoupToNutsShowGraphs);
  for iObjType = 1:3
    on = names{iObjType};
    figure( iObjType);
    ca{1} = sprintf('%s_Test%.3d_%s.mat',NewLabel,options.TestNumber,on);
    ca{2} = sprintf('C1_likeToyota_%s.mat',on);
    FIGURE_ShowROC_SSDBResults(ca);
  end
end
cd(here);
 
