From 839494413378f52ba41620c944331bfbbd445ee6 Mon Sep 17 00:00:00 2001 From: gongbudaizhe Date: Tue, 6 Dec 2016 21:26:27 +0800 Subject: [PATCH 1/5] cast tmplsize to make it json serializable Cast variable `tmplsize` from matlab double to python float --- run_trackers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_trackers.py b/run_trackers.py index b39e18b4..31e48677 100644 --- a/run_trackers.py +++ b/run_trackers.py @@ -129,7 +129,7 @@ def run_trackers(trackers, seqs, evalType, shiftTypeSet): else: r = Result(t, s.name, subS.startFrame, subS.endFrame, res['type'], evalType, res['res'], res['fps'], None) - try: r.tmplsize = res['tmplsize'][0] + try: r.tmplsize = butil.d_to_f(res['tmplsize'][0]) except: pass r.refresh_dict() seqResults.append(r) @@ -143,4 +143,4 @@ def run_trackers(trackers, seqs, evalType, shiftTypeSet): return trackerResults if __name__ == "__main__": - main(sys.argv[1:]) \ No newline at end of file + main(sys.argv[1:]) From 82389f66009df900b6ad428eaea923a856346742 Mon Sep 17 00:00:00 2001 From: gongbudaizhe Date: Tue, 6 Dec 2016 21:32:50 +0800 Subject: [PATCH 2/5] sort image files to get correct startFrame In linux system, os.listdir() seems to return unsorted filenames which breaks the get_format() since it simply use the first returned filename as the startFrame. --- scripts/butil/seq_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/butil/seq_config.py b/scripts/butil/seq_config.py index c785cc38..1a4a6b22 100644 --- a/scripts/butil/seq_config.py +++ b/scripts/butil/seq_config.py @@ -126,7 +126,7 @@ def make_seq_configs(loadSeqs): + 'check if config.py\'s DOWNLOAD_SEQS is True' sys.exit(1) - imgfiles = os.listdir(imgSrc) + imgfiles = sorted(os.listdir(imgSrc)) imgfiles = [x for x in imgfiles if x.split('.')[1] in ['jpg', 'png']] nz, ext, startFrame, endFrame = get_format(name, imgfiles) From 9df9b705fcdeab93f5b7da7a580ce99e04c73f86 Mon Sep 17 00:00:00 2001 From: Bi Li Date: Wed, 24 May 2017 15:35:11 +0800 Subject: [PATCH 3/5] add missing json import --- scripts/butil/seq_config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/butil/seq_config.py b/scripts/butil/seq_config.py index 1a4a6b22..c6bb693f 100644 --- a/scripts/butil/seq_config.py +++ b/scripts/butil/seq_config.py @@ -2,6 +2,7 @@ import zipfile import shutil import copy +import json from PIL import Image From bdae201fcb44bcf76d1745b816ef199c0cf22caf Mon Sep 17 00:00:00 2001 From: Bi Li Date: Wed, 24 May 2017 19:56:27 +0800 Subject: [PATCH 4/5] Update load_results.py --- scripts/butil/load_results.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/butil/load_results.py b/scripts/butil/load_results.py index 5a0e374e..f524cf38 100644 --- a/scripts/butil/load_results.py +++ b/scripts/butil/load_results.py @@ -1,3 +1,4 @@ +import sys from config import * from scripts import * @@ -109,4 +110,4 @@ def load_scores(evalType, tracker, testname): attr.successRateList = map(lambda o:o*100, attr.successRateList) attrs.append(attr) attrs.sort() - return attrs \ No newline at end of file + return attrs From bde15825cff6874ef025d9f615c410d326b0c69b Mon Sep 17 00:00:00 2001 From: Bi Li Date: Wed, 24 May 2017 20:25:01 +0800 Subject: [PATCH 5/5] Update load_results.py --- scripts/butil/load_results.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/butil/load_results.py b/scripts/butil/load_results.py index f524cf38..64dfb088 100644 --- a/scripts/butil/load_results.py +++ b/scripts/butil/load_results.py @@ -1,4 +1,6 @@ +import os import sys +import json from config import * from scripts import *