Contents

% DEMO: Training Exemplar-SVMs from synthetic data
% This function can generate a nice HTML page by calling:
% publish('esvm_demo_train_synthetic.m','html')
%
% Copyright (C) 2011-12 by Tomasz Malisiewicz
% All rights reserved.
%
% This file is part of the Exemplar-SVM library and is made
% available under the terms of the MIT license (see COPYING file).
% Project homepage: https://github.com/quantombone/exemplarsvm
function [models,M] = esvm_demo_train_synthetic
addpath(genpath(pwd))

Create a synthetic dataset of circles on a random background

Npos = 100;
Nneg = 50;
[pos_set,neg_set] = esvm_generate_dataset(Npos,Nneg);

models_name = 'circle';

Set exemplar-initialization parameters

params = esvm_get_default_params;
params.init_params.sbin = 4;
params.init_params.MAXDIM = 6;
params.model_type = 'exemplar';

%enable display so that nice visualizations pop up during learning
params.dataset_params.display = 1;

%if localdir is not set, we do not dump files
%params.dataset_params.localdir = '/nfs/baikal/tmalisie/synthetic/';

%%Initialize exemplar stream
stream_params.stream_set_name = 'trainval';
stream_params.stream_max_ex = 10;
stream_params.must_have_seg = 0;
stream_params.must_have_seg_string = '';
stream_params.model_type = 'exemplar'; %must be scene or exemplar
%assign pos_set as variable, because we need it for visualization
stream_params.pos_set = pos_set;
stream_params.cls = models_name;

Get the positive stream

e_stream_set = esvm_get_pascal_stream(stream_params, ...
                                      params.dataset_params);

% break it up into a set of held out negatives, and the ones used
% for mining
val_neg_set = neg_set((Nneg/2+1):end);
neg_set = neg_set(1:((Nneg/2)));
..........

Initialize Exemplars

initial_models = esvm_initialize_exemplars(e_stream_set, params, ...
                                           models_name);
.initialized with HOG_size = [6 6]
.initialized with HOG_size = [5 6]
.initialized with HOG_size = [6 6]
.initialized with HOG_size = [6 6]
.initialized with HOG_size = [5 6]
.initialized with HOG_size = [6 6]
.initialized with HOG_size = [6 6]
.initialized with HOG_size = [5 6]
.initialized with HOG_size = [6 5]
.initialized with HOG_size = [6 6]

Set exemplar-svm training parameters

train_params = params;
train_params.detect_max_scale = 1.0;
train_params.train_max_mined_images = 50;
train_params.detect_exemplar_nms_os_threshold = 1.0;
train_params.detect_max_windows_per_exemplar = 100;

Perform Exemplar-SVM training

[models] = esvm_train_exemplars(initial_models, ...
                                neg_set, train_params);
