代码拉取完成,页面将自动刷新
中文|English
此链接提供CenterNet TensorFlow模型在NPU上离线推理的脚本和方法
此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。
在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。
Conditions | Need |
---|---|
CANN版本 | >=5.0.3 |
芯片平台 | Ascend310/Ascend310P3 |
第三方依赖 | 请参考 'requirements.txt' |
git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git
cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/CenterNet_for_ACL
请自行下载VOC2007测试数据集,然后解压成VOCtest_06-NOV-2007.tar.
修改VOC2007测试数据集成 scripts/VOC2007 :
VOC2007
|----Annotations
|----ImageSets
|----JPEGImages
|----SegmentationClass
|----SegmentationObject
图像预处理
cd scripts
mkdir input_bins
python3 preprocess.py ./input_bins/
python3 xml2txt.py ./VOC2007/Annotations/ ./centernet_postprocess/groundtruths/
图片将被预处理为input_bins文件。标签将被预处理为predict_txt文件。
1.环境变量设置
请参考说明,设置环境变量
2.Pb模型转换为om模型
atc --model=./CenterNet.pb --framework=3 --output=./Centernet_2batch_input_fp16_output_fp32 --soc_version=Ascend310 --input_shape="input_1:2,512,512,3"
3.编译程序
bash build.sh
4.开始运行
cd scripts
bash benchmark_tf.sh
本结果是通过运行上面适配的推理脚本获得的。
model | data | mAP |
---|---|---|
offline Inference | 4952 images | 74.90% |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。