Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
quantombone committed Jan 8, 2012
1 parent f004280 commit b6fd1e5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 33 deletions.
46 changes: 24 additions & 22 deletions esvm_apply_calibration.m
Expand Up @@ -139,31 +139,33 @@
end
end

% if exist('M','var') && length(M)>0 && isfield(M,'betas')
if exist('M','var') && length(M)>0 && isfield(M,'betas')

% fprintf(1,'Propagating scores onto raw detections\n');
% %% propagate scores onto raw boxes
% for i = 1:length(bboxes)
% calib_boxes = calibrate_boxes(raw_boxes{i},M.betas);
% beta_scores = calib_boxes(:,end);
fprintf(1,'Propagating scores onto raw detections\n');
%% propagate scores onto raw boxes
for i = 1:length(bboxes)
allMscores = bboxes{i}(:,end);
calib_boxes = calibrate_boxes(raw_boxes{i},M.betas);
beta_scores = calib_boxes(:,end);

% osmat = getosmatrix_bb(bboxes{i},raw_boxes{i});
% for j = 1:size(osmat,1)
% curscores = (osmat(j,:)>.8) .* beta_scores';
% [aa,bb] = max(curscores);
% bboxes{i}(j,:) = raw_boxes{i}(bb,:);
% bboxes{i}(j,end) = aa;
% end
osmat = getosmatrix_bb(bboxes{i},raw_boxes{i});
for j = 1:size(osmat,1)
curscores = (osmat(j,:)>.8) .* beta_scores';
[aa,bb] = max(curscores);
bboxes{i}(j,:) = raw_boxes{i}(bb,:);
bboxes{i}(j,end) = aa;
end
bboxes{i}(:,end) = allMscores;

% % new_scores = beta_scores;
% % for j = 1:length(nbrlist{i})
% % new_scores(nbrlist{i}{j}) = max(new_scores(nbrlist{i}{j}),...
% % beta_scores(nbrlist{i}{j}).*...
% % bboxes{i}(nbrlist{i}{j},end));
% % end
% % bboxes{i}(:,end) = new_scores;
% end
% end
% new_scores = beta_scores;
% for j = 1:length(nbrlist{i})
% new_scores(nbrlist{i}{j}) = max(new_scores(nbrlist{i}{j}),...
% beta_scores(nbrlist{i}{j}).*...
% bboxes{i}(nbrlist{i}{j},end));
% end
% bboxes{i}(:,end) = new_scores;
end
end

% Clip boxes to image dimensions since VOC testing annotation
% always fall within the image
Expand Down
8 changes: 4 additions & 4 deletions esvm_download_models.m
Expand Up @@ -11,8 +11,8 @@

load(f);

if isfield(models{1},'I') && isstr(models{1}.I) && length(models{1}.I)>=7 ...
&& strcmp(models{1}.I(1:7),'http://')
fprintf(1,'Warning: Models have images as URLs\n -- Use [models]=esvm_update_voc_models(models,local_dir);\n');
end
% if isfield(models{1},'I') && isstr(models{1}.I) && length(models{1}.I)>=7 ...
% && strcmp(models{1}.I(1:7),'http://')
% fprintf(1,'Warning: Models have images as URLs\n -- Use [models]=esvm_update_voc_models(models,local_dir);\n');
% end

14 changes: 7 additions & 7 deletions esvm_quick_demo.m
@@ -1,12 +1,12 @@

esvm_download_models('bus');
load voc2007-bus.mat
esvm_demo_apply_exemplars(test_set(1:10), models, M);
% esvm_download_models('bus');
% load voc2007-bus.mat
% esvm_demo_apply_exemplars(test_set(1:10), models, M);

esvm_download_models('bicycle');
load voc2007-bicycle.mat
esvm_demo_apply_exemplars(test_set(1:10), models, M);
% esvm_download_models('bicycle');
% load voc2007-bicycle.mat
% esvm_demo_apply_exemplars(test_set(1:10), models, M);

esvm_download_models('train');
load voc2007-bicycle.mat
load voc2007-train.mat
esvm_demo_apply_exemplars(test_set(1:10), models, M);

0 comments on commit b6fd1e5

Please sign in to comment.