Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

# for evaluating results
thresholdSetOverlap = [x/float(20) for x in range(21)]
thresholdSetError = range(0, 51)
thresholdSetError = list(range(0, 51))

# for drawing plot
MAXIMUM_LINES = 10
Expand Down
30 changes: 15 additions & 15 deletions draw_bbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,54 +8,54 @@

def main():
evalTypes = ['OPE', 'SRE', 'TRE']
print "Eval types"
print("Eval types")
for i in range(len(evalTypes)):
evalType = evalTypes[i]
print "{0:2d}. {1}".format(i+1, evalType)
print("{0:2d}. {1}".format(i+1, evalType))

while True:
n = int(raw_input("\nInput evalType number (-1 to exit) : "))
n = int(input("\nInput evalType number (-1 to exit) : "))
if n == -1:
sys.exit()
try:
evalType = evalTypes[n-1]
break
except:
print "invalid number"
print("invalid number")

src = RESULT_SRC.format(evalType)
trackers = os.listdir(src)
print "\nTrackers"
print("\nTrackers")
for i in range(len(trackers)):
t = trackers[i]
print "{0:2d}. {1}".format(i+1, t)
print("{0:2d}. {1}".format(i+1, t))

while True:
n = int(raw_input("\nInput tracker number (-1 to exit) : "))
n = int(input("\nInput tracker number (-1 to exit) : "))
if n == -1:
sys.exit()
try:
tracker = trackers[n-1]
break
except:
print "invalid number"
print("invalid number")

src = src + '/' + tracker + '/'
seqs = [x for x in os.listdir(src) if x.endswith('.json')]

while True:
print "\nSequences"
print("\nSequences")
for i in range(len(seqs)):
s = seqs[i]
print "{0:2d}. {1}".format(i+1, s)
print("{0:2d}. {1}".format(i+1, s))
results = []
n = int(raw_input("\nInput sequence number (-1 to exit) : "))
n = int(input("\nInput sequence number (-1 to exit) : "))
if n == -1:
sys.exit()
try:
resultFile = open(os.path.join(src, seqs[n-1]))
except:
print "invalid number"
print("invalid number")

string = resultFile.read()
jsonList = json.loads(string)
Expand All @@ -65,15 +65,15 @@ def main():

for i in range(len(results)):
result = results[i]
print "{0:2d}. startFrame : {1},\tshiftType : {2}".format(i+1, result.startFrame, result.shiftType)
print("{0:2d}. startFrame : {1},\tshiftType : {2}".format(i+1, result.startFrame, result.shiftType))

n = int(raw_input("\nInput result number (-1 to exit) : "))
n = int(input("\nInput result number (-1 to exit) : "))
if n == -1:
sys.exit()
try:
result = results[n-1]
except:
print "invalid number"
print("invalid number")
continue

seq = butil.load_seq_config(result.seqName)
Expand Down
4 changes: 2 additions & 2 deletions draw_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def main():
evalTypes = ['OPE']
testname = 'tb50'
testname = 'tb100'
for i in range(len(evalTypes)):
evalType = evalTypes[i]
result_src = RESULT_SRC.format(evalType)
Expand Down Expand Up @@ -41,7 +41,7 @@ def get_graph(scoreList, fignum, evalType, testname):
plt.plot(thresholdSetOverlap, attr.successRateList,
label='', alpha=0.5, c='#202020', ls='--')
else:
print 'err'
print('err')
plt.title('{0}_{1} (sequence average)'.format(evalType, testname.upper()))
plt.rcParams.update({'axes.titlesize': 'medium'})
plt.xlabel('thresholds')
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Trakcer Benchmark (Tested on python 2.7.10)
Trakcer Benchmark (Tested on python 3.6)

Usage
- Default (for all trackers, all sequences, all evaltypes(OPE, SRE, TRE))
Expand Down
50 changes: 25 additions & 25 deletions run_trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def main(argv):
opts, args = getopt.getopt(argv, "ht:e:s:",["tracker=","evaltype="
,"sequence="])
except getopt.GetoptError:
print 'usage : run_trackers.py -t <trackers> -s <sequences>' \
+ '-e <evaltypes>'
print('usage : run_trackers.py -t <trackers> -s <sequences>' \
+ '-e <evaltypes>')
sys.exit(1)

