Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Fungungun committed Mar 13, 2017
1 parent 8c1d387 commit b9b2cda
Show file tree
Hide file tree
Showing 71 changed files with 130 additions and 910 deletions.
Binary file added DATA_Processing/LocationOPE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DATA_Processing/OPEResults.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DATA_Processing/OverlapOPE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DATA_Processing/my_pos.mat
Binary file not shown.
75 changes: 75 additions & 0 deletions DATA_Processing/output.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
clc;clear all;
%%
load('my_pos')
video = dir('C:\Users\21558188\Desktop\PhD\Code\VS\covImageIntegral2\videos');
%% load ground truth
pos_gt = zeros(1,4);
staple_pos = zeros(1,4);
for i = 1:length(video)-2
%-----------------ground truth
tmp = dlmread(['C:\Users\21558188\Desktop\PhD\Code\VS\covImageIntegral2\videos\' video(i+2).name '\gt.txt']);
tmp([1],:) = [];%1st frame
pos_gt = [pos_gt;tmp];

%------------------staple results
tmp = dlmread(['C:\Users\21558188\Desktop\PhD\GitHub\staple\results\' video(i+2).name '.txt'],'\t');
tmp([1],:) = []; %1st frame
staple_pos = [staple_pos;tmp];

end
pos_gt([1],:) = [];
staple_pos([1],:) = [];

numFrames = size(pos_gt,1);
%% metrics
for i = 1:numFrames
iou.my(i) = bboxOverlapRatio(my_pos(i,:),pos_gt(i,:));
iou.staple(i) = bboxOverlapRatio(staple_pos(i,:),pos_gt(i,:));

centre.my(i) = pdist([my_pos(i,1)+my_pos(i,3)/2 my_pos(i,2)+my_pos(i,4)/2;pos_gt(i,1)+pos_gt(i,3)/2 pos_gt(i,2)+pos_gt(i,4)/2;]);
centre.staple(i) = pdist([staple_pos(i,1)+staple_pos(i,3)/2 staple_pos(i,2)+staple_pos(i,4)/2;pos_gt(i,1)+pos_gt(i,3)/2 pos_gt(i,2)+pos_gt(i,4)/2;]);
end

%% OPE overlap
overlapX = 0:0.01:1;
for i = 1:length(overlapX)
successIOU.my(i) = length(iou.my((iou.my>=overlapX(i))))/numFrames;
successIOU.staple(i) = length(iou.staple((iou.staple>=overlapX(i))))/numFrames;
end
successIOUmean.my = mean(successIOU.my);
successIOUmean.staple = mean(successIOU.staple);
IOverlapOPE = figure;
plot(overlapX,successIOU.my,'r','linewidth',3)
hold on
plot(overlapX,successIOU.staple,'b','linewidth',3)
title('Success plots of OPE','FontSize',14,'FontWeight','bold');xlabel('Overlap Threshold','FontSize',14,'FontWeight','bold');ylabel('Success Rate','FontSize',14,'FontWeight','bold');

legend(['Our Method(' num2str(successIOUmean.my) ')'], ...
['Staple(' num2str(successIOUmean.staple) ')'],'FontSize',14,'FontWeight','bold');
axis normal;
box on
set(gca,'linewidth',3,'FontWeight','bold');
saveas(IOverlapOPE,'OverlapOPE','png')


%% OPE location
CentreX = 0:1:50;
for i = 1:length(CentreX)
successCentre.my(i) = 1 - length(centre.my((centre.my>=CentreX(i))))/numFrames;
successCentre.staple(i) = 1 - length(centre.staple((centre.staple>=CentreX(i))))/numFrames;
end
successCentremean.my = mean(successCentre.my);
successCentremean.staple = mean(successCentre.staple);
ILocationOPE = figure;
plot(CentreX,successCentre.my,'r','linewidth',3)
hold on
plot(CentreX,successCentre.staple,'b','linewidth',3)
title('Precision plots of OPE','FontSize',14,'FontWeight','bold');xlabel('Location error Threshold','FontSize',14,'FontWeight','bold');ylabel('Precision','FontSize',14,'FontWeight','bold');

legend(['Our Method(' num2str(successCentremean.my) ')'], ...
['Staple(' num2str(successCentremean.staple) ')'],'FontSize',14,'FontWeight','bold');
axis normal;
box on
set(gca,'linewidth',3,'FontWeight','bold');
saveas(ILocationOPE,'LocationOPE','png')

Binary file added results/0_processdImgs/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/0_processdImgs/video_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
886 changes: 0 additions & 886 deletions results/Mhyang.txt

This file was deleted.

Binary file added results/ball/246.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/ball/379.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/ball/72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bicycle/129.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bicycle/211.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bicycle/27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bolt/152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bolt/221.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/bolt/249.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/david3/100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/david3/142.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/david3/222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/faceocc1/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/faceocc1/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/faceocc1/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/faceocc1/Modes.png
Binary file added results/faceocc1/frame1.bmp
Binary file not shown.
Binary file added results/faceocc1/frame160.bmp
Binary file not shown.
Binary file added results/faceocc1/frame171.bmp
Binary file not shown.
Binary file added results/faceocc1/frame190.bmp
Binary file not shown.
Binary file added results/faceocc1/frame257.bmp
Binary file not shown.
Binary file added results/faceocc1/frame288.bmp
Binary file not shown.
Binary file added results/faceocc1/frame34.bmp
Binary file not shown.
Binary file added results/faceocc1/frame380.bmp
Binary file not shown.
Binary file added results/faceocc1/frame427.bmp
Binary file not shown.
Binary file added results/faceocc1/frame440.bmp
Binary file not shown.
Binary file added results/faceocc1/frame455.bmp
Binary file not shown.
Binary file added results/faceocc1/frame619.bmp
Binary file not shown.
Binary file added results/faceocc1/frame745.bmp
Binary file not shown.
Binary file added results/faceocc1/frame850.bmp
Binary file not shown.
Binary file added results/faceocc1/frame91.bmp
Binary file not shown.
Binary file added results/girl/209.png
Binary file added results/girl/39.png
Binary file added results/girl/445.png
Binary file added results/girl2/1068.png
Binary file added results/girl2/121.png
Binary file added results/girl2/75.png
Binary file added results/jogging/112.png
Binary file added results/jogging/146.png
Binary file added results/jogging/47.png
Binary file added results/jogging2/195.png
Binary file added results/jogging2/62.png
Binary file added results/jogging2/87.png
Binary file added results/my_pos.mat
Binary file not shown.
Binary file added results/polarbear/151.png
Binary file added results/polarbear/313.png
Binary file added results/polarbear/66.png
25 changes: 8 additions & 17 deletions results/run_results.m
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
clc
clear all
showimage = 0;
i = 1;

video_sequence{i}.name = 'sphere'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'girl2'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'Walking'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'surfing'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'David3'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 200; i = i+1;
video_sequence{i}.name = 'bolt'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'FaceOcc1'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'polarbear'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'bicycle'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'ball'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'jogging'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video_sequence{i}.name = 'jogging2'; video_sequence{i}.fps = 50; video_sequence{i}.wndsize = 400; i = i+1;
video = dir('C:\Users\21558188\Desktop\PhD\Code\VS\covImageIntegral2\videos');

results.numFrame = 0;
results.sumiou = 0;
results.pos = zeros(1,4);

for i = 1:(length(video_sequence)-1)
tmp = showresults(video_sequence{i}.name,video_sequence{i}.fps,video_sequence{i}.wndsize,showimage);
for j = 1:length(video)-2
tmp = showresults(video(j+2).name,50,400,showimage);
results.numFrame = results.numFrame + tmp.numFrame;
results.sumiou = results.sumiou + tmp.sumiou;
results.pos = [results.pos; tmp.pos];
end

disp(['average IOU score of these' num2str(length(video_sequence)-1) 'is'])
results.pos([1],:) = [];
disp(['average IOU score of these ' num2str(length(video)-2) ' videos is'])
results.sumiou/results.numFrame

if showimage == 1
Expand Down
54 changes: 47 additions & 7 deletions results/showresults.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

warning('off')
file
%-------------------------load data
%-------------------------load my results
pf = fopen([file '.txt'],'r');
tline = fgetl(pf);
str = strsplit(tline);
Expand All @@ -27,6 +27,9 @@
i = i + 1;
end
fclose(pf);
%-------------------------load staple results
pos_staple = dlmread(['C:\Users\21558188\Desktop\PhD\GitHub\staple\results\' file '.txt'],'\t');
pos_staple([1],:) = [];
%-------------------------load groundtruth
pf = fopen(['../../videos/' file '/gt.txt'],'r');
tline = fgetl(pf); % get rid of the first line
Expand Down Expand Up @@ -58,9 +61,14 @@

numFrame = length(num);
result.numFrame = numFrame;
result.sumiou = sum(iou);
result.sumiou = sum(iou);
result.pos = pos_wh;
avgIOU = result.sumiou/result.numFrame

faceocc1_interest_frame = [1 34 91 160 171 190 257 288 380 427 440 455 619 745 850];

k = 1;

if showimage == 1
%---------------------------show image
% 1------2------3
Expand All @@ -80,6 +88,18 @@
1 3 6 4 1 3 6; %mode 9
];

mispart_index = [
1 1 1 1 1; %mode 1
1 2 5 4 1; %mode 2
2 3 6 5 2; %mode 3
4 5 8 7 4; %mode 4
5 6 9 8 5; %mode 5
1 2 8 7 1; %mode 6
2 3 9 8 2; %mode 7
1 3 6 4 1; %mode 8
4 6 9 7 4; %mode 9
];

numzeros = (dataset == 0) * 4 + (dataset == 1) * 8;
s_frames = cell(numFrame,1);
nz = strcat('%0',num2str(numzeros),'d');
Expand All @@ -89,18 +109,38 @@
s_frames{t} = strcat('../../videos/',file,'/',id,'.',fext);
point_draw = calcpoint_draw(pos(t,:));
%image
imshow(s_frames{t},'InitialMagnification',wndsize);
I = imshow(s_frames{t},'InitialMagnification',wndsize,'border','tight');
hold on
%groud truth
rectangle('Position',pos_gt_wh(t,:),'LineWidth',10);
gt_rec = rectangle('Position',pos_gt_wh(t,:),'LineWidth',3);
%other trackers
%staple
staple_rec = rectangle('Position',pos_staple(t,:),'LineWidth',3,'EdgeColor',[0 0 1],'LineStyle','--');
%STCT

%text
index = mode9_index(mode(t),:);
text(20,20,['frame ' num2str(t) ' IOU score ' num2str(iou(t)) ' mode ' num2str(mode(t))], ...
'FontSize',14,'Color','red')
mis_index = mispart_index(mode(t),:);
%text(20,20,['frame ' num2str(t) ' IOU score ' num2str(iou(t)) ' mode ' num2str(mode(t))], ...
% 'FontSize',14,'Color','red')
for i = 1:6
x = [point_draw(index(i),1),point_draw(index(i+1),1)];
y = [point_draw(index(i),2),point_draw(index(i+1),2)];
plot(x,y,'w-','LineWidth',10)
plot(x,y,'r-','LineWidth',3)
end
%draw miss part
for i = 1:4
x_mis = [point_draw(mis_index(i),1),point_draw(mis_index(i+1),1)];
y_mis = [point_draw(mis_index(i),2),point_draw(mis_index(i+1),2)];
plot(x_mis,y_mis,'--r','LineWidth',3)
end
text(20,20,['Frame #' num2str(t) ' mode ' num2str(mode(t))],'FontSize',20,'Color','red')
axis normal

if k <= length(faceocc1_interest_frame)
if t == faceocc1_interest_frame(k) && strcmp(file,'faceocc1')
saveas(I,['./' file '/frame' num2str(t) '.bmp'],'bmp'); k = k+1;
end
end
pause(1/fps)
cla
Expand Down
Binary file added results/sphere/29.png
Binary file added results/sphere/46.png
Binary file added results/sphere/74.png
Binary file added results/surfing/278.png
Binary file added results/surfing/41.png
Binary file added results/surfing/75.png
Binary file added results/walking/137.png
Binary file added results/walking/32.png
Binary file added results/walking/46.png

0 comments on commit b9b2cda

Please sign in to comment.