Skip to content

Commit

Permalink
suppress lost targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu Xiang authored and Yu Xiang committed Mar 22, 2015
1 parent e29e3ba commit 9314527
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 23 deletions.
52 changes: 51 additions & 1 deletion MDP_test.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% testing MDP
function metrics = MDP_test(seq_idx, tracker)

is_show = 0;
is_show = 1;
is_save = 0;
is_text = 0;

Expand Down Expand Up @@ -282,4 +282,54 @@
end
end
end
end


% collect dres from trackers
dres_track = [];
for i = 1:numel(trackers)
tracker = trackers{i};
dres = sub(tracker.dres, numel(tracker.dres.fr));

if tracker.state == 3
if isempty(dres_track)
dres_track = dres;
else
dres_track = concatenate_dres(dres_track, dres);
end
end
end

% compute overlaps
if isempty(dres_track)
num_track = 0;
else
num_track = numel(dres_track.fr);
end

flag = zeros(num_track, 1);
for i = 1:num_track
[~, o] = calc_overlap(dres_track, i, dres_track, 1:num_track);
o(i) = 0;
o(flag == 1) = 0;
[mo, ind] = max(o);
if mo > opt.overlap_sup_lost
f1 = dres_track.fr(i);
f2 = dres_track.fr(ind);
if f1 > f2
trackers{dres_track.id(ind)}.state = 0;
trackers{dres_track.id(ind)}.dres.state(end) = 0;
flag(ind) = 1;
if opt.is_text
fprintf('target %d suppressed\n', dres_track.id(ind));
end
else
trackers{dres_track.id(i)}.state = 0;
trackers{dres_track.id(i)}.dres.state(end) = 0;
flag(i) = 1;
if opt.is_text
fprintf('target %d suppressed\n', dres_track.id(i));
end
end
end
end
8 changes: 7 additions & 1 deletion bb_points.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@
stepW = (bb(3)-bb(1)) / (numN - 1);
stepH = (bb(4)-bb(2)) / (numM - 1);

pt = ntuples(bb(1):stepW:bb(3),(bb(2):stepH:bb(4)));
pt = ntuples(bb(1):stepW:bb(3),(bb(2):stepH:bb(4)));

if size(pt,2) < numM*numN
count = numM * numN - size(pt, 2);
app = repmat(pt(:,end), 1, count);
pt = [pt, app];
end
2 changes: 1 addition & 1 deletion evaluate_cem.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

opt = globals();
seq_set = 'train';
seq_name = 'KITTI-13';
seq_name = 'ETH-Sunnyday';
results = '/home/yuxiang/Projects/Multitarget_Tracking/MOTbenchmark/devkit/res/data';


Expand Down
5 changes: 3 additions & 2 deletions globals.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
opt.threshold_ratio = 0.6; % aspect ratio threshold in target association
opt.threshold_dis = 5; % distance threshold in target association, multiple of the width of target
opt.rescale_box = [1 1]; % [width height], rescale the bounding box before computing flow
opt.rescale_img = 0.25; % rescale the image before computing flow
opt.rescale_img = 0.5; % rescale the image before computing flow
opt.enlarge_box = 5; % enlarge the box before computing flow
opt.level_track = 3; % LK level in tracking
opt.level_lost = 1; % LK level in association
Expand All @@ -53,7 +53,8 @@
opt.overlap_occ = 0.7;
opt.overlap_pos = 0.5;
opt.overlap_neg = 0.2;
opt.overlap_sup = 0.95; % suppress target used in testing only
opt.overlap_sup = 0.9; % suppress target used in testing only
opt.overlap_sup_lost = 0.8; % suppress target used in testing only
opt.max_neg = 100;

% training parameters
Expand Down
26 changes: 8 additions & 18 deletions grid_search.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,27 @@
values = {[1, 1], [0.8, 1], [0.6, 1], [0.6, 0.8]};
opt = search_parameter(seq_idx, opt, fname, values);

% 2. search for rescale image
fname = 'rescale_img';
values = {0.25, 0.5, 0.75, 1};
opt = search_parameter(seq_idx, opt, fname, values);

% 3. search for enlarge box
% 2. search for enlarge box
fname = 'enlarge_box';
values = {2, 3, 5};
values = {2, 3, 4, 5};
opt = search_parameter(seq_idx, opt, fname, values);

% 4. search for max ratio changed allowed in LK
% 3. search for max ratio changed allowed in LK
fname = 'max_ratio';
values = {0.6, 0.7, 0.8};
values = {0.6, 0.7, 0.8, 0.9};
opt = search_parameter(seq_idx, opt, fname, values);

% 5. search for weight tracking
% 4. search for weight tracking
fname = 'weight_tracking';
values = {1, 3, 5, 7};
opt = search_parameter(seq_idx, opt, fname, values);

% 6. search for fb factor
fname = 'fb_factor';
values = {10, 20, 30, 40};
opt = search_parameter(seq_idx, opt, fname, values);

% 7. search for threshold ratio
% 5. search for threshold ratio
fname = 'threshold_ratio';
values = {0.6, 0.7, 0.8};
values = {0.6, 0.7, 0.8, 0.9};
opt = search_parameter(seq_idx, opt, fname, values);

% 8. search for threshold dis
% 6. search for threshold dis
fname = 'threshold_dis';
values = {1, 3, 5, 7};
opt = search_parameter(seq_idx, opt, fname, values);
Expand Down

0 comments on commit 9314527

Please sign in to comment.