From 294887e1e58d95c199b9738b597d2eb8f0af051b Mon Sep 17 00:00:00 2001 From: wenqi_yang <983981759@qq.com> Date: Tue, 29 Mar 2022 15:15:32 +0800 Subject: [PATCH 1/2] change to flexible parameters --- .../cv/tracking/SiamFC/test/eval_acc_perf.sh | 2 +- .../contrib/cv/tracking/SiamFC/wholeprocess.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ACL_PyTorch/contrib/cv/tracking/SiamFC/test/eval_acc_perf.sh b/ACL_PyTorch/contrib/cv/tracking/SiamFC/test/eval_acc_perf.sh index 0da3b119dd..675ee3eb96 100644 --- a/ACL_PyTorch/contrib/cv/tracking/SiamFC/test/eval_acc_perf.sh +++ b/ACL_PyTorch/contrib/cv/tracking/SiamFC/test/eval_acc_perf.sh @@ -14,7 +14,7 @@ source env.sh rm -rf ./result/* echo "====conducting preprocess, inferrence and postprocess====" -python3.7 wholeprocess.py ${datasets_path}/OTB/ ./pre_dataset ./dataset_info $(arch) 0 +python3.7 wholeprocess.py ${datasets_path}/OTB/ ./pre_dataset ./dataset_info $(arch) 0 ./benchmark.${arch} ./om/ if [ $? != 0 ]; then echo "fail!" exit -1 diff --git a/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py b/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py index a41baadaa3..165ed8eb47 100644 --- a/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py +++ b/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py @@ -242,10 +242,10 @@ class ExperimentOTB(object): file1.write(content) file1.write('\n') # infer - os.system('./benchmark.%s -model_type=vision -device_id=%d -batch_size=1 ' - '-om_path=./om/exemplar_bs1.om -input_text_path=%s ' + os.system('%s -model_type=vision -device_id=%d -batch_size=1 ' + '-om_path=s%/exemplar_bs1.om -input_text_path=%s ' '-input_width=127 -input_height=127 -output_binary=True -useDvpp=False >/dev/null 2>&1' - % (arch, deviceid, infopath)) + % (benchmark_path, deviceid, om_path, infopath)) # the exemplar has a result of 3*256*6*6 tensor # read tensor from bin filename = img_file.replace('/', '-').split('.')[0] + '_1.bin' @@ -260,10 +260,10 @@ class ExperimentOTB(object): file2.write(content) file2.write('\n') # infer - os.system('./benchmark.%s -model_type=vision -device_id=%d -batch_size=1 ' - '-om_path=./om/search_bs1.om -input_text_path=%s ' + os.system('%s -model_type=vision -device_id=%d -batch_size=1 ' + '-om_path=%s/search_bs1.om -input_text_path=%s ' '-input_width=255 -input_height=255 -output_binary=True -useDvpp=False >/dev/null 2>&1' - % (arch, deviceid, infopath)) + % (benchmark_path, deviceid, om_path, infopath)) # the exemplar has a result of 1*768*22*22 tensor # read tensor from bin filename = img_file.replace('/', '-').split('.')[0] + '_1.bin' @@ -281,7 +281,7 @@ class ExperimentOTB(object): def report(self, tracker_names): - assert isinstance(tracker_names, (list, tuple)) # ‘SiamFC’ + assert isinstance(tracker_names, (list, tuple)) # ‘SiamFC� # assume tracker_names[0] is your tracker report_dir = os.path.join(self.report_dir, tracker_names[0]) @@ -404,6 +404,8 @@ if __name__ == "__main__": info_path = sys.argv[3] arch = sys.argv[4] deviceid = int(sys.argv[5]) + benchmark_path = sys.argv[6] + om_path = sys.argv[7] os.system('rm -rf %s' % save_path) os.system('rm -rf %s' % info_path) os.system('rm -rf ./result/dumpOutput_device%d' % deviceid) -- Gitee From a6ea30d11743ff3c1bfbdcaf75380f79f52ff219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=96=87=E7=90=A6?= <983981759@qq.com> Date: Tue, 29 Mar 2022 07:23:00 +0000 Subject: [PATCH 2/2] =?UTF-8?q?update=20ACL=5FPyTorch/contrib/cv/tracking/?= =?UTF-8?q?SiamFC/wholeprocess.py.=20=E4=BF=AE=E6=94=B9=E6=97=A0=E6=84=8F?= =?UTF-8?q?=E4=B8=AD=E4=BF=AE=E6=94=B9=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py b/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py index 165ed8eb47..2bd05d5958 100644 --- a/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py +++ b/ACL_PyTorch/contrib/cv/tracking/SiamFC/wholeprocess.py @@ -281,7 +281,7 @@ class ExperimentOTB(object): def report(self, tracker_names): - assert isinstance(tracker_names, (list, tuple)) # ‘SiamFC� + assert isinstance(tracker_names, (list, tuple)) # ‘SiamFC’ # assume tracker_names[0] is your tracker report_dir = os.path.join(self.report_dir, tracker_names[0]) -- Gitee