-
Notifications
You must be signed in to change notification settings - Fork 25
/
example.py
71 lines (62 loc) · 2.61 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import time
import trackdat
import trackdat.dataset
alov_dir = 'alov'
dtb70_dir = 'dtb70'
ilsvrc_dir = 'ilsvrc'
nfs_dir = 'nfs'
nuspro_dir = 'nuspro'
otb_dir = 'otb'
tc128_dir = 'tc128'
tlp_dir = 'tlp'
uav123_dir = 'uav123'
vot2013_dir = 'vot2013'
vot2014_dir = 'vot2014'
vot2015_dir = 'vot2015'
vot2016_dir = 'vot2016'
vot2017_dir = 'vot2017'
ytbb_dir = 'ytbb'
datasets = [
dict(func=trackdat.load_alov, dir=alov_dir, kwargs=dict()),
dict(func=trackdat.load_dtb70, dir=dtb70_dir, kwargs=dict()),
dict(func=trackdat.load_ilsvrc, dir=ilsvrc_dir, kwargs=dict(subset='val')),
dict(func=trackdat.load_ilsvrc, dir=ilsvrc_dir, kwargs=dict(subset='train')),
dict(func=trackdat.load_nfs, dir=nfs_dir, kwargs=dict(fps=240)),
dict(func=trackdat.load_nfs, dir=nfs_dir, kwargs=dict(fps=30)),
dict(func=trackdat.load_nuspro, dir=nuspro_dir, kwargs=dict()),
dict(func=trackdat.load_otb, dir=otb_dir, kwargs=dict()),
dict(func=trackdat.load_otb, dir=otb_dir, kwargs=dict(subset='cvpr13')),
dict(func=trackdat.load_otb, dir=otb_dir, kwargs=dict(subset='tb_50')),
dict(func=trackdat.load_otb, dir=otb_dir, kwargs=dict(subset='tb_100')),
dict(func=trackdat.load_tc128, dir=tc128_dir, kwargs=dict(keep_prev=False)),
dict(func=trackdat.load_tc128, dir=tc128_dir, kwargs=dict(keep_prev=True)),
dict(func=trackdat.load_tlp, dir=tlp_dir, kwargs=dict()),
dict(func=trackdat.load_uav123, dir=uav123_dir, kwargs=dict()),
dict(func=trackdat.load_vot, dir=vot2013_dir, kwargs=dict()),
dict(func=trackdat.load_vot, dir=vot2014_dir, kwargs=dict()),
dict(func=trackdat.load_vot, dir=vot2015_dir, kwargs=dict()),
dict(func=trackdat.load_vot, dir=vot2016_dir, kwargs=dict()),
dict(func=trackdat.load_vot, dir=vot2017_dir, kwargs=dict()),
dict(func=trackdat.load_ytbb_sec, dir=ytbb_dir, kwargs=dict(subset='validation')),
dict(func=trackdat.load_ytbb_sec, dir=ytbb_dir, kwargs=dict(subset='train')),
]
def main():
parser = argparse.ArgumentParser()
parser.add_argument('data_root', metavar='data/')
args = parser.parse_args()
for x in datasets:
print(x)
dataset_dir = os.path.join(args.data_root, x['dir'])
start = time.time()
dataset = x['func'](dataset_dir, **x['kwargs'])
dur = time.time() - start
print('number of tracks:', len(dataset.tracks()))
print('time to load: {:.3g} sec'.format(dur))
trackdat.dataset.assert_image_files_exist(dataset_dir, dataset)
if __name__ == '__main__':
main()