Randomizing mining queue
Found 0200 windows, image:00018 (#seen=00001/00025, max = 7.306)
Found 0200 windows, image:00017 (#seen=00002/00025, max = 7.258)
Found 0200 windows, image:00003 (#seen=00003/00025, max = 7.235)
Found 0200 windows, image:00013 (#seen=00004/00025, max = 7.212)
Found 0200 windows, image:00020 (#seen=00005/00025, max = 7.158)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.209 sec,  kept 90 negatives
Found 0009 windows, image:00019 (#seen=00006/00025, max = -0.817)
Found 0018 windows, image:00002 (#seen=00007/00025, max = -0.892)
Found 0009 windows, image:00007 (#seen=00008/00025, max = -0.951)
Found 0011 windows, image:00006 (#seen=00009/00025, max = -0.931)
Found 0016 windows, image:00016 (#seen=00010/00025, max = -0.872)
Found 0047 windows, image:00023 (#seen=00011/00025, max = -0.766)
Found 0015 windows, image:00010 (#seen=00012/00025, max = -0.914)
Found 0034 windows, image:00014 (#seen=00013/00025, max = -0.899)
Found 0009 windows, image:00009 (#seen=00014/00025, max = -0.884)
Found 0016 windows, image:00008 (#seen=00015/00025, max = -0.930)
Found 0014 windows, image:00015 (#seen=00016/00025, max = -0.838)
Found 0014 windows, image:00011 (#seen=00017/00025, max = -0.931)
Found 0038 windows, image:00001 (#seen=00018/00025, max = -0.884)
Found 0015 windows, image:00005 (#seen=00019/00025, max = -0.867)
Found 0021 windows, image:00004 (#seen=00020/00025, max = -0.922)
Found 0017 windows, image:00021 (#seen=00021/00025, max = -0.928)
Found 0011 windows, image:00022 (#seen=00022/00025, max = -0.945)
Found 0017 windows, image:00012 (#seen=00023/00025, max = -0.921)
Found 0036 windows, image:00025 (#seen=00024/00025, max = -0.825)
Found 0014 windows, image:00024 (#seen=00025/00025, max = -0.849)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=471  --- Max positive is 1.000
SVM iteration took 0.146 sec,  kept 141 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00022 (#seen=00001/00025, max = 5.907)
Found 0200 windows, image:00015 (#seen=00002/00025, max = 6.724)
Found 0200 windows, image:00017 (#seen=00003/00025, max = 6.018)
Found 0200 windows, image:00003 (#seen=00004/00025, max = 6.097)
Found 0200 windows, image:00001 (#seen=00005/00025, max = 6.086)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.172 sec,  kept 102 negatives
Found 0032 windows, image:00016 (#seen=00006/00025, max = -0.869)
Found 0020 windows, image:00024 (#seen=00007/00025, max = -0.908)
Found 0008 windows, image:00009 (#seen=00008/00025, max = -0.908)
Found 0008 windows, image:00004 (#seen=00009/00025, max = -0.949)
Found 0020 windows, image:00010 (#seen=00010/00025, max = -0.857)
Found 0023 windows, image:00007 (#seen=00011/00025, max = -0.943)
Found 0015 windows, image:00020 (#seen=00012/00025, max = -0.882)
Found 0026 windows, image:00014 (#seen=00013/00025, max = -0.812)
Found 0018 windows, image:00019 (#seen=00014/00025, max = -0.940)
Found 0012 windows, image:00005 (#seen=00015/00025, max = -0.826)
Found 0020 windows, image:00021 (#seen=00016/00025, max = -0.842)
Found 0017 windows, image:00018 (#seen=00017/00025, max = -0.914)
Found 0012 windows, image:00006 (#seen=00018/00025, max = -0.872)
Found 0007 windows, image:00002 (#seen=00019/00025, max = -0.868)
Found 0016 windows, image:00013 (#seen=00020/00025, max = -0.883)
Found 0027 windows, image:00025 (#seen=00021/00025, max = -0.797)
Found 0014 windows, image:00011 (#seen=00022/00025, max = -0.878)
Found 0009 windows, image:00008 (#seen=00023/00025, max = -0.920)
Found 0036 windows, image:00023 (#seen=00024/00025, max = -0.836)
Found 0018 windows, image:00012 (#seen=00025/00025, max = -0.877)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=460  --- Max positive is 1.000
SVM iteration took 0.101 sec,  kept 108 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00016 (#seen=00001/00025, max = 7.259)
Found 0200 windows, image:00007 (#seen=00002/00025, max = 7.078)
Found 0200 windows, image:00010 (#seen=00003/00025, max = 6.891)
Found 0200 windows, image:00013 (#seen=00004/00025, max = 7.029)
Found 0200 windows, image:00008 (#seen=00005/00025, max = 7.188)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.237 sec,  kept 90 negatives
Found 0200 windows, image:00001 (#seen=00006/00025, max = -0.708)
Found 0200 windows, image:00006 (#seen=00007/00025, max = -0.772)
Found 0200 windows, image:00014 (#seen=00008/00025, max = -0.789)
Found 0200 windows, image:00023 (#seen=00009/00025, max = -0.753)
Found 0200 windows, image:00004 (#seen=00010/00025, max = -0.723)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1090  --- Max positive is 1.000
SVM iteration took 0.293 sec,  kept 99 negatives
Found 0014 windows, image:00024 (#seen=00011/00025, max = -0.919)
Found 0009 windows, image:00025 (#seen=00012/00025, max = -0.939)
Found 0004 windows, image:00021 (#seen=00013/00025, max = -0.928)
Found 0004 windows, image:00015 (#seen=00014/00025, max = -0.901)
Found 0009 windows, image:00020 (#seen=00015/00025, max = -0.967)
Found 0007 windows, image:00012 (#seen=00016/00025, max = -0.964)
Found 0006 windows, image:00022 (#seen=00017/00025, max = -0.896)
Found 0014 windows, image:00005 (#seen=00018/00025, max = -0.812)
Found 0013 windows, image:00009 (#seen=00019/00025, max = -0.899)
Found 0004 windows, image:00019 (#seen=00020/00025, max = -0.905)
Found 0007 windows, image:00002 (#seen=00021/00025, max = -0.935)
Found 0012 windows, image:00018 (#seen=00022/00025, max = -0.901)
Found 0020 windows, image:00003 (#seen=00023/00025, max = -0.844)
Found 0012 windows, image:00011 (#seen=00024/00025, max = -0.929)
Found 0003 windows, image:00017 (#seen=00025/00025, max = -0.972)
# Violating images: 15, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=237  --- Max positive is 1.000
SVM iteration took 0.085 sec,  kept 81 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00006 (#seen=00001/00025, max = 7.198)
Found 0200 windows, image:00008 (#seen=00002/00025, max = 7.264)
Found 0200 windows, image:00013 (#seen=00003/00025, max = 6.992)
Found 0200 windows, image:00025 (#seen=00004/00025, max = 7.447)
Found 0200 windows, image:00017 (#seen=00005/00025, max = 7.122)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.266 sec,  kept 90 negatives
Found 0012 windows, image:00015 (#seen=00006/00025, max = -0.917)
Found 0010 windows, image:00016 (#seen=00007/00025, max = -0.889)
Found 0020 windows, image:00024 (#seen=00008/00025, max = -0.923)
Found 0023 windows, image:00002 (#seen=00009/00025, max = -0.907)
Found 0014 windows, image:00010 (#seen=00010/00025, max = -0.890)
Found 0021 windows, image:00001 (#seen=00011/00025, max = -0.919)
Found 0015 windows, image:00005 (#seen=00012/00025, max = -0.922)
Found 0020 windows, image:00014 (#seen=00013/00025, max = -0.914)
Found 0014 windows, image:00020 (#seen=00014/00025, max = -0.926)
Found 0015 windows, image:00011 (#seen=00015/00025, max = -0.906)
Found 0021 windows, image:00012 (#seen=00016/00025, max = -0.927)
Found 0015 windows, image:00009 (#seen=00017/00025, max = -0.890)
Found 0025 windows, image:00019 (#seen=00018/00025, max = -0.900)
Found 0026 windows, image:00021 (#seen=00019/00025, max = -0.923)
Found 0039 windows, image:00023 (#seen=00020/00025, max = -0.791)
Found 0015 windows, image:00003 (#seen=00021/00025, max = -0.882)
Found 0015 windows, image:00007 (#seen=00022/00025, max = -0.863)
Found 0019 windows, image:00018 (#seen=00023/00025, max = -0.892)
Found 0032 windows, image:00004 (#seen=00024/00025, max = -0.850)
Found 0019 windows, image:00022 (#seen=00025/00025, max = -0.890)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=480  --- Max positive is 1.000
SVM iteration took 0.246 sec,  kept 144 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00016 (#seen=00001/00025, max = 6.116)
Found 0200 windows, image:00021 (#seen=00002/00025, max = 5.872)
Found 0200 windows, image:00017 (#seen=00003/00025, max = 6.074)
Found 0200 windows, image:00018 (#seen=00004/00025, max = 6.016)
Found 0200 windows, image:00024 (#seen=00005/00025, max = 6.411)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.222 sec,  kept 123 negatives
Found 0013 windows, image:00011 (#seen=00006/00025, max = -0.899)
Found 0027 windows, image:00015 (#seen=00007/00025, max = -0.918)
Found 0021 windows, image:00001 (#seen=00008/00025, max = -0.856)
Found 0013 windows, image:00002 (#seen=00009/00025, max = -0.887)
Found 0022 windows, image:00020 (#seen=00010/00025, max = -0.871)
Found 0027 windows, image:00014 (#seen=00011/00025, max = -0.880)
Found 0015 windows, image:00012 (#seen=00012/00025, max = -0.878)
Found 0026 windows, image:00023 (#seen=00013/00025, max = -0.870)
Found 0024 windows, image:00003 (#seen=00014/00025, max = -0.872)
Found 0015 windows, image:00004 (#seen=00015/00025, max = -0.943)
Found 0017 windows, image:00008 (#seen=00016/00025, max = -0.933)
Found 0012 windows, image:00005 (#seen=00017/00025, max = -0.870)
Found 0017 windows, image:00025 (#seen=00018/00025, max = -0.913)
Found 0012 windows, image:00009 (#seen=00019/00025, max = -0.887)
Found 0028 windows, image:00006 (#seen=00020/00025, max = -0.881)
Found 0010 windows, image:00010 (#seen=00021/00025, max = -0.849)
Found 0024 windows, image:00019 (#seen=00022/00025, max = -0.882)
Found 0025 windows, image:00007 (#seen=00023/00025, max = -0.880)
Found 0010 windows, image:00022 (#seen=00024/00025, max = -0.938)
Found 0012 windows, image:00013 (#seen=00025/00025, max = -0.914)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=493  --- Max positive is 1.000
SVM iteration took 0.147 sec,  kept 135 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00020 (#seen=00001/00025, max = 6.834)
Found 0200 windows, image:00024 (#seen=00002/00025, max = 6.805)
Found 0200 windows, image:00018 (#seen=00003/00025, max = 7.254)
Found 0200 windows, image:00021 (#seen=00004/00025, max = 6.905)
Found 0200 windows, image:00005 (#seen=00005/00025, max = 6.985)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.287 sec,  kept 114 negatives
Found 0044 windows, image:00007 (#seen=00006/00025, max = -0.855)
Found 0043 windows, image:00025 (#seen=00007/00025, max = -0.840)
Found 0022 windows, image:00013 (#seen=00008/00025, max = -0.903)
Found 0022 windows, image:00012 (#seen=00009/00025, max = -0.907)
Found 0031 windows, image:00009 (#seen=00010/00025, max = -0.823)
Found 0014 windows, image:00003 (#seen=00011/00025, max = -0.921)
Found 0013 windows, image:00019 (#seen=00012/00025, max = -0.915)
Found 0032 windows, image:00001 (#seen=00013/00025, max = -0.850)
Found 0037 windows, image:00004 (#seen=00014/00025, max = -0.873)
Found 0018 windows, image:00017 (#seen=00015/00025, max = -0.948)
Found 0015 windows, image:00016 (#seen=00016/00025, max = -0.893)
Found 0025 windows, image:00011 (#seen=00017/00025, max = -0.908)
Found 0030 windows, image:00010 (#seen=00018/00025, max = -0.872)
Found 0022 windows, image:00022 (#seen=00019/00025, max = -0.830)
Found 0010 windows, image:00006 (#seen=00020/00025, max = -0.931)
Found 0028 windows, image:00015 (#seen=00021/00025, max = -0.869)
Found 0025 windows, image:00008 (#seen=00022/00025, max = -0.889)
Found 0052 windows, image:00014 (#seen=00023/00025, max = -0.778)
Found 0019 windows, image:00002 (#seen=00024/00025, max = -0.856)
Found 0029 windows, image:00023 (#seen=00025/00025, max = -0.901)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=645  --- Max positive is 1.000
SVM iteration took 0.191 sec,  kept 102 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00008 (#seen=00001/00025, max = 6.662)
Found 0200 windows, image:00024 (#seen=00002/00025, max = 6.824)
Found 0200 windows, image:00025 (#seen=00003/00025, max = 6.940)
Found 0200 windows, image:00007 (#seen=00004/00025, max = 7.008)
Found 0200 windows, image:00009 (#seen=00005/00025, max = 6.799)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.354 sec,  kept 102 negatives
Found 0025 windows, image:00005 (#seen=00006/00025, max = -0.892)
Found 0012 windows, image:00016 (#seen=00007/00025, max = -0.952)
Found 0028 windows, image:00022 (#seen=00008/00025, max = -0.900)
Found 0022 windows, image:00013 (#seen=00009/00025, max = -0.926)
Found 0022 windows, image:00023 (#seen=00010/00025, max = -0.939)
Found 0022 windows, image:00002 (#seen=00011/00025, max = -0.845)
Found 0016 windows, image:00018 (#seen=00012/00025, max = -0.906)
Found 0013 windows, image:00020 (#seen=00013/00025, max = -0.939)
Found 0010 windows, image:00004 (#seen=00014/00025, max = -0.858)
Found 0016 windows, image:00003 (#seen=00015/00025, max = -0.932)
Found 0016 windows, image:00021 (#seen=00016/00025, max = -0.868)
Found 0023 windows, image:00001 (#seen=00017/00025, max = -0.841)
Found 0014 windows, image:00006 (#seen=00018/00025, max = -0.877)
Found 0019 windows, image:00011 (#seen=00019/00025, max = -0.921)
Found 0016 windows, image:00019 (#seen=00020/00025, max = -0.932)
Found 0034 windows, image:00014 (#seen=00021/00025, max = -0.748)
Found 0024 windows, image:00012 (#seen=00022/00025, max = -0.782)
Found 0013 windows, image:00017 (#seen=00023/00025, max = -0.938)
Found 0026 windows, image:00015 (#seen=00024/00025, max = -0.903)
Found 0011 windows, image:00010 (#seen=00025/00025, max = -0.873)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=484  --- Max positive is 1.000
SVM iteration took 0.175 sec,  kept 126 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00007 (#seen=00001/00025, max = 5.958)
Found 0200 windows, image:00008 (#seen=00002/00025, max = 5.859)
Found 0200 windows, image:00019 (#seen=00003/00025, max = 6.079)
Found 0200 windows, image:00023 (#seen=00004/00025, max = 6.299)
Found 0200 windows, image:00017 (#seen=00005/00025, max = 5.841)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.220 sec,  kept 111 negatives
Found 0016 windows, image:00011 (#seen=00006/00025, max = -0.942)
Found 0015 windows, image:00014 (#seen=00007/00025, max = -0.906)
Found 0012 windows, image:00004 (#seen=00008/00025, max = -0.922)
Found 0011 windows, image:00006 (#seen=00009/00025, max = -0.912)
Found 0013 windows, image:00002 (#seen=00010/00025, max = -0.922)
Found 0024 windows, image:00016 (#seen=00011/00025, max = -0.890)
Found 0015 windows, image:00022 (#seen=00012/00025, max = -0.905)
Found 0025 windows, image:00018 (#seen=00013/00025, max = -0.915)
Found 0014 windows, image:00009 (#seen=00014/00025, max = -0.919)
Found 0020 windows, image:00003 (#seen=00015/00025, max = -0.865)
Found 0016 windows, image:00005 (#seen=00016/00025, max = -0.914)
Found 0012 windows, image:00021 (#seen=00017/00025, max = -0.925)
Found 0024 windows, image:00001 (#seen=00018/00025, max = -0.894)
Found 0024 windows, image:00012 (#seen=00019/00025, max = -0.902)
Found 0017 windows, image:00020 (#seen=00020/00025, max = -0.873)
Found 0016 windows, image:00015 (#seen=00021/00025, max = -0.883)
Found 0022 windows, image:00010 (#seen=00022/00025, max = -0.884)
Found 0021 windows, image:00024 (#seen=00023/00025, max = -0.899)
Found 0015 windows, image:00025 (#seen=00024/00025, max = -0.887)
Found 0019 windows, image:00013 (#seen=00025/00025, max = -0.908)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=462  --- Max positive is 1.000
SVM iteration took 0.125 sec,  kept 132 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00019 (#seen=00001/00025, max = 6.071)
Found 0200 windows, image:00013 (#seen=00002/00025, max = 5.915)
Found 0200 windows, image:00011 (#seen=00003/00025, max = 5.924)
Found 0200 windows, image:00001 (#seen=00004/00025, max = 6.224)
Found 0200 windows, image:00022 (#seen=00005/00025, max = 5.926)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.254 sec,  kept 96 negatives
Found 0010 windows, image:00010 (#seen=00006/00025, max = -0.917)
Found 0010 windows, image:00009 (#seen=00007/00025, max = -0.893)
Found 0018 windows, image:00002 (#seen=00008/00025, max = -0.901)
Found 0017 windows, image:00018 (#seen=00009/00025, max = -0.857)
Found 0013 windows, image:00021 (#seen=00010/00025, max = -0.848)
Found 0022 windows, image:00008 (#seen=00011/00025, max = -0.888)
Found 0024 windows, image:00003 (#seen=00012/00025, max = -0.848)
Found 0024 windows, image:00023 (#seen=00013/00025, max = -0.770)
Found 0019 windows, image:00025 (#seen=00014/00025, max = -0.900)
Found 0006 windows, image:00012 (#seen=00015/00025, max = -0.905)
Found 0014 windows, image:00004 (#seen=00016/00025, max = -0.936)
Found 0015 windows, image:00015 (#seen=00017/00025, max = -0.812)
Found 0029 windows, image:00016 (#seen=00018/00025, max = -0.857)
Found 0012 windows, image:00020 (#seen=00019/00025, max = -0.873)
Found 0031 windows, image:00005 (#seen=00020/00025, max = -0.804)
Found 0022 windows, image:00017 (#seen=00021/00025, max = -0.762)
Found 0009 windows, image:00014 (#seen=00022/00025, max = -0.918)
Found 0014 windows, image:00024 (#seen=00023/00025, max = -0.834)
Found 0007 windows, image:00007 (#seen=00024/00025, max = -0.935)
Found 0009 windows, image:00006 (#seen=00025/00025, max = -0.931)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=930... #pos=1, #neg=421  --- Max positive is 1.000
SVM iteration took 0.124 sec,  kept 114 negatives
 ### End of training... 
Randomizing mining queue
Found 0200 windows, image:00023 (#seen=00001/00025, max = 6.741)
Found 0200 windows, image:00004 (#seen=00002/00025, max = 6.723)
Found 0200 windows, image:00001 (#seen=00003/00025, max = 7.065)
Found 0200 windows, image:00013 (#seen=00004/00025, max = 6.826)
Found 0200 windows, image:00025 (#seen=00005/00025, max = 6.890)
Stopping mining because we have 1000 windows from 5 new violators
# Violating images: 5, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=1000  --- Max positive is 1.000
SVM iteration took 0.241 sec,  kept 114 negatives
Found 0015 windows, image:00021 (#seen=00006/00025, max = -0.905)
Found 0013 windows, image:00010 (#seen=00007/00025, max = -0.946)
Found 0021 windows, image:00006 (#seen=00008/00025, max = -0.833)
Found 0034 windows, image:00005 (#seen=00009/00025, max = -0.870)
Found 0026 windows, image:00018 (#seen=00010/00025, max = -0.798)
Found 0029 windows, image:00008 (#seen=00011/00025, max = -0.861)
Found 0017 windows, image:00020 (#seen=00012/00025, max = -0.862)
Found 0019 windows, image:00007 (#seen=00013/00025, max = -0.878)
Found 0018 windows, image:00014 (#seen=00014/00025, max = -0.931)
Found 0041 windows, image:00016 (#seen=00015/00025, max = -0.785)
Found 0021 windows, image:00024 (#seen=00016/00025, max = -0.837)
Found 0029 windows, image:00002 (#seen=00017/00025, max = -0.877)
Found 0025 windows, image:00017 (#seen=00018/00025, max = -0.898)
Found 0033 windows, image:00012 (#seen=00019/00025, max = -0.894)
Found 0044 windows, image:00003 (#seen=00020/00025, max = -0.869)
Found 0020 windows, image:00022 (#seen=00021/00025, max = -0.926)
Found 0022 windows, image:00019 (#seen=00022/00025, max = -0.924)
Found 0015 windows, image:00009 (#seen=00023/00025, max = -0.934)
Found 0021 windows, image:00015 (#seen=00024/00025, max = -0.877)
Found 0016 windows, image:00011 (#seen=00025/00025, max = -0.875)
# Violating images: 20, #Non-violating images: 0
 -----
Starting SVM: dim=1116... #pos=1, #neg=593  --- Max positive is 1.000
SVM iteration took 0.208 sec,  kept 105 negatives
 ### End of training... 

Create validation set from positives and extra negatives

val_params = params;
val_params.detect_exemplar_nms_os_threshold = 0.5;
val_params.gt_function = @esvm_load_gt_function;
val_set = cat(1, pos_set(:), val_neg_set(:));
val_set_name = 'valset';

Apply trained exemplars on validation set

val_grid = esvm_detect_imageset(val_set, models, val_params, val_set_name);
 --image 00001/00125: 10 exemplars took 0.312sec, #windows=00026, max=-0.572 
 --image 00002/00125: 10 exemplars took 0.382sec, #windows=00025, max=-0.558 
 --image 00003/00125: 10 exemplars took 0.323sec, #windows=00025, max=-0.679 
 --image 00004/00125: 10 exemplars took 0.383sec, #windows=00022, max=-0.428 
 --image 00005/00125: 10 exemplars took 0.240sec, #windows=00026, max=-0.901 
 --image 00006/00125: 10 exemplars took 0.222sec, #windows=00022, max=-0.935 
 --image 00007/00125: 10 exemplars took 0.172sec, #windows=00030, max=-0.929 
 --image 00008/00125: 10 exemplars took 0.188sec, #windows=00024, max=-0.913 
 --image 00009/00125: 10 exemplars took 0.176sec, #windows=00031, max=-0.617 
 --image 00010/00125: 10 exemplars took 0.212sec, #windows=00035, max=-0.751 
 --image 00011/00125: 10 exemplars took 0.201sec, #windows=00030, max=-0.517 
 --image 00012/00125: 10 exemplars took 0.192sec, #windows=00030, max=-0.548 
 --image 00013/00125: 10 exemplars took 0.209sec, #windows=00028, max=-0.587 
 --image 00014/00125: 10 exemplars took 0.206sec, #windows=00023, max=-0.423 
 --image 00015/00125: 10 exemplars took 0.200sec, #windows=00024, max=-0.597 
 --image 00016/00125: 10 exemplars took 0.466sec, #windows=00022, max=-0.509 
 --image 00017/00125: 10 exemplars took 0.287sec, #windows=00026, max=-0.431 
 --image 00018/00125: 10 exemplars took 0.263sec, #windows=00034, max=-0.604 
 --image 00019/00125: 10 exemplars took 0.371sec, #windows=00030, max=-0.705 
 --image 00020/00125: 10 exemplars took 0.271sec, #windows=00032, max=-0.515 
 --image 00021/00125: 10 exemplars took 0.189sec, #windows=00028, max=-0.577 
 --image 00022/00125: 10 exemplars took 0.190sec, #windows=00029, max=-0.613 
 --image 00023/00125: 10 exemplars took 0.208sec, #windows=00028, max=-0.548 
 --image 00024/00125: 10 exemplars took 0.205sec, #windows=00028, max=-0.535 
 --image 00025/00125: 10 exemplars took 0.214sec, #windows=00036, max=1.000 
 --image 00026/00125: 10 exemplars took 0.232sec, #windows=00028, max=1.000 
 --image 00027/00125: 10 exemplars took 0.343sec, #windows=00027, max=1.000 
 --image 00028/00125: 10 exemplars took 0.427sec, #windows=00025, max=1.000 
 --image 00029/00125: 10 exemplars took 0.399sec, #windows=00022, max=-0.564 
 --image 00030/00125: 10 exemplars took 0.300sec, #windows=00031, max=-0.667 
 --image 00031/00125: 10 exemplars took 0.183sec, #windows=00029, max=-0.671 
 --image 00032/00125: 10 exemplars took 0.208sec, #windows=00027, max=-0.648 
 --image 00033/00125: 10 exemplars took 0.190sec, #windows=00026, max=-0.630 
 --image 00034/00125: 10 exemplars took 0.176sec, #windows=00029, max=-0.579 
 --image 00035/00125: 10 exemplars took 0.213sec, #windows=00028, max=-0.521 
 --image 00036/00125: 10 exemplars took 0.195sec, #windows=00033, max=-0.617 
 --image 00037/00125: 10 exemplars took 0.190sec, #windows=00026, max=-0.540 
 --image 00038/00125: 10 exemplars took 0.206sec, #windows=00025, max=-0.456 
 --image 00039/00125: 10 exemplars took 0.200sec, #windows=00028, max=-0.672 
 --image 00040/00125: 10 exemplars took 0.412sec, #windows=00033, max=-0.530 
 --image 00041/00125: 10 exemplars took 0.315sec, #windows=00030, max=-0.739 
 --image 00042/00125: 10 exemplars took 0.387sec, #windows=00032, max=-0.590 
 --image 00043/00125: 10 exemplars took 0.182sec, #windows=00025, max=-0.683 
 --image 00044/00125: 10 exemplars took 0.212sec, #windows=00029, max=-0.525 
 --image 00045/00125: 10 exemplars took 0.197sec, #windows=00033, max=-0.761 
 --image 00046/00125: 10 exemplars took 0.205sec, #windows=00032, max=-0.573 
 --image 00047/00125: 10 exemplars took 0.196sec, #windows=00032, max=-0.567 
 --image 00048/00125: 10 exemplars took 0.357sec, #windows=00028, max=-0.730 
 --image 00049/00125: 10 exemplars took 0.383sec, #windows=00023, max=-0.403 
 --image 00050/00125: 10 exemplars took 0.298sec, #windows=00024, max=-0.564 
 --image 00051/00125: 10 exemplars took 0.252sec, #windows=00026, max=-0.492 
 --image 00052/00125: 10 exemplars took 0.203sec, #windows=00022, max=-0.561 
 --image 00053/00125: 10 exemplars took 0.180sec, #windows=00025, max=-0.528 
 --image 00054/00125: 10 exemplars took 0.202sec, #windows=00027, max=-0.527 
 --image 00055/00125: 10 exemplars took 0.178sec, #windows=00030, max=-0.661 
 --image 00056/00125: 10 exemplars took 0.212sec, #windows=00028, max=-0.592 
 --image 00057/00125: 10 exemplars took 0.191sec, #windows=00031, max=-0.497 
 --image 00058/00125: 10 exemplars took 0.176sec, #windows=00033, max=-0.637 
 --image 00059/00125: 10 exemplars took 0.320sec, #windows=00037, max=-0.700 
 --image 00060/00125: 10 exemplars took 0.246sec, #windows=00029, max=-0.642 
 --image 00061/00125: 10 exemplars took 0.293sec, #windows=00037, max=-0.616 
 --image 00062/00125: 10 exemplars took 0.325sec, #windows=00027, max=-0.668 
 --image 00063/00125: 10 exemplars took 0.290sec, #windows=00026, max=-0.633 
 --image 00064/00125: 10 exemplars took 0.216sec, #windows=00026, max=-0.579 
 --image 00065/00125: 10 exemplars took 0.165sec, #windows=00024, max=-0.885 
 --image 00066/00125: 10 exemplars took 0.174sec, #windows=00033, max=-0.901 
 --image 00067/00125: 10 exemplars took 0.247sec, #windows=00021, max=-0.898 
 --image 00068/00125: 10 exemplars took 0.190sec, #windows=00024, max=-0.898 
 --image 00069/00125: 10 exemplars took 0.300sec, #windows=00029, max=-0.856 
 --image 00070/00125: 10 exemplars took 0.416sec, #windows=00022, max=-0.902 
 --image 00071/00125: 10 exemplars took 0.333sec, #windows=00037, max=-0.855 
 --image 00072/00125: 10 exemplars took 0.197sec, #windows=00024, max=-0.894 
 --image 00073/00125: 10 exemplars took 0.153sec, #windows=00027, max=-0.835 
 --image 00074/00125: 10 exemplars took 0.245sec, #windows=00030, max=-0.567 
 --image 00075/00125: 10 exemplars took 0.187sec, #windows=00026, max=-0.500 
 --image 00076/00125: 10 exemplars took 0.194sec, #windows=00028, max=-0.554 
 --image 00077/00125: 10 exemplars took 0.224sec, #windows=00024, max=-0.468 
 --image 00078/00125: 10 exemplars took 0.195sec, #windows=00030, max=-0.548 
 --image 00079/00125: 10 exemplars took 0.223sec, #windows=00029, max=-0.660 
 --image 00080/00125: 10 exemplars took 0.284sec, #windows=00030, max=-0.686 
 --image 00081/00125: 10 exemplars took 0.298sec, #windows=00029, max=-0.614 
 --image 00082/00125: 10 exemplars took 0.342sec, #windows=00029, max=1.000 
 --image 00083/00125: 10 exemplars took 0.371sec, #windows=00028, max=1.000 
 --image 00084/00125: 10 exemplars took 0.219sec, #windows=00025, max=1.000 
 --image 00085/00125: 10 exemplars took 0.218sec, #windows=00025, max=1.000 
 --image 00086/00125: 10 exemplars took 0.173sec, #windows=00027, max=-0.904 
 --image 00087/00125: 10 exemplars took 0.167sec, #windows=00033, max=-0.891 
 --image 00088/00125: 10 exemplars took 0.218sec, #windows=00015, max=-0.901 
 --image 00089/00125: 10 exemplars took 0.252sec, #windows=00016, max=-0.915 
 --image 00090/00125: 10 exemplars took 0.305sec, #windows=00033, max=-0.597 
 --image 00091/00125: 10 exemplars took 0.305sec, #windows=00023, max=-0.505 
 --image 00092/00125: 10 exemplars took 0.274sec, #windows=00025, max=-0.476 
 --image 00093/00125: 10 exemplars took 0.208sec, #windows=00023, max=-0.850 
 --image 00094/00125: 10 exemplars took 0.182sec, #windows=00027, max=-0.664 
 --image 00095/00125: 10 exemplars took 0.215sec, #windows=00035, max=-0.687 
 --image 00096/00125: 10 exemplars took 0.193sec, #windows=00024, max=-0.557 
 --image 00097/00125: 10 exemplars took 0.178sec, #windows=00038, max=-0.658 
 --image 00098/00125: 10 exemplars took 0.200sec, #windows=00032, max=-0.617 
 --image 00099/00125: 10 exemplars took 0.173sec, #windows=00033, max=-0.692 
 --image 00100/00125: 10 exemplars took 0.214sec, #windows=00031, max=-0.627 
 --image 00101/00125: 10 exemplars took 0.417sec, #windows=00024, max=-0.582 
 --image 00102/00125: 10 exemplars took 0.276sec, #windows=00036, max=-0.881 
 --image 00103/00125: 10 exemplars took 0.321sec, #windows=00026, max=-0.806 
 --image 00104/00125: 10 exemplars took 0.213sec, #windows=00024, max=-0.830 
 --image 00105/00125: 10 exemplars took 0.231sec, #windows=00043, max=-0.865 
 --image 00106/00125: 10 exemplars took 0.189sec, #windows=00024, max=1.000 
 --image 00107/00125: 10 exemplars took 0.204sec, #windows=00028, max=1.000 
 --image 00108/00125: 10 exemplars took 0.208sec, #windows=00025, max=-0.648 
 --image 00109/00125: 10 exemplars took 0.209sec, #windows=00033, max=-0.663 
 --image 00110/00125: 10 exemplars took 0.185sec, #windows=00035, max=-0.700 
 --image 00111/00125: 10 exemplars took 0.313sec, #windows=00027, max=-0.701 
 --image 00112/00125: 10 exemplars took 0.285sec, #windows=00026, max=-0.817 
 --image 00113/00125: 10 exemplars took 0.299sec, #windows=00035, max=-0.598 
 --image 00114/00125: 10 exemplars took 0.307sec, #windows=00024, max=-0.835 
 --image 00115/00125: 10 exemplars took 0.225sec, #windows=00023, max=-0.872 
 --image 00116/00125: 10 exemplars took 0.152sec, #windows=00020, max=-0.917 
 --image 00117/00125: 10 exemplars took 0.179sec, #windows=00041, max=-0.864 
 --image 00118/00125: 10 exemplars took 0.174sec, #windows=00024, max=-0.657 
 --image 00119/00125: 10 exemplars took 0.181sec, #windows=00027, max=-0.663 
 --image 00120/00125: 10 exemplars took 0.165sec, #windows=00035, max=-0.769 
 --image 00121/00125: 10 exemplars took 0.191sec, #windows=00023, max=-0.515 
 --image 00122/00125: 10 exemplars took 0.192sec, #windows=00033, max=-0.525 
 --image 00123/00125: 10 exemplars took 0.191sec, #windows=00022, max=-0.412 
 --image 00124/00125: 10 exemplars took 0.199sec, #windows=00026, max=-0.556 
 --image 00125/00125: 10 exemplars took 0.264sec, #windows=00027, max=-0.690 

Perform Platt calibration and M-matrix estimation

M = esvm_perform_calibration(val_grid, val_set, models, val_params);
.
.
.
.
.
.
.
.
.
.
 -Computing Box Features:................................took 0.062sec
 -Learning M by counting: took 0.014sec
 -Applying M to 32 images: took 0.019sec

Define test-set

Ntest = 50;
test_set = esvm_generate_dataset(Ntest);
test_params = params;
test_params.detect_exemplar_nms_os_threshold = 0.5;
test_set_name = 'testset';

Apply on test set

test_grid = esvm_detect_imageset(test_set, models, test_params, test_set_name);
 --image 00001/00050: 10 exemplars took 0.169sec, #windows=00027, max=-0.701 
 --image 00002/00050: 10 exemplars took 0.176sec, #windows=00024, max=-0.560 
 --image 00003/00050: 10 exemplars took 0.157sec, #windows=00029, max=-0.685 
 --image 00004/00050: 10 exemplars took 0.155sec, #windows=00025, max=-0.543 
 --image 00005/00050: 10 exemplars took 0.202sec, #windows=00029, max=-0.511 
 --image 00006/00050: 10 exemplars took 0.176sec, #windows=00025, max=-0.602 
 --image 00007/00050: 10 exemplars took 0.170sec, #windows=00022, max=-0.553 
 --image 00008/00050: 10 exemplars took 0.189sec, #windows=00031, max=-0.733 
 --image 00009/00050: 10 exemplars took 0.178sec, #windows=00025, max=-0.527 
 --image 00010/00050: 10 exemplars took 0.167sec, #windows=00027, max=-0.605 
 --image 00011/00050: 10 exemplars took 0.173sec, #windows=00024, max=-0.622 
 --image 00012/00050: 10 exemplars took 0.169sec, #windows=00026, max=-0.447 
 --image 00013/00050: 10 exemplars took 0.153sec, #windows=00028, max=-0.750 
 --image 00014/00050: 10 exemplars took 0.158sec, #windows=00023, max=-0.747 
 --image 00015/00050: 10 exemplars took 0.172sec, #windows=00029, max=-0.557 
 --image 00016/00050: 10 exemplars took 0.157sec, #windows=00028, max=-0.644 
 --image 00017/00050: 10 exemplars took 0.183sec, #windows=00027, max=-0.500 
 --image 00018/00050: 10 exemplars took 0.170sec, #windows=00025, max=-0.501 
 --image 00019/00050: 10 exemplars took 0.170sec, #windows=00024, max=-0.515 
 --image 00020/00050: 10 exemplars took 0.170sec, #windows=00023, max=-0.523 
 --image 00021/00050: 10 exemplars took 0.166sec, #windows=00027, max=-0.625 
 --image 00022/00050: 10 exemplars took 0.176sec, #windows=00033, max=-0.588 
 --image 00023/00050: 10 exemplars took 0.160sec, #windows=00028, max=-0.523 
 --image 00024/00050: 10 exemplars took 0.190sec, #windows=00036, max=-0.561 
 --image 00025/00050: 10 exemplars took 0.180sec, #windows=00030, max=-0.632 
 --image 00026/00050: 10 exemplars took 0.153sec, #windows=00026, max=-0.679 
 --image 00027/00050: 10 exemplars took 0.175sec, #windows=00024, max=-0.569 
 --image 00028/00050: 10 exemplars took 0.173sec, #windows=00029, max=-0.646 
 --image 00029/00050: 10 exemplars took 0.154sec, #windows=00027, max=-0.737 
 --image 00030/00050: 10 exemplars took 0.168sec, #windows=00027, max=-0.573 
 --image 00031/00050: 10 exemplars took 0.162sec, #windows=00027, max=-0.631 
 --image 00032/00050: 10 exemplars took 0.198sec, #windows=00033, max=-0.511 
 --image 00033/00050: 10 exemplars took 0.176sec, #windows=00033, max=-0.588 
 --image 00034/00050: 10 exemplars took 0.168sec, #windows=00026, max=-0.434 
 --image 00035/00050: 10 exemplars took 0.165sec, #windows=00025, max=-0.622 
 --image 00036/00050: 10 exemplars took 0.180sec, #windows=00025, max=-0.521 
 --image 00037/00050: 10 exemplars took 0.178sec, #windows=00032, max=-0.607 
 --image 00038/00050: 10 exemplars took 0.166sec, #windows=00027, max=-0.733 
 --image 00039/00050: 10 exemplars took 0.172sec, #windows=00031, max=-0.680 
 --image 00040/00050: 10 exemplars took 0.144sec, #windows=00031, max=-0.765 
 --image 00041/00050: 10 exemplars took 0.191sec, #windows=00024, max=-0.548 
 --image 00042/00050: 10 exemplars took 0.173sec, #windows=00023, max=-0.518 
 --image 00043/00050: 10 exemplars took 0.161sec, #windows=00032, max=-0.594 
 --image 00044/00050: 10 exemplars took 0.188sec, #windows=00029, max=-0.638 
 --image 00045/00050: 10 exemplars took 0.175sec, #windows=00035, max=-0.690 
 --image 00046/00050: 10 exemplars took 0.173sec, #windows=00027, max=-0.660 
 --image 00047/00050: 10 exemplars took 0.186sec, #windows=00021, max=-0.531 
 --image 00048/00050: 10 exemplars took 0.163sec, #windows=00030, max=-0.497 
 --image 00049/00050: 10 exemplars took 0.179sec, #windows=00028, max=-0.613 
 --image 00050/00050: 10 exemplars took 0.163sec, #windows=00033, max=-0.538 

Apply calibration matrix to test-set results

test_struct = esvm_pool_exemplar_dets(test_grid, models, M, test_params);
Applying M-matrix to 13 images:.............took 0.017sec
Applying NMS (OS thresh=0.300)

Show top detections

maxk = 20;
allbbs = esvm_show_top_dets(test_struct, test_grid, test_set, models, ...
                       params, maxk, test_set_name);
Showing detection # 1, score=12.244
Showing detection # 2, score=11.914
Showing detection # 3, score=11.488
Showing detection # 4, score=11.347
Showing detection # 5, score=10.724
Showing detection # 6, score=9.852
Showing detection # 7, score=8.712
Showing detection # 8, score=8.536
Showing detection # 9, score=7.866
Showing detection # 10, score=6.838
Showing detection # 11, score=5.641
Showing detection # 12, score=5.059
Showing detection # 13, score=3.939
Showing detection # 14, score=0.221
Showing detection # 15, score=0.160
Showing detection # 16, score=0.159
Showing detection # 17, score=0.158
Showing detection # 18, score=0.156
Showing detection # 19, score=0.151
Showing detection # 20, score=0.142
ans = 

    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]
    [1x1 struct]