HDT算法(Hedged Deep Tracking)是发表在cvpr2016上的一篇论文,关于HDT跟踪算法代码运行的资料比较少,可能大家对这个算法的关注度不是很高吧,这里简单写下自己调试的过程。
一、论文和代码下载
论文:Hedged Deep Tracking
代码:https://github.com/JHvisionchen/HDT-matlab
作者的project页面始终打不开(https://sites.google.com/site/yuankiqi/hdt/),只找到了这个链接。代码下载下来后解压缩并命名为HDT
网络:http://www.vlfeat.org/matconvnet/models/beta16/imagenet-vgg-verydeep-19.mat(代码中用到的CNN网络)
将网络下载下来后,我是在代码文件夹HDT中新建model文件夹,然后将imagenet-vgg-verydeep-19.mat文件放进去。
二、代码调试
首先在run_tracker.m文件中把base_path和pathModel两个变量路径改一下,base_path应该指向自己下载的数据集文件夹位置,这里我使用的是OTB2013数据集;pathModel就是刚才下载的
imagenet-vgg-verydeep-19.mat文件所在位置:
% path to the folder with VOT sequences
base_path = 'F:/Postgraduate Learning/OTB/TB50/';
pathModel = './model/imagenet-vgg-verydeep-19.mat';
这时候点击运行会发现好久没反应,然后突然出现如下错误:
出错是因为get_features.m文件中载入了网络,但是网络中没有‘meta’这个字段,设置断点后发现网络中真的是没有这个字段,不知道这个是不是作者的原代码,最后参考HCF算法,对几个文件进行了改动:
1. run_tracker.m
%error('Note: you need to compile the Matconvnet according to Readme.txt, and then comment the FIRST line in run_HDT.m')
addpath('model','matconvnet/matlab');
vl_setupnn();
vl_compilenn();
% path to the folder with VOT sequences
base_path = 'F:/Postgraduate Learning/OTB/TB50/';
% choose name of the VOT sequence
sequence_name = choose_video(base_path);
images_folder = [base_path sequence_name '/img/'];
pathAnno = [base_path sequence_name '/groundtruth_rect.txt'];
pathModel = './model/imagenet-vgg-verydeep-19.mat';
show_visualization = 1;
images = dir(fullfile(images_folder,