-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest_mgit.py
63 lines (50 loc) · 2.03 KB
/
test_mgit.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
from __future__ import absolute_import
import os
from mgit.experiments import *
if __name__ == '__main__':
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
# path for dataset and tracker_results
# the path of MGIT dataset
dataset_dir = "/path_to_MGIT"
# the path of tracker e.g. JointNLT results
root_dir = "/path_to_tracker_result"
# temporarily, the toolkit only support tiny version of MGIT
version = 'tiny'
# the subset of MGIT, please select train/test/val
subset = 'val'
# the path to save the experiment result
save_dir = os.path.join(root_dir, 'result')
repetitions = 1
attribute_list = [
'delta_blur',
'color_constancy_tran',
'delta_color_constancy_tran',
'corrcoef',
'ratio',
'delta_ratio',
'scale',
'delta_scale',
'motion',
'occlusion',
]
# """
# I. CONVERT RESULTS TO MGIT FORMAT
# Note:
# convert tracking results of algorithms based on pytracking framework e.g. JointNLT to MGIT format
# """
# tracker name
tracker_name = "jointnlt"
# original result folder name
original_results_folder = "swin_b_ep300"
# covert results to MGIT format
for repetition in range(repetitions):
experiment = ExperimentMGIT(dataset_dir, save_dir, subset, repetition + 1, version)
# the original results path will be "root_dir/tracker_name/original_results_folder", and the converted results will be saved to "root_dir/result"
experiment.convert_results(root_dir, tracker_name, original_results_folder)
# """ II. EVALUATION Note: please set your tracker in first, then add the other trackers (you can download
# existing tracking results for 20 SOTA trackers via http://videocube.aitestunion.com/) """
# """evaluation in OPE"""
tracker_names = ['jointnlt']
for repetition in range(repetitions):
experiment = ExperimentMGIT(dataset_dir, save_dir, subset, repetition + 1, version)
experiment.report(tracker_names, attribute_name='normal')