for opt, arg in opts:
if opt == '-h':
print 'usage : run_trackers.py -t <trackers> -s <sequences>' \
+ '-e <evaltypes>'
print('usage : run_trackers.py -t <trackers> -s <sequences>' \
+ '-e <evaltypes>')
sys.exit(0)
elif opt in ("-t", "--tracker"):
trackers = [x.strip() for x in arg.split(',')]
Expand All @@ -38,11 +38,11 @@ def main(argv):
# evalTypes = [arg]

if SETUP_SEQ:
print 'Setup sequences ...'
print('Setup sequences ...')
butil.setup_seqs(loadSeqs)
testname = raw_input("Input Test name : ")
print 'Starting benchmark for {0} trackers, evalTypes : {1}'.format(
len(trackers), evalTypes)
testname = input("Input Test name : ")
print('Starting benchmark for {0} trackers, evalTypes : {1}'.format(
len(trackers), evalTypes))
for evalType in evalTypes:
seqNames = butil.get_seq_names(loadSeqs)
seqs = butil.load_seq_configs(seqNames)
Expand All @@ -53,23 +53,23 @@ def main(argv):
if len(results) > 0:
evalResults, attrList = butil.calc_result(tracker,
seqs, results, evalType)
print "Result of Sequences\t -- '{0}'".format(tracker)
print("Result of Sequences\t -- '{0}'".format(tracker))
for seq in seqs:
try:
print '\t\'{0}\'{1}'.format(
seq.name, " "*(12 - len(seq.name))),
print "\taveCoverage : {0:.3f}%".format(
sum(seq.aveCoverage)/len(seq.aveCoverage) * 100),
print "\taveErrCenter : {0:.3f}".format(
sum(seq.aveErrCenter)/len(seq.aveErrCenter))
print('\t\'{0}\'{1}'.format(
seq.name, " "*(12 - len(seq.name))), end=' ')
print("\taveCoverage : {0:.3f}%".format(
sum(seq.aveCoverage)/len(seq.aveCoverage) * 100), end=' ')
print("\taveErrCenter : {0:.3f}".format(
sum(seq.aveErrCenter)/len(seq.aveErrCenter)))
except:
print '\t\'{0}\' ERROR!!'.format(seq.name)
print('\t\'{0}\' ERROR!!'.format(seq.name))

print "Result of attributes\t -- '{0}'".format(tracker)
print("Result of attributes\t -- '{0}'".format(tracker))
for attr in attrList:
print "\t\'{0}\'".format(attr.name),
print "\toverlap : {0:02.1f}%".format(attr.overlap),
print "\tfailures : {0:.1f}".format(attr.error)
print("\t\'{0}\'".format(attr.name), end=' ')
print("\toverlap : {0:02.1f}%".format(attr.overlap), end=' ')
print("\tfailures : {0:.1f}".format(attr.error))

