forked from jwlim/tracker_benchmark
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrun_CPF.py
More file actions
30 lines (23 loc) · 749 Bytes
/
run_CPF.py
File metadata and controls
30 lines (23 loc) · 749 Bytes
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
import subprocess
import time
import numpy as np
from config import *
def run_CPF(seq, rp, bSaveImage):
x = seq.init_rect[0] - 1
y = seq.init_rect[1] - 1
w = seq.init_rect[2]
h = seq.init_rect[3]
path = './results/'
if not os.path.exists(path):
os.makedirs(path)
command = list(map(str,['ObjTrk.exe', '1', path , seq.name, seq.path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h]))
tic = time.clock()
subprocess.call(command)
duration = time.clock() - tic
result = dict()
res = np.loadtxt(path + '{0}_CPF.txt'.format(seq.name), dtype=int)
result['res'] = res.tolist()
result['type'] = 'rect'
result['fps'] = round(seq.len / duration, 3)
return result