-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
45 lines (32 loc) · 1.07 KB
/
test.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
"""
Test SiamFC & DaSiamRPN on GOT-10k
@ fansiqi 2020.4.21
"""
from __future__ import absolute_import
import argparse
from got10k.experiments import *
from DaSiamRPN.tracker import TrackerDaSiamRPN
from SiamFC.tracker import TrackerSiamFC
def test(model_name):
# setup tracker
if model_name == 'SiamFC':
tracker = TrackerSiamFC("./SiamFC/SiamFC.pth")
elif model_name == 'DaSiamRPN':
tracker = TrackerDaSiamRPN("./DaSiamRPN/DaSiamRPN.pth")
# setup experiments
experiments = [
ExperimentGOT10k('data/GOT-10k', subset='test')
]
# run tracking experiments and report performance
for e in experiments:
e.run(tracker, visualize=False)
e.report([tracker.name])
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-model_id', default=0, help="0---SiamFC, 1---DaSiamRPN")
args = parser.parse_args()
model_id = args.model_id
model_name = "DaSiamRPN" if model_id else "SiamFC"
print ("-"*30)
print ("Test {} model".format(model_name))
test(model_name)