English|中文
This repository provides a script and recipe to Inference of the Yolov5 model.
This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.
Before starting, please pay attention to the following adaptation conditions. If they do not match, may leading in failure.
Conditions | Need |
---|---|
CANN Version | >=5.0.3 |
Chip Platform | Ascend310/Ascend310P3 |
3rd Party Requirements | Please follow the 'requirements.txt' |
git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git
cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/Yolov5_for_ACL
# run script in /script/get_coco_dataset_2017.sh to download COCO 2017 Dataset
# preprocess coco dataset
cd data
mkdir dataset
cd ..
cd scripts
python coco_convert.py --input ./coco/annotations/instances_val2017.json --output val2017.pkl
python coco_annotation.py --coco_path ./coco
python img2bin.py --img-dir ./coco/images --bin-dir ./coco/input_bins
mv coco ..
There will generate coco2017 test data set under data/dataset/.
Convert pb to om.
configure the env
Please follow the guide to set the envs
convert pb to om
atc --model=yolov5_tf2_gpu.pb --framework=3 --output=yolov5_tf2_gpu --soc_version=Ascend310 --input_shape="Input:1,640,640,3" --out_nodes="Identity:0;Identity_1:0;Identity_2:0;Identity_3:0;Identity_4:0;Identity_5:0" --log=info
Build the program
bash build.sh
Run the program:
cd offline_inference
bash benchmark_tf.sh
Run the post process:
cd ..
python3 offline_inference/postprocess.py
Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide.
model | data | AP/AR |
---|---|---|
offline Inference | 4952 images | 0.221/0.214 |
[1] https://github.com/hunglc007/tensorflow-yolov4-tflite
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。