diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_postprocess.py b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_postprocess.py index 74d8372c907ef3f05567680feeee7fe99e00889c..ed9b16d775028f3017a309bde789d14d031b6cc7 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_postprocess.py +++ b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_postprocess.py @@ -153,6 +153,7 @@ if __name__ == '__main__': if not os.path.exists("output/PEM_results"): os.makedirs("output/PEM_results") out_files = os.listdir(args.PEM_out_path) + print("processing...") for i in range(len(out_files)): video_name = str(out_files[i]) video_name = video_name[0:int(len(video_name)-6)] @@ -184,5 +185,6 @@ if __name__ == '__main__': df["xmax_score"]=video_xmax_score df["iou_score"]=video_data df.to_csv(args.result_path+'/'+video_name+".csv",index=False) - - BSN_post_processing() \ No newline at end of file + print("PGM: start generating BSN_post feature") + BSN_post_processing() + print("PGM: finish generate BSN_post feature") \ No newline at end of file diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_preprocess.py b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_preprocess.py index e0119ccf080d2866dac7a5ed093badf28a153304..04d12cd6ad285a4aa95b8a388c980ee2161dfeea 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_preprocess.py +++ b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_pem_preprocess.py @@ -68,6 +68,7 @@ if __name__ == '__main__': video_list = list(video_dict.keys()) print("%s subset video numbers: %d" %(subset,len(video_list))) + print("processing...") for i in range(len(video_list)): video_name = video_list[i] pdf=pandas.read_csv(pgm_proposals_path+video_name+".csv") diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_postprocess.py b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_postprocess.py index abd506c1e97d6cabec8d1635a25ead1a820afb24..0c4eb2b17719f79eb02a5239f72212c4d625a0fc 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_postprocess.py +++ b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_postprocess.py @@ -275,6 +275,7 @@ if __name__ == '__main__': out_files = os.listdir(args.TEM_out_path) if not os.path.exists("output/TEM_results"): os.makedirs("output/TEM_results") + print("processing...") for i in range(len(out_files)): video_name = str(out_files[i]) video_name = video_name[0:int(len(video_name)-6)] @@ -300,13 +301,13 @@ if __name__ == '__main__': if not os.path.exists("output/PGM_proposals"): os.makedirs("output/PGM_proposals") - print("PGM: start generate proposals") + print("PGM: start generating proposals") PGM_proposal_generation() print("PGM: finish generate proposals") if not os.path.exists("output/PGM_feature"): os.makedirs("output/PGM_feature") - print("PGM: start generate BSP feature") + print("PGM: start generating BSP feature") PGM_feature_generation() print("PGM: finish generate BSP feature") \ No newline at end of file diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_preprocess.py b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_preprocess.py index f516327076df4847a0f3c50b1b4fe74959078ef2..b6639216bfd21201bdb0ceb2cef1d6acdd68467b 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_preprocess.py +++ b/ACL_PyTorch/contrib/cv/detection/BSN/BSN_tem_preprocess.py @@ -53,6 +53,7 @@ if __name__ == '__main__': video_list = list(video_dict.keys()) print("%s subset video numbers: %d" %(subset,len(video_list))) + print("processing...") for i in range(len(video_list)): video_name=video_list[i] anchor_xmin=[temporal_gap*i for i in range(temporal_scale)] diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/README.md b/ACL_PyTorch/contrib/cv/detection/BSN/README.md index 44d20bc484eedac49396fac500defe4df51d1da0..66ee1c7705d2d51a3542015f126bd6ed6f982786 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/README.md +++ b/ACL_PyTorch/contrib/cv/detection/BSN/README.md @@ -127,9 +127,9 @@ export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$L export ASCEND_OPP_PATH=${install_path}/opp export ASCEND_AICPU_PATH=/usr/local/Ascend/ascend-toolkit/latest -atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs1 --input_format=NCHW --input_shape="video:1,400,100" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs1 --input_format=ND --input_shape="video:1,400,100" --log=debug --soc_version=Ascend310 -atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs1 --input_format=NCHW --input_shape="video_feature:1,1000,32" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs1 --input_format=ND --input_shape="video_feature:1,1000,32" --log=debug --soc_version=Ascend310 ``` @@ -154,17 +154,17 @@ python gen_dataset_info.py tem /home/wch/BSN/BSN-TEM-preprocess/feature TEM-vide ./benchmark.x86_64 -model_type=vision -device_id=0 -batch_size=1 -om_path=BSN_tem_bs1.om -input_text_path=./TEM-video-feature.info -input_width=400 -input_height=100 -output_binary=True -useDvpp=False ``` -使用BSN_tem_postprocess.py进行tem后处理 +使用BSN_tem_postprocess.py进行tem后处理(tem的后处理与pem的前处理有关请按照顺序执行) ``` -python BSN_tem_postprocess.py +python BSN_tem_postprocess.py --TEM_out_path ./result/dumpOutput_device0 ``` 4、PEM推理 -运行pem预处理脚本 +运行pem预处理脚本(pem的前处理与tem的后处理有关请按照顺序执行) ``` python BSN_pem_preprocess.py @@ -185,7 +185,7 @@ python get_info.py pem output/BSN-PEM-preprocess/feature PEM-video-feature 1000 运行后处理脚本,会在output目录下生成结果文件 ``` -python BSN_pem_postprocess.py +python BSN_pem_postprocess.py --PEM_out_path result/dumpOutput_device1 ``` diff --git a/ACL_PyTorch/contrib/cv/detection/BSN/test/pth2om.sh b/ACL_PyTorch/contrib/cv/detection/BSN/test/pth2om.sh index 6fb82fb89bdf53f171b50b40e400c94c554646cb..8e0757cd7f4b577c4efcae0baf424e1e4053b7d7 100644 --- a/ACL_PyTorch/contrib/cv/detection/BSN/test/pth2om.sh +++ b/ACL_PyTorch/contrib/cv/detection/BSN/test/pth2om.sh @@ -36,7 +36,7 @@ export ASCEND_SLOG_PRINT_TO_STDOUT=1 echo "====TEM onnx2om bs1====" -atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs1 --input_format=NCHW --input_shape="video:1,400,100" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs1 --input_format=ND --input_shape="video:1,400,100" --log=debug --soc_version=Ascend310 if [ $? != 0 ]; then echo "fail!" exit -1 @@ -44,7 +44,7 @@ fi echo "====TPM onnx2om bs1 finished====" echo "====TEM onnx2om bs16====" -atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs16 --input_format=NCHW --input_shape="video:16,400,100" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_tem1.onnx --output=BSN_tem_bs16 --input_format=ND--input_shape="video:16,400,100" --log=debug --soc_version=Ascend310 if [ $? != 0 ]; then echo "fail!" exit -1 @@ -53,7 +53,7 @@ echo "====TPM onnx2om bs16 finished====" echo "====PEM onnx2om bs1====" -atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs1 --input_format=NCHW --input_shape="video_feature:1,1000,32" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs1 --input_format=ND --input_shape="video_feature:1,1000,32" --log=debug --soc_version=Ascend310 if [ $? != 0 ]; then echo "fail!" exit -1 @@ -61,7 +61,7 @@ fi echo "====PPM onnx2om bs1 finished====" echo "====PEM onnx2om bs16====" -atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs16 --input_format=NCHW --input_shape="video_feature:16,1000,32" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=BSN_pem.onnx --output=BSN_pem_bs16 --input_format=ND --input_shape="video_feature:16,1000,32" --log=debug --soc_version=Ascend310 if [ $? != 0 ]; then echo "fail!" exit -1