【技术向】目标跟踪UAV123数据集下载及使用指南

更新时间:2023-06-24 11:30:47 阅读: 评论:0

【技术向】⽬标跟踪UAV123数据集下载及使⽤指南
⽂章⽬录
今天推⼀篇普及性⽂章,⼤家知道⽬标跟踪常⽤数据集有OTB和VOT系列,现在还有更⼤的数据集LASOT和TrackingNet出现,此外有⼀个叫做UAV123的数据集,是⼀个专门场景的数据集,都是⽤⽆⼈机拍摄,特点是背景⼲净,视⾓变化较多,包含123个视频,总⼤⼩在13.5G左右。⼀些知名的跟踪算法会使⽤UAV进⾏评测,⽐如ECO等。可以查看UAV论⽂看看详细介绍? 。本⽂将提供该数据集的下载及使⽤⽅法,⾃跑⾃评,不⽤其他⼯具。有问题欢迎讨论~
1. 下载
下载渠道1:?
下载渠道2:?,提取码:7lwk。其中包含5个压缩包,⼀起解压就⾏。
2.使⽤指南
2.1 主要⽂件
anno⽂件夹包含UAV20L和UAV123的groundtruth标注,格式为左上⾓坐标和长宽四个值⼀⾏/帧,我们⼀般使⽤的是UAV123,其中⼦⽂件夹att包含每个视频的属性标注,具体可以查看主⽬录下的DatatAnnotation.pdf⽂件;
第⼆个是data_q⽂件夹,包含数据集的所有图⽚⽂件命名⽅式为06i.jpg;
还有⼀个configSeqs.m⽂件,是模仿OTB⼯具的视频信息⽂件,后⾯我们将使⽤它进⾏简单的跑库。
2.2 预处理
写了⼀个utils_UAV.m⽂件,⾥⾯有⼀些实⽤的程序,可以在⽹盘中下载。
我们的⽬标是做成OTB数据集那样的格式便于跑库,每个视频还缺⼀个frame⽂件,即指定起始帧和终⽌帧的⽂件,可以通过configSeqs.m⽣成,⾸先在主⽬录新建frame⽂件夹,然后运⾏下⾯程序。
%% achieve frame files like OTB
ba_path = '主⽬录/anno/UAV123/';
qs = configSeqs;
for i = 1:numel(qs)
frame_name = [qs{i}.name '_'];
file_name = ['./frame/' frame_name];
fid  = fopen(file_name, 'wt');
fprintf(fid, '%d,%d\n',qs{i}.startFrame, qs{i}.endFrame);
fclo(fid);
end
下⾯我们打印⼀下每个视频的名称,便于后⾯跑库使⽤
%% print q names
fid  = fopen('','wt');
for i = 1:numel(qs)
fprintf(fid, '''%s'',',qs{i}.name);
end
fclo(fid);
当然你也可以检查⼀下是不是都是彩⾊视频
形容高兴的词ba_path = '主⽬录/data_q/UAV123/';
for i = 1:numel(qs)
img = imread([ba_path qs{i}.name '/' num2str(qs{i}.startFrame, '%06i.jpg')]);
if size(img,3) == 1
disp([qs{i}.name]);
end
end
2.3 跑库与评测
2.3.1 跑库
我们以ECO为例,跑ECO-HC跟踪算法,你也可以跑SRDCF算法,设置都⼀样。你可以下载我⽤来跑库的ECO的⽰例?
⾸先在ECO代码⽂件中,utils⽂件夹中增加⼀个类似load_video_info.m的⽂件⽤于提取UAV数据集的信息,起名为
load_video_info_UAV.m,内容如下
function [q, ground_truth] = load_video_info_UAV(gt_path, img_path, frame_path, testSet, qs)
ground_truth = load([gt_path testSet '.txt']);
q.format = 'otb';
q.len = size(ground_truth, 1);
q.init_rect = ground_truth(1,:);
f = fopen([frame_path testSet '_']);
frames = textscan(f, '%f,%f');
fclo(f);
img_path = qs.path;
img_files = num2str((frames{1}:frames{2})', [img_path '%06i.jpg']);
q.s_frames = cellstr(img_files);
end
然后ECO代码主⽬录新建⼀个跑库主函数demo_UAV.m,并把UAV123数据集中的configSeqs.m⽂件复制进来。demo_UAV.m内容如下
% Add paths
tup_paths();
qs = configSeqs;
% Load video information
gt_path = 'UAV123主⽬录/anno/UAV123/';
img_path = 'UAV123主⽬录/data_q/UAV123/';
frame_path = 'UAV123主⽬录/frame/';
UAV123 = {'bike1','bike2','bike3','bird1_1','bird1_2','bird1_3','boat1','boat2','boat3','boat4','boat5','boat6','boat7','boat8','boat9','building1','building2','building 3','building4',...
'building5','car1_1','car1_2','car1_3','car2','car3','car4','car5','car6_1','car6_2','car6_3','car6_4','car6_5','car7','car8_1','car8_2','car9','car10','car11','car1 2','car13',...
'car14','car15','car16_1','car16_2','car17','car18','group1_1','group1_2','group1_3','group1_4','group2_1','group2_2','group2_3','group3_1','group3_2','gr oup3_3','group3_4',...
'person1','person2_1','person2_2','person3','person4_1','person4_2','person5_1','person5_2','person6','person7_1','person7_2','person8_1','person8_2' ,'person9','person10',...
'person11','person12_1','person12_2','person13','person14_1','person14_2','person14_3','person15','person16','person17_1','person17_2','person18','p erson19_1','person19_2',...浓毛老太太
'person19_3','person20','person21','person22','person23','truck1','truck2','truck3','truck4_1','truck4_2','uav1_1','uav1_2','uav1_3','uav2','uav3','uav4','uav 5','uav6','uav7',...
'uav8','wakeboard1','wakeboard2','wakeboard3','wakeboard4','wakeboard5','wakeboard6','wakeboard7','wakeboard8','wakeboard9','wakeboard10','car1 _s','car2_s','car3_s','car4_s',...
'person1_s','person2_s','person3_s'};
testSet = UAV123;运动会入场式
if ~exist('res', 'dir')
mkdir('res');
end
%% run UAV
for i = 1:length(testSet)
[q, ground_truth] = load_video_info_UAV(gt_path, img_path, frame_path, testSet{i}, qs{i});
results = testing_ECO_HC(q);
res = s;
save(['./res/' testSet{i} '_UAV.mat'], 'res');
end
白羊男和双鱼女
2.3.2 评测
注意我们把结果的形式保存成中⼼坐标和长宽的形式,以便于下⾯的评测。评测主要指标是AUC和精度,和OTB报告的⼀样,只不过没有曲线图,想要可以⾃⼰加。
评测时把run UAV下⾯都注释掉,增加评测代码如下
average_center_location_error_sum=0;
distance_precision_sum=0;
PASCAL_precision_sum=0;
Overlap_sum=0;
fps_sum=0;
fid = fopen('', 'wt');
for i = 1:length(testSet)
[q, ground_truth] = load_video_info_UAV(gt_path, img_path, frame_path, testSet{i}, qs{i});
ground_truth = [ground_truth(:,[2,1]) + (ground_truth(:,[4,3])-1)/2 , ground_truth(:,[4,3])];
results.fps = 0;
load(['./res/' testSet{i} '_UAV.mat'], 'res');
ground_truth2 = [];
positions2 = [];
for j = 1:size(ground_truth,1)
if isnan(ground_truth(j,1))
continue;
el
ground_truth2 =  [ground_truth2;ground_truth(j,1:4)];
positions2 = [positions2; res(j,1:4)];
end
end
[distance_precision, PASCAL_precision, average_center_location_error, Overlap] = ...
compute_performance_measures(positions2, ground_truth2, 20, 0.5);
disp([num2str(Overlap) testSet{i}]);
fprintf(fid, '%.5g %%, %s\n', 100*Overlap, testSet{i});
average_center_location_error_sum=average_center_location_error_sum+average_center_location_error;
distance_precision_sum=distance_precision_sum+distance_precision;
PASCAL_precision_sum=PASCAL_precision_sum+PASCAL_precision;
Overlap_sum=Overlap_sum+Overlap;
fps_sum=fps_sum+results.fps;
end
average_center_location_error=average_center_location_error_sum/length(testSet);
distance_precision=distance_precision_sum/length(testSet);
PASCAL_precision=PASCAL_precision_sum/length(testSet);
Overlap=Overlap_sum/length(testSet);
fps=fps_sum/length(testSet);
fprintf('Center Location Error: %.3g pixels\nDistance Precision: %.3g %%\nOverlap Precision: %.5g %%\nOverlap: %.5g%%\nSpeed: %.5g fps\n', ...    average_center_location_error, 100*distance_precision, 100*PASCAL_precision,100*Overlap, fps);
fprintf(fid, '%.5g %%, %s\n', 100*Overlap, 'All');
读书心得体会500字fclo(fid);
其中compute_performance_measures函数如下
function [distance_precision, PASCAL_precision, average_center_location_error,Overlap] = ...茉莉花的作用
compute_performance_measures(positions, ground_truth, distance_precision_threshold, PASCAL_threshold)
% [distance_precision, PASCAL_precision, average_center_location_error] = ...
%    compute_performance_measures(positions, ground_truth, distance_precision_threshold, PASCAL_threshold)
%
% For the given tracker output positions and ground truth it computes the:
% * Distance Precision at the specified threshold (20 pixels as default if
% omitted)
% * PASCAL Precision at the specified threshold (0.5 as default if omitted)
% * Average Center Location error (CLE).
%
% The tracker positions and ground truth must be Nx4-matrices where N is
% the number of time steps in the tracking. Each row has to be on the form
% [c1, c2, s1, s2] where (c1, c2) is the center coordinate and s1 and s2
% are the size in the first and cond dimension respectively (the order of
% x and y does not matter here).
if nargin < 3 || impty(distance_precision_threshold)
distance_precision_threshold = 20;
end
if nargin < 4 || impty(PASCAL_threshold)
PASCAL_threshold = 0.5;
备课的重要性end
if size(positions,1) ~= size(ground_truth,1),
disp('Could not calculate precisions, becau the number of ground')
disp('truth frames does not match the number of tracked frames.')
return
end
%calculate distances to ground truth over all frames
distances = sqrt((positions(:,1) - ground_truth(:,1)).^2 + ...
(positions(:,2) - ground_truth(:,2)).^2);
distances(isnan(distances)) = [];
%calculate distance precision
distance_precision = nnz(distances < distance_precision_threshold) / numel(distances);
%calculate average center location error (CLE)
average_center_location_error = mean(distances);
%calculate the overlap in each dimension
overlap_height = min(positions(:,1) + positions(:,3)/2, ground_truth(:,1) + ground_truth(:,3)/2) ...
- max(positions(:,1) - positions(:,3)/2, ground_truth(:,1) - ground_truth(:,3)/2);
overlap_width = min(positions(:,2) + positions(:,4)/2, ground_truth(:,2) + ground_truth(:,4)/2) ...
- max(positions(:,2) - positions(:,4)/2, ground_truth(:,2) - ground_truth(:,4)/2);
% if no overlap, t to zero
overlap_height(overlap_height < 0) = 0;
overlap_width(overlap_width < 0) = 0;
睡前公主故事
% remove NaN values (should not exist any)
valid_ind = ~isnan(overlap_height) & ~isnan(overlap_width);
% calculate area
overlap_area = overlap_height(valid_ind) .* overlap_width(valid_ind);
tracked_area = positions(valid_ind,3) .* positions(valid_ind,4);
ground_truth_area = ground_truth(valid_ind,3) .* ground_truth(valid_ind,4);
% calculate PASCAL overlaps
overlaps = overlap_area ./ (tracked_area + ground_truth_area - overlap_area);
% calculate PASCAL precision
Overlap = mean(overlaps);
PASCAL_precision = nnz(overlaps >= PASCAL_threshold) / numel(overlaps);
end
2.3.3 注意事项
1. UAV的视频部分有⽬标完全离开视野的情况,这种情况的groundtruth标注为NaN,NaN,NaN,NaN,所以在评测时我们先把这部分帧
剔除再进⾏计算;
2. 这种⾃跑⾃评的⽅法不限于UAV库,OTB和VOT都适⽤。

本文发布于:2023-06-24 11:30:47,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1052694.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:数据   视频   包含
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图