if SAVE_RESULT :
butil.save_scores(attrList, testname)
Expand All @@ -91,7 +91,7 @@ def run_trackers(trackers, seqs, evalType, shiftTypeSet):
for idxTrk in range(len(trackers)):
t = trackers[idxTrk]
if not os.path.exists(TRACKER_SRC + t):
print '{0} does not exists'.format(t)
print('{0} does not exists'.format(t))
sys.exit(1)
if not OVERWRITE_RESULT:
trk_src = os.path.join(RESULT_SRC.format(evalType), t)
Expand All @@ -103,9 +103,9 @@ def run_trackers(trackers, seqs, evalType, shiftTypeSet):
seqResults = []
seqLen = len(subSeqs)
for idx in range(seqLen):
print '{0}_{1}, {2}_{3}:{4}/{5} - {6}'.format(
print('{0}_{1}, {2}_{3}:{4}/{5} - {6}'.format(
idxTrk + 1, t, idxSeq + 1, s.name, idx + 1, seqLen, \
evalType)
evalType))
rp = tmpRes_path + '_' + t + '_' + str(idx+1) + '/'
if SAVE_IMAGE and not os.path.exists(rp):
os.makedirs(rp)
Expand All @@ -117,8 +117,8 @@ def run_trackers(trackers, seqs, evalType, shiftTypeSet):
try:
res = eval(funcName)
except:
print 'failed to execute {0} : {1}'.format(
t, sys.exc_info())
print('failed to execute {0} : {1}'.format(
t, sys.exc_info()))
os.chdir(WORKDIR)
break
os.chdir(WORKDIR)
Expand Down
6 changes: 3 additions & 3 deletions scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from model import *
from bscripts import *
import butil
from .model import *
from .bscripts import *
from . import butil
46 changes: 23 additions & 23 deletions scripts/bscripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
from run_ASLA import *
from run_BSBT import *
from run_CPF import *
from run_CT import *
from run_CXT import *
from run_DFT import *
from run_Frag import *
from run_IVT import *
from run_KMS import *
from run_L1APG import *
from run_LOT import *
from run_LSK import *
from run_MIL import *
from run_MTT import *
from run_OAB import *
from run_ORIA import *
from run_SBT import *
from run_SCM import *
from run_SMS import *
from run_Struck import *
from run_TLD import *
from run_MUSTer import *
from run_MEEM import *
from .run_ASLA import *
from .run_BSBT import *
from .run_CPF import *
from .run_CT import *
from .run_CXT import *
from .run_DFT import *
from .run_Frag import *
from .run_IVT import *
from .run_KMS import *
from .run_L1APG import *
from .run_LOT import *
from .run_LSK import *
from .run_MIL import *
from .run_MTT import *
from .run_OAB import *
from .run_ORIA import *
from .run_SBT import *
from .run_SCM import *
from .run_SMS import *
from .run_Struck import *
from .run_TLD import *
from .run_MUSTer import *
from .run_MEEM import *
2 changes: 1 addition & 1 deletion scripts/bscripts/run_ASLA.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def run_ASLA(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bscripts/run_BSBT.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def run_BSBT(seq, rp, bSaveImage):
if not os.path.exists(path):
os.makedirs(path)

command = map(str,['BeyondSemiBoostingTracker.exe', '100', '0.99', '2',
command = list(map(str,['BeyondSemiBoostingTracker.exe', '100', '0.99', '2',
'0', '0', '0', seq.name, seq.path, seq.startFrame, seq.endFrame,
seq.nz, seq.ext, x, y, w, h])
seq.nz, seq.ext, x, y, w, h]))

tic = time.clock()
subprocess.call(command)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bscripts/run_CPF.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def run_CPF(seq, rp, bSaveImage):
if not os.path.exists(path):
os.makedirs(path)

command = map(str,['ObjTrk.exe', '1', path , seq.name, seq.path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h])
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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_CT.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def run_CT(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bscripts/run_CXT.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def run_CXT(seq, rp, bSaveImage):
if not os.path.exists(path):
os.makedirs(path)

command = map(str,['CXT.exe', '1', '0', '0', '1', seq.name, seq.path, path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h])
command = list(map(str,['CXT.exe', '1', '0', '0', '1', seq.name, seq.path, path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h]))

tic = time.clock()
subprocess.call(command)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_DFT.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def run_DFT(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bscripts/run_Frag.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def run_Frag(seq, rp, bSaveImage):
w = seq.init_rect[2]
h = seq.init_rect[3]

command = map(str,['fragtrack.exe', '25', '16', '3', '0', '0',
command = list(map(str,['fragtrack.exe', '25', '16', '3', '0', '0',
seq.name, seq.path, seq.startFrame, seq.endFrame, \
seq.nz, seq.ext, x, y, w, h])
seq.nz, seq.ext, x, y, w, h]))

tic = time.clock()
subprocess.call(command)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_IVT.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
def run_IVT(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
4 changes: 2 additions & 2 deletions scripts/bscripts/run_KMS.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def run_KMS(seq, rp, bSaveImage):
if not os.path.exists(path):
os.makedirs(path)

command = map(str,['ObjTrk.exe', '0', path , seq.name, seq.path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h])
command = list(map(str,['ObjTrk.exe', '0', path , seq.name, seq.path,
seq.startFrame, seq.endFrame, seq.nz, seq.ext, x, y, w, h]))

tic = time.clock()
subprocess.call(command)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_L1APG.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def run_L1APG(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_LOT.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
def run_LOT(seq, rp, bSaveImage):
global m
if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()
m.addpath(m.genpath('.', nargout=1), nargout=0)
seq.init_rect = matlab.double(seq.init_rect)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bscripts/run_MEEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def run_MEEM(seq, rp, bSaveImage):
global m

if m == None:
print 'Starting matlab engine...'
print('Starting matlab engine...')
m = matlab.engine.start_matlab()

m.addpath(m.genpath('.', nargout=1), nargout=0)
Expand Down
Loading