diff --git a/ACL_TensorFlow/built-in/cv/Inceptionv3_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Inceptionv3_for_ACL/README.md index 9b3c6be6300aa14916a7899bed8a5c1e172476db..a7591867aaee65ae5ccd412c1307ddc5a8e6829d 100644 --- a/ACL_TensorFlow/built-in/cv/Inceptionv3_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Inceptionv3_for_ACL/README.md @@ -28,7 +28,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Inceptionv3_for_ACL 1. 请自行下载ImageNet2012测试数据集, 您可以获得验证图片(50000张JPEG和ILSVRC2012val-label-index.txt) -2. Put JPEGS to **'scripts/ILSVRC2012val'** and label text to **'scripts/'** +2. 将JPEG文件放入'scripts/ILSVRC2012val'目录下 ,将label text 放入 'scripts/'目录下 3. 图片预处理: ``` @@ -36,7 +36,7 @@ cd scripts mkdir input_bins python3 inception_preprocessing.py ./ILSVRC2012val/ ./input_bins/ ``` -jpegs图片将被预处理为bin文件. +jpeg图片将被预处理为bin文件. ### 3. 离线推理 @@ -48,19 +48,19 @@ jpegs图片将被预处理为bin文件. - Pb模型转换为om模型 - [Pb模型链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/Inceptionv3_for_ACL.zip) + [Pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/Inceptionv3_for_ACL.zip) ``` atc --model=inceptionv3_tf.pb --framework=3 --output=inceptionv3_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,299,299,3" --insert_op_conf=inceptionv3_aipp.cfg --enable_small_channel=1 --log=info ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README.md index ae4939a2a603d4f553917fa427c50eab2ac80ed8..96a6db00a282bdd4acda5f960007e88781c5a9f0 100644 --- a/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README.md @@ -1,85 +1,78 @@ +中文|[English](README_EN.md) +# MobileNetv1 TensorFlow离线推理 -# MobileNetv1 Inference for Tensorflow +此链接提供MobileNetv1 TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference of the MobileNetv1 model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL ``` -### 2. Download and preprocess the dataset - -1. Download the ImageNet2012 Validation dataset by yourself. You can get the validation pictures(50000 JPEGS and a ILSVRC2012val-label-index.txt) +### 2. 下载数据集和预处理 -2. Put JPEGS to **'scripts/ILSVRC2012val'** and label text to **'scripts/'** +1. 请自行下载ImageNet2012测试数据集, 您可以获得验证图片(50000张JPEG和ILSVRC2012val-label-index.txt) -3. Images Preprocess: +2. 将JPEG文件放入'scripts/ILSVRC2012val'目录下 ,将label text 放入 'scripts/'目录下 +3. 图片预处理: ``` cd scripts mkdir input_bins python3 mobilenetv1_preprocessing.py ./ILSVRC2012val/ ./input_bins/ ``` -The jpegs pictures will be preprocessed to bin fils. +jpeg图片将被预处理为bin文件 -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**Pb模型转换为om模型** - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv1_for_ACL.zip) + [Pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv1_for_ACL.zip) -- configure the env +- 环境变量设置 - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -- convert pb to om +- Pb模型转换为om模型 ``` atc --model=mobilenetv1_tf.pb --framework=3 --output=mobilenetv1_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=mobilenetv1_tf_aipp.cfg --enable_small_channle=1 ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -## Performance +## 性能 -### Result +### 结果 -Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 | model | **data** | Top1/Top5 | | :---------------: | :-------: | :-------------: | diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..4a7e74ad03f74f4a69cee851f2c423da9c236a8d --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL/README_EN.md @@ -0,0 +1,80 @@ +English|[中文](README.md) + +# MobileNetv1 Inference for Tensorflow + +This repository provides a script and recipe to Inference of the MobileNetv1 model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv1_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the ImageNet2012 Validation dataset by yourself. You can get the validation pictures(50000 JPEGS and a ILSVRC2012val-label-index.txt) + +2. Put JPEGS to **'scripts/ILSVRC2012val'** and label text to **'scripts/'** + +3. Images Preprocess: +``` +cd scripts +mkdir input_bins +python3 mobilenetv1_preprocessing.py ./ILSVRC2012val/ ./input_bins/ +``` +The jpegs pictures will be preprocessed to bin fils. + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv1_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + ``` + atc --model=mobilenetv1_tf.pb --framework=3 --output=mobilenetv1_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=mobilenetv1_tf_aipp.cfg --enable_small_channle=1 + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh + ``` + +## Performance + +### Result + +Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | **data** | Top1/Top5 | +| :---------------: | :-------: | :-------------: | +| offline Inference | 50000 images | 70.9 %/ 89.9% | diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README.md index aceca8db472efa62c4e95cb17105702ea2afe9dc..8a1bb1cb01ccbf576fe448bc7589bee1da2caf25 100644 --- a/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README.md @@ -1,23 +1,23 @@ +中文|[English](README_EN.md) +# MobileNetv2 TensorFlow离线推理 -# MobileNetv2 Inference for Tensorflow +此链接提供MobileNetv2 TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference the MobileNetv2 model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git @@ -26,27 +26,21 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL ### 2. Download and preprocess the dataset -1. Download the ImageNet2012 dataset by yourself +1. 请自行下载ImageNet2012测试数据集 -### 3. Offline Inference -**Convert pb to om.** +### 3. 离线推理 - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv2_for_ACL.zip) +**Pb模型转换为om模型** -- configure the env + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv2_for_ACL.zip) - ``` - #Please modify the environment settings as needed - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -- convert pb to om +- Pb模型转换为om模型 For Ascend310: ``` @@ -57,7 +51,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL atc --model=mobilenet_v2_tf.pb --framework=3 --output=mobilenet_v2_tf_aipp --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=mobilenet_v2_tf_aipp.cfg ``` -- Build the program +- 编译程序 For Ascend310: ``` @@ -70,7 +64,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts @@ -79,13 +73,13 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL -## Performance +## 性能 -### Result +### 结果 -Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 | model | SOC | **data** | Top1/Top5 | | :---------------:|:-------:|:-------: | :-------------: | diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..2b8af4caa43c367d6eb806afa3be41a384711198 --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL/README_EN.md @@ -0,0 +1,86 @@ +English|[中文](README.md) + +# MobileNetv2 Inference for Tensorflow + +This repository provides a script and recipe to Inference the MobileNetv2 model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv2_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the ImageNet2012 dataset by yourself + + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv2_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + For Ascend310: + ``` + atc --model=mobilenet_v2_tf.pb --framework=3 --output=mobilenet_v2_tf_aipp --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=mobilenet_v2_tf_aipp.cfg + ``` + For Ascend310P3: + ``` + atc --model=mobilenet_v2_tf.pb --framework=3 --output=mobilenet_v2_tf_aipp --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=mobilenet_v2_tf_aipp.cfg + ``` + +- Build the program + + For Ascend310: + ``` + unset ASCEND310P3_DVPP + bash build.sh + ``` + For Ascend310P3: + ``` + export ASCEND310P3_DVPP=1 + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh --batchSize=1 --modelType=mobilenetv2 --imgType=raw --precision=fp16 --outputType=fp32 --useDvpp=1 --deviceId=0 --modelPath=mobilenet_v2_tf_aipp.om --dataPath=image-1024 --trueValuePath=val_lable.txt + ``` + + + +## Performance + +### Result + +Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | SOC | **data** | Top1/Top5 | +| :---------------:|:-------:|:-------: | :-------------: | +| offline Inference| Ascend310 | 50K images | 71.75 %/ 90.48% | +| offline Inference| Ascend310P3 | 50K images | 72.2 %/ 90.8% | diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README.md index 2f038f1864d8b2cdd8ec635374f68310cc4782e5..fcc7485f187b3c53bace460cdb530f842a36ed27 100644 --- a/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README.md @@ -1,80 +1,76 @@ -# MOBILENETV3LARGE inference for Tensorflow - -This repository provides a script and recipe to Inference the - -## Notice -**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' | - -## Quick Start Guide - -### 1. Clone the respository - -```shell -git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git -cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL -``` - -### 2. Download and preprocess the dataset - -1. Download the ImageNet2012 dataset by yourself - -2. Executing the Preprocessing Script - ``` - python3 scripts/mobilenet_data_prepare.py --image_path=Path of the dataset --out_path=Dataset output path - - ``` - -### 3. Offline Inference - -**Convert pb to om.** - - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv3_Large_for_ACL.zip) - -- configure the env - - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` - -- convert pb to om - - ``` - atc --model=model/mobilenetv3large_tf.pb --framework=3 --output=model/mobilenetv3_large_aipp --output_type=FP32 --insert_op_conf=./mobilenetv3_tensorflow.cfg --input_shape=input:1,224,224,3 --soc_version=Ascend310P3 --fusion_switch_file=./mobilenetv3_fusion_config.json - ``` - -- Build the program - - ``` - bash build.sh - ``` - -- Run the program: - - ``` - bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/mobilenetv3_large_aipp.om --dataPath=../../datasets/imagenet_50000/ --modelType=mobilenetv3_large --imgType=rgb --trueValuePath=../../datasets/input_5w.csv - ``` - -## Performance - -### Result - -Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. - -#### Inference accuracy results - -| model | **data** | Top1/Top5 | -| :---------------: | :-------: | :-------------: | -| offline Inference | 50K images | 75.7 %/ 92.8% | - +中文|[English](README_EN.md) + +# MOBILENETV3LARGE TensorFlow离线推理 + +此链接提供MOBILENETV3LARGE TensorFlow模型在NPU上离线推理的脚本和方法 + +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** + +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 + +| Conditions | Need | +| --- | --- | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | + +## 快速指南 + +### 1. 拷贝代码 + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL +``` + +### 2. 下载数据集和预处理 + +1. 请自行下载ImageNet2012测试数据集 + +2. 执行预处理脚本 + ``` + python3 scripts/mobilenet_data_prepare.py --image_path=Path of the dataset --out_path=Dataset output path + + ``` + +### 3. 离线推理 + +**Pb模型转换为om模型** + + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv3_Large_for_ACL.zip) + +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 + +- Pb模型转换为om模型 + + ``` + atc --model=model/mobilenetv3large_tf.pb --framework=3 --output=model/mobilenetv3_large_aipp --output_type=FP32 --insert_op_conf=./mobilenetv3_tensorflow.cfg --input_shape=input:1,224,224,3 --soc_version=Ascend310P3 --fusion_switch_file=./mobilenetv3_fusion_config.json + ``` + +- 编译程序 + + ``` + bash build.sh + ``` + +- 开始运行: + + ``` + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/mobilenetv3_large_aipp.om --dataPath=../../datasets/imagenet_50000/ --modelType=mobilenetv3_large --imgType=rgb --trueValuePath=../../datasets/input_5w.csv + ``` + +## 性能 + +### 结果 + +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 + +#### 推理精度结果 + +| model | **data** | Top1/Top5 | +| :---------------: | :-------: | :-------------: | +| offline Inference | 50K images | 75.7 %/ 92.8% | + diff --git a/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..527c7be7dc55fbb5cc780e3b291bc76b427a0598 --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL/README_EN.md @@ -0,0 +1,76 @@ +English|[中文](README.md) + +# MOBILENETV3LARGE inference for Tensorflow + +This repository provides a script and recipe to Inference the + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/MobileNetv3_Large_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the ImageNet2012 dataset by yourself + +2. Executing the Preprocessing Script + ``` + python3 scripts/mobilenet_data_prepare.py --image_path=Path of the dataset --out_path=Dataset output path + + ``` + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/MobileNetv3_Large_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + ``` + atc --model=model/mobilenetv3large_tf.pb --framework=3 --output=model/mobilenetv3_large_aipp --output_type=FP32 --insert_op_conf=./mobilenetv3_tensorflow.cfg --input_shape=input:1,224,224,3 --soc_version=Ascend310P3 --fusion_switch_file=./mobilenetv3_fusion_config.json + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/mobilenetv3_large_aipp.om --dataPath=../../datasets/imagenet_50000/ --modelType=mobilenetv3_large --imgType=rgb --trueValuePath=../../datasets/input_5w.csv + ``` + +## Performance + +### Result + +Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | **data** | Top1/Top5 | +| :---------------: | :-------: | :-------------: | +| offline Inference | 50K images | 75.7 %/ 92.8% | + diff --git a/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README.md index ce9d086a1977c0e3b4676d4f185f72db21aadf22..e82c4cafec7361c1fb2d3993fd08e39c7d8db679 100644 --- a/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README.md @@ -1,42 +1,44 @@ +中文|[English](README_EN.md) # -# OpenPose Inference for TensorFlow -This repository provides a script and recipe to Inference the OpenPose model. +# OpenPose TensorFlow离线推理 +此链接提供OpenPose TensorFlow模型在NPU上离线推理的脚本和方法 -## Notice -**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide -### 1. Clone the respository +## 快速指南 + +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载数据集和预处理 -Download the COCO2014 dataset by yourself, more details see: [dataset](./dataset/coco/README.md) +请自行下载COCO2014测试数据集, 详情见: [dataset](./dataset/coco/README.md) -### 3. Obtain the pb model +### 3. 获取pb模型 -Obtain the OpenPose pb model, more details see: [models](./models/README.md) +获取OpenPose pb模型, 详情见: [models](./models/README.md) -### 4. Obtain process scripts +### 4. 获取处理脚本 -Obtain pafprocess and slidingwindow packages from: [tf_openpose](https://github.com/BoomFan/openpose-tf/tree/master/tf_pose) and put them into libs +pafprocess、slidingwindow 下载链接: [tf_openpose](https://github.com/BoomFan/openpose-tf/tree/master/tf_pose) and put them into libs -### 5. Offline Inference -**Preprocess the dataset** +### 5. 离线推理 +**数据预处理** ```Bash python3 preprocess.py \ --resize 656x368 \ @@ -47,20 +49,16 @@ python3 preprocess.py \ ``` -**Convert pb to om.** -- configure the env +**Pb模型转换为om模型** +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 + - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` -- convert pb to om +- Pb模型转换为om模型 - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/OpenPose_for_ACL.zip) + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/OpenPose_for_ACL.zip) ``` atc --framework=3 \ @@ -70,10 +68,10 @@ python3 preprocess.py \ --input_shape="image:1,368,656,3" ``` -**Build the program** -Build the inference application, more details see: [xacl_fmk](./xacl_fmk/README.md) +**编译程序** +编译推理应用程序, 详情见: [xacl_fmk](./xacl_fmk/README.md) -**Run the inference** +**开始运行** ``` /xacl_fmk -m ./models/OpenPose_for_TensorFlow_BatchSize_1.om \ -o ./output/openpose \ @@ -81,7 +79,7 @@ Build the inference application, more details see: [xacl_fmk](./xacl_fmk/README. -b 1 ``` -**PostProcess** +**后处理** ``` python3 postprocess.py \ --resize 656x368 \ @@ -93,12 +91,12 @@ python3 postprocess.py \ --output-dir ../output/openpose ``` -**Sample scripts** -We also supoort the predict_openpose.sh to run the steps all above except **build the program** +**样本脚本** +我们还支持使用predict_openpose.sh运行上述所有步骤,**构建程序除外** -### 6.Result +### 6.结果 *** -OpenPose Inference : +OpenPose 推理 : | Type | IoU | Area | MaxDets | Result | | :------- | :------- | :------- | :------- | :------- | @@ -115,7 +113,7 @@ OpenPose Inference : *** -## Reference +## 参考 [1] https://github.com/ildoonet/tf-pose-estimation/tree/master/tf_pose/pafprocess/ diff --git a/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..504346a4881411c5f2f466770a8955e164920be3 --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL/README_EN.md @@ -0,0 +1,119 @@ +English|[中文](README.md) +# + +# OpenPose Inference for TensorFlow +This repository provides a script and recipe to Inference the OpenPose model. + +## Notice +**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' | + +## Quick Start Guide +### 1. Clone the respository +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/OpenPose_for_ACL +``` + +### 2. Download and preprocess the dataset + +Download the COCO2014 dataset by yourself, more details see: [dataset](./dataset/coco/README.md) + + +### 3. Obtain the pb model + +Obtain the OpenPose pb model, more details see: [models](./models/README.md) + +### 4. Obtain process scripts + +Obtain pafprocess and slidingwindow packages from: [tf_openpose](https://github.com/BoomFan/openpose-tf/tree/master/tf_pose) and put them into libs + + +### 5. Offline Inference +**Preprocess the dataset** +```Bash +python3 preprocess.py \ + --resize 656x368 \ + --model cmu \ + --coco-year 2014 \ + --coco-dir ../dataset/coco/ \ + --output-dir ../input/ + +``` + +**Convert pb to om.** +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + + +- convert pb to om + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/OpenPose_for_ACL.zip) + + ``` + atc --framework=3 \ + --model=./models/OpenPose_for_TensorFlow_BatchSize_1.pb \ + --output=./models/OpenPose_for_TensorFlow_BatchSize_1 \ + --soc_version=Ascend310 \ + --input_shape="image:1,368,656,3" + ``` + +**Build the program** +Build the inference application, more details see: [xacl_fmk](./xacl_fmk/README.md) + +**Run the inference** +``` +/xacl_fmk -m ./models/OpenPose_for_TensorFlow_BatchSize_1.om \ + -o ./output/openpose \ + -i ./input \ + -b 1 +``` + +**PostProcess** +``` +python3 postprocess.py \ + --resize 656x368 \ + --resize-out-ratio 8.0 \ + --model cmu \ + --coco-year 2014 \ + --coco-dir ../dataset/coco/ \ + --data-idx 100 \ + --output-dir ../output/openpose +``` + +**Sample scripts** +We also supoort the predict_openpose.sh to run the steps all above except **build the program** + +### 6.Result +*** +OpenPose Inference : + +| Type | IoU | Area | MaxDets | Result | +| :------- | :------- | :------- | :------- | :------- | +| Average Precision (AP) | 0.50:0.95 | all | 20 | 0.399 | +| Average Precision (AP) | 0.50 | all | 20 | 0.648 | +| Average Precision (AP) | 0.75| all | 20 | 0.400 | +| Average Precision (AP) | 0.50:0.95 | medium | 20 | 0.364 | +| Average Precision (AP) | 0.50:0.95 | large | 20 | 0.443 | +| Average Recall (AR) | 0.50:0.95 | all | 20 | 0.456 | +| Average Recall (AR) | 0.50 | all | 20 | 0.683 | +| Average Recall (AR) | 0.75 | all | 20 | 0.465 | +| Average Recall (AR) | 0.50:0.95 | medium | 20 | 0.371 | +| Average Recall (AR) | 0.50:0.95 | large | 20 | 0.547 | + +*** + +## Reference + +[1] https://github.com/ildoonet/tf-pose-estimation/tree/master/tf_pose/pafprocess/ + + +# diff --git a/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README.md index 0b47eb2863953f871421815237b24421dfc0e51c..fd0195406dd593fa4c1d924192a282bbf5893827 100644 --- a/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README.md @@ -1,87 +1,83 @@ -# PSPNet101 inference for Tensorflow - -This repository provides a script and recipe to Inference the PSPNet101 model. - -## Quick Start Guide - -### 1. Clone the respository - -```shell -git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git -cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/PSPNet101_for_ACL -``` - -### 2. Download and preprocess the dataset - -1. Download the dataset by yourself -2. Executing the Preprocessing Script - ``` - #without flip - python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset - ``` - - ``` - #flip - python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset --flipped_eval --flipped_output_path=$flipped_dataset - ``` - - -### 3. Offline Inference - -**Convert pb to om.** - - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PSPnet101_for_ACL.zip) - -- configure the env - - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` - -- convert pb to om - - ``` - atc --model=model/PSPNet101.pb --framework=3 --output=model/pspnet101_1batch --soc_version=Ascend310P3 --input_shape=input_image:1,1024,2048,3 --enable_small_channel=1 --insert_op_conf=pspnet_aipp.cfg - ``` - -- Build the program - - ``` - bash build.sh - ``` - -- Run the program: - - ``` - without flip - bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb - ``` - - ``` - flip - bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb --flippedDataPath=../../flipped_datasets/ --flippedEval=1 - ``` - -## Performance - -### Result - -Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. - -#### Without flip Inference accuracy results - -| model | **data** | mIoU | -| :---------------: | :-------: | :--------: | -| offline Inference | 500 images | 77% | - - -### flip Inference accuracy results - -| model | **data** | mIoU | -| :---------------: | :-------: | :--------: | -| offline Inference | 500 images | 77.24% | - +中文|[English](README_EN.md) + +# PSPNet101 TensorFlow离线推理 + +此链接提供PSPNet101 TensorFlow模型在NPU上离线推理的脚本和方法 + +## 快速指南 + +### 1. 拷贝代码 + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/PSPNet101_for_ACL +``` + +### 2. 下载数据集和预处理 + +1. 请自行下载测试数据集 +2. 执行预处理脚本 + ``` + #无翻转 + python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset + ``` + + ``` + #翻转 + python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset --flipped_eval --flipped_output_path=$flipped_dataset + ``` + + +### 3. 离线推理 + +**Pb模型转换为om模型** + + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PSPnet101_for_ACL.zip) + +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 + +- Pb模型转换为om模型 + + ``` + atc --model=model/PSPNet101.pb --framework=3 --output=model/pspnet101_1batch --soc_version=Ascend310P3 --input_shape=input_image:1,1024,2048,3 --enable_small_channel=1 --insert_op_conf=pspnet_aipp.cfg + ``` + +- 编译程序 + + ``` + bash build.sh + ``` + +- 开始运行: + + ``` + 无翻转 + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb + ``` + + ``` + 翻转 + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb --flippedDataPath=../../flipped_datasets/ --flippedEval=1 + ``` + +## 性能 + +### 结果 + +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 + +#### 无翻转推理精度结果 + +| model | **data** | mIoU | +| :---------------: | :-------: | :--------: | +| offline Inference | 500 images | 77% | + + +### 翻转推理精度结果 + +| model | **data** | mIoU | +| :---------------: | :-------: | :--------: | +| offline Inference | 500 images | 77.24% | + diff --git a/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..d0a0426d9d30b9778a2a3e43fe55efbbd5c1b398 --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/PSPnet101_for_ACL/README_EN.md @@ -0,0 +1,83 @@ +English|[中文](README.md) + +# PSPNet101 inference for Tensorflow + +This repository provides a script and recipe to Inference the PSPNet101 model. + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/PSPNet101_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the dataset by yourself +2. Executing the Preprocessing Script + ``` + #without flip + python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset + ``` + + ``` + #flip + python3 scripts/data_processing.py --img_num=500 --crop_width=720 --crop_height=720 --data_dir=../cityscapes --val_list=../cityscapes/list/cityscapes_val_list.txt --output_path=$dataset --flipped_eval --flipped_output_path=$flipped_dataset + ``` + + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PSPnet101_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + ``` + atc --model=model/PSPNet101.pb --framework=3 --output=model/pspnet101_1batch --soc_version=Ascend310P3 --input_shape=input_image:1,1024,2048,3 --enable_small_channel=1 --insert_op_conf=pspnet_aipp.cfg + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + without flip + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb + ``` + + ``` + flip + bash benchmark_tf.sh --batchSize=1 --outputType=fp32 --modelPath=../../model/pspnet101_1batch.om --dataPath=../../datasets/ --modelType=PSPnet101 --imgType=rgb --flippedDataPath=../../flipped_datasets/ --flippedEval=1 + ``` + +## Performance + +### Result + +Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Without flip Inference accuracy results + +| model | **data** | mIoU | +| :---------------: | :-------: | :--------: | +| offline Inference | 500 images | 77% | + + +### flip Inference accuracy results + +| model | **data** | mIoU | +| :---------------: | :-------: | :--------: | +| offline Inference | 500 images | 77.24% | + diff --git a/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README.md index b4c3d0b2955be10ffcde2f431e2928d49a36979a..83aa9bc9fc7a64853e6e5e5c9eededc4de30e5e9 100644 --- a/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README.md @@ -1,85 +1,89 @@ +中文|[English](README_EN.md) +# PixelLink TensorFlow离线推理 -# PixelLink Inference for Tensorflow +此链接提供PixelLink TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference of the PixelLink model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | + +## 快速指南 + +### 1. 拷贝代码注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Quick Start Guide +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 + +| Conditions | Need | +| --- | --- | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -### 1. Clone the respository +## 快速指南 +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载预处理和数据集 -1. Download the Icdar2015 test dataset by yourself. You can get the test pictures(500 JPEGS) +1. 请自行下载Icdar2015测试数据集(包含500张图片) -2. Put JPEGS to **'scripts/ch4_test_images'** +2. 将图片放到 'scripts/ch4_test_images'目录下 -3. Images Preprocess: +3. 图片预处理: ``` cd scripts mkdir input_bins python3 pixellink_preprocessing.py ./ch4_test_images/ ./input_bins/ ``` -The jpegs pictures will be preprocessed to bin fils. +jpeg图片将被预处理为bin文件 -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**Pb模型转换为om模型** - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PixelLink_for_ACL.zip) + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PixelLink_for_ACL.zip) -- configure the env +- 环境变量设置 - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` - -- convert pb to om + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 +- Pb模型转换为om模型 ``` atc --model=pixellink_tf.pb --framework=3 --output=pixellink_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,768,1280,3" --insert_op_conf=pixellink_tf_aipp.json --log=info ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -## Performance - -### Result +## 性能 -Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. +### 结果 +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 | model | **data** | Hmean | | :---------------: | :-------: | :-------------: | diff --git a/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..2f0867c5c0accb9fc666a3dae906587241b82bdb --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL/README_EN.md @@ -0,0 +1,81 @@ +English|[中文](README.md) + +# PixelLink Inference for Tensorflow + +This repository provides a script and recipe to Inference of the PixelLink model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/PixelLink_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the Icdar2015 test dataset by yourself. You can get the test pictures(500 JPEGS) + +2. Put JPEGS to **'scripts/ch4_test_images'** + +3. Images Preprocess: +``` +cd scripts +mkdir input_bins +python3 pixellink_preprocessing.py ./ch4_test_images/ ./input_bins/ +``` +The jpegs pictures will be preprocessed to bin fils. + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/PixelLink_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + ``` + atc --model=pixellink_tf.pb --framework=3 --output=pixellink_tf_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,768,1280,3" --insert_op_conf=pixellink_tf_aipp.json --log=info + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh + ``` + +## Performance + +### Result + +Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | **data** | Hmean | +| :---------------: | :-------: | :-------------: | +| offline Inference | 500 images | 82.4% | + diff --git a/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README.md index 7096fd5d4d829103e78e8157a2a8451b41fe9ce4..f24b02d4700820f84eca8b0528b2e11330911236 100644 --- a/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README.md @@ -1,93 +1,86 @@ - - -# ResCNN Inference for Tensorflow - -This repository provides a script and recipe to Inference of the ResCNN model. - -## Notice -**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.4 | -| Chip Platform| Ascend310/Ascend310P3 | -| 3rd Party Requirements| Please follow the 'requirements.txt' | - -## Quick Start Guide - -### 1. Clone the respository - -```shell -git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git -cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/ -``` - -### 2. Download and preprocess the dataset - -1. Download the DIV2K dataset by yourself. - -2. Put 100 LR pictures to './DIV2K_test_100/' as test data. - -3. Make directories for inference input and output: -``` -cd scripts -mkdir input_bins -mkdir results -``` - Temporary bin files will be saved. - - -### 3. Offline Inference - -**Convert pb to om.** - - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/ResCNN_for_ACL.zip) - -- configure the env - - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` - -- convert pb to om - Because of the whole test picture will be split to some different sizes,including 64 x 64, 32 x 64, 32 x 44, etc, here,we convert three om files: - - ``` - atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_64_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,64,64,3" --log=info - atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,64,3" --log=info - atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_44_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,44,3" --log=info - ``` - -- Build the program - - ``` - bash build.sh - ``` - -- Run the program: - - ``` - bash benchmark_tf.sh - ``` - -## NPU Performance -### Result - -Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. - -#### Inference accuracy results - -| model | data | mean-PSNR | mean-SSIM| -| :---------------: | :-------: | :-------------: |:-------------:| -| offline Inference | 100 images | 23.748 |0.747| - - -## Reference -[1] https://github.com/payne911/SR-ResCNN-Keras - +中文|[English](README_EN.md) + +# ResCNN TensorFlow离线推理 + +此链接提供ResCNN TensorFlow模型在NPU上离线推理的脚本和方法 + +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** + +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 + +| Conditions | Need | +| --- | --- | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | + +## 快速指南 + +### 1. 拷贝代码 + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/ +``` + +### 2. 下载数据集和预处理 + +1. 请自行下载DIV2K测试数据集 + +2. 将100张LR图片放到'./DIV2K_test_100/'目录下作为测试数据. + +3. 创建推理输入和输出目录: +``` +cd scripts +mkdir input_bins +mkdir results +``` + 将保存临时bin文件 + + +### 3. 离线推理 + +**Pb模型转换为om模型** + + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/ResCNN_for_ACL.zip) + +- 环境变量设置 + + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 + +- Pb模型转换为om模型 + 由于整个测试图片将被分割为一些不同的大小,包括64 x 64、32 x 64、32x 44,这里我们转换了三个om文件: + + ``` + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_64_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,64,64,3" --log=info + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,64,3" --log=info + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_44_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,44,3" --log=info + ``` + +- 编译程序 + + ``` + bash build.sh + ``` + +- 开始运行: + + ``` + bash benchmark_tf.sh + ``` + +## NPU 性能 +### 结果 + +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 + +#### 推理精度结果 +| model | data | mean-PSNR | mean-SSIM| +| :---------------: | :-------: | :-------------: |:-------------:| +| offline Inference | 100 images | 23.748 |0.747| + + +## 参考 +[1] https://github.com/payne911/SR-ResCNN-Keras + diff --git a/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..06698cb91cee2f555d030b00a258cf814d314e62 --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/README_EN.md @@ -0,0 +1,87 @@ +English|[中文](README.md) + +# ResCNN Inference for Tensorflow + +This repository provides a script and recipe to Inference of the ResCNN model. + +## Notice +**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.4 | +| Chip Platform| Ascend310/Ascend310P3 | +| 3rd Party Requirements| Please follow the 'requirements.txt' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/ResCNN_for_ACL/ +``` + +### 2. Download and preprocess the dataset + +1. Download the DIV2K dataset by yourself. + +2. Put 100 LR pictures to './DIV2K_test_100/' as test data. + +3. Make directories for inference input and output: +``` +cd scripts +mkdir input_bins +mkdir results +``` + Temporary bin files will be saved. + + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/ResCNN_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + Because of the whole test picture will be split to some different sizes,including 64 x 64, 32 x 64, 32 x 44, etc, here,we convert three om files: + + ``` + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_64_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,64,64,3" --log=info + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_64_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,64,3" --log=info + atc --model=ResCNN_tf.pb --framework=3 --output=ResCNN_32_44_1batch --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,32,44,3" --log=info + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + bash benchmark_tf.sh + ``` + +## NPU Performance +### Result + +Our result was obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | data | mean-PSNR | mean-SSIM| +| :---------------: | :-------: | :-------------: |:-------------:| +| offline Inference | 100 images | 23.748 |0.747| + + +## Reference +[1] https://github.com/payne911/SR-ResCNN-Keras + diff --git a/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README.md index 299f2b5132380870b2c700fabc56716273a06dc9..6a7a0e1680d4bcf6e717cadf9d5ed21e8fff8dcf 100644 --- a/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README.md @@ -1,53 +1,46 @@ +中文|[English](README_EN.md) +# ResNet101 TensorFlow离线推理 -# ResNet101 Inference for Tensorflow +此链接提供ResNet101 TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference the ResNet101 model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载数据集和预处理 -1. Download the ImageNet2012 dataset by yourself +1. 请自行下载ImageNet2012测试数据集 -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**Pb模型转换为om模型** - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/Resnet101_for_ACL.zip) + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/Resnet101_for_ACL.zip) -- configure the env +- 环境变量设置 - ``` - #Please modify the environment settings as needed - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:${install_path}/acllib/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -- convert pb to om +- Pb模型转换为om模型 For Ascend310: ``` @@ -58,7 +51,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL atc --model=resnet101_tf.pb --framework=3 --output=resnet101_tf_aipp --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=resnet101_tf_aipp.cfg ``` -- Build the program +- 编译程序 For Ascend310: ``` @@ -71,7 +64,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts @@ -80,13 +73,13 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL -## Performance +## 性能 -### Result +### 结果 -Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 | model | SOC | **data** | Top1/Top5 | | :---------------:|:-------:|:-------: | :-------------: | diff --git a/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..7bc9b49e497145fd4daa3adf3c8daaa5020844dd --- /dev/null +++ b/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL/README_EN.md @@ -0,0 +1,87 @@ +English|[中文](README.md) + +# ResNet101 Inference for Tensorflow + +This repository provides a script and recipe to Inference the ResNet101 model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Resnet101_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the ImageNet2012 dataset by yourself + + + +### 3. Offline Inference + +**Convert pb to om.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/Resnet101_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + For Ascend310: + ``` + atc --model=resnet101_tf.pb --framework=3 --output=resnet101_tf_aipp --output_type=FP32 --soc_version=Ascend310 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=resnet101_tf_aipp.cfg + ``` + For Ascend310P3: + ``` + atc --model=resnet101_tf.pb --framework=3 --output=resnet101_tf_aipp --output_type=FP32 --soc_version=Ascend310P3 --input_shape="input:1,224,224,3" --log=info --insert_op_conf=resnet101_tf_aipp.cfg + ``` + +- Build the program + + For Ascend310: + ``` + unset ASCEND310P3_DVPP + bash build.sh + ``` + For Ascend310P3: + ``` + export ASCEND310P3_DVPP=1 + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh --batchSize=1 --modelType=resnet101 --imgType=raw --precision=fp16 --outputType=fp32 --useDvpp=1 --deviceId=0 --modelPath=resnet101_tf_aipp.om --dataPath=image-1024 --trueValuePath=val_lable.txt + ``` + + + +## Performance + +### Result + +Our result were obtained by running the applicable inference script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results + +| model | SOC | **data** | Top1/Top5 | +| :---------------:|:-------:|:-------: | :-------------: | +| offline Inference| Ascend310 | 50K images | 78.51 %/ 94.28% | +| offline Inference| Ascend310P3 | 50K images | 78.7 %/ 94.4% | diff --git a/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README.md index 686d9bdd4a14cb6d1e39cc83860b2feab70b293e..447b31905f330435d79b05360e8e458d3ebe1461 100644 --- a/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README.md @@ -1,23 +1,23 @@ +中文|[English](README_EN.md) +# MTCNN TensorFlow离线推理 -# MTCNN Inference for Tensorflow +此链接提供MTCNN TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference the MTCNN model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git @@ -25,37 +25,33 @@ cd Modelzoo-TensorFlow/ACL/Official/cv/MTCNN_for_ACL ``` -### 2. Offline Inference +### 2. 离线推理 -**Convert pb to om and inference.** - [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/MTCNN_for_ACL.zip) +**Pb模型转换为om模型与推理** -- configure the env + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/MTCNN_for_ACL.zip) - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` +- 环境变量设置 -- Build the program + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 + +- 编译程序 ``` cd xacl_fmk-master bash xacl_fmk.sh ``` -- Run the program: +- 开始运行: + ``` cd .. python3 acltest.py ompath data_in_om data_out_om Ascend310P3 ./mtc_pnet.pb ./mtc_rnet.pb ./mtc_onet.pb ``` - Notes: - By default, image in the "picture" directory are inferred. If you want to replace image, replace the image in the "picture" directory. + 注意: + 默认情况下,“picture”目录中的图像已被推理。如果要替换图像,请替换“picture”目录中的图像。 - The ompath,data_in_om and data_out_om directorys don't need to be created. They will be automatically created. + ompath、data_in_om和data_out_om目录将自动创建。 diff --git a/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..c715389be0c246449ed39eb61f00624a5f757eb8 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/MTCNN_for_ACL/README_EN.md @@ -0,0 +1,55 @@ +English|[中文](README.md) + +# MTCNN Inference for Tensorflow + +This repository provides a script and recipe to Inference the MTCNN model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL/Official/cv/MTCNN_for_ACL +``` + + +### 2. Offline Inference + +**Convert pb to om and inference.** + + [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/MTCNN_for_ACL.zip) + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- Build the program + + ``` + cd xacl_fmk-master + bash xacl_fmk.sh + ``` + +- Run the program: + + ``` + cd .. + python3 acltest.py ompath data_in_om data_out_om Ascend310P3 ./mtc_pnet.pb ./mtc_rnet.pb ./mtc_onet.pb + ``` + Notes: + By default, image in the "picture" directory are inferred. If you want to replace image, replace the image in the "picture" directory. + + The ompath,data_in_om and data_out_om directorys don't need to be created. They will be automatically created. + diff --git a/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README.md index a4bfbf9627a99ef9f676b5c7111d5f4dd34479dd..a7a90d2532581ffa7f1ecdee15e00c5bf03be318 100644 --- a/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README.md @@ -1,32 +1,34 @@ -# NIMA Inference for Tensorflow -This respository provides a scripts and recipe to Inference of the NIMA model +中文|[English](README_EN.md) -## Notice -**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** +# NIMA TensorFlow离线推理 +此链接提供NIMA TensorFlow模型在NPU上离线推理的脚本和方法 -Before starting, please pay attention to the following adaptation conditions. If they do not match, may leading in failure. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** + +在开始之前,请注意以下适配条件。如果不匹配,可能导致运行失败。 | Conditions | Need | | --- | --- | -| CANN Version | >=5.0.3 | -| Chip Platform| Ascend310/Ascend310P3 | -| 3rd Party Requirements| Please follow the 'requirements.txt' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1.Clone the respository +### 1. 拷贝代码 ``` git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/NIMA_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载数据集和预处理 -1. Download the AVA test dataset by yourself and it should contains 5000 pictures and a AVA.txt. +1. 请自行下载AVA测试数据集(包含5000张图片和AVA.txt) -2. Move AVA test dataset to 'scripts/AVA_DATASET_TEST' like this: +2. 将AVA测试数据集移动到“scripts/AVA_dataset_test”,如下所示: ``` AVA_DATASET_TEST @@ -39,7 +41,7 @@ Before starting, please pay attention to the following adaptation conditions. If ``` -3. Image Preprocess +3. 图片预处理 ``` cd scripts @@ -47,51 +49,45 @@ Before starting, please pay attention to the following adaptation conditions. If python3 data_preprocess.py AVA_DATASET_TEST ./input_bins/ ``` -The pictures will be preprocessed to input_bins files. The lables will be preprocessed to predict_txt files. +图片将被预处理为input_bins文件。标签将被预处理为predict_txt文件 -### 3.Offline Inference +### 3.离线推理 -1.configure the env +1.环境变量设置 -``` -export install_path_atc=/usr/local/Ascend -export ASCEND_OPP_PATH=${install_path_atc}/opp -export PATH=/usr/local/python3.7.5/bin:${install_path_atc}/atc/ccec_compiler/bin:${install_path_atc}/atc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin -export PYTHONPATH=${install_path_atc}/atc/python/site-packages/te:${install_path_atc}/atc/python/site-packages/topi:${install_path_atc}/atc/python/site-packages/auto_tune.egg:${install_path_atc}/atc/python/site-packages/schedule_search.egg -export LD_LIBRARY_PATH=${install_path_atc}/acllib/lib64:${install_path_atc}/atc/lib64:${install_path_atc}/toolkit/lib64:${install_path_atc}/add-ons:$LD_LIBRARY_PATH -``` + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -2.convert pb to om +2.Pb模型转换为om模型 -[**pb download link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/NIMA_for_ACL.zip) +[**pb模型下载链接**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/NIMA_for_ACL.zip) ``` atc --model=./nima.pb --framework=3 --output=./nima_1batch_input_fp16_output_fp32 --soc_version=Ascend310 --input_shape="input_1:1,224,224,3" --soc_version=Ascend310 ``` -3.Build the program +3.编译程序 ``` bash build.sh ``` -An executable file **benchmark** will be generated under the path: **Benchmark/output/** +将在benchmark/output目录下生成可执行文件:**benchmark** -4.Run the program +4.开始运行: ``` cd scripts bash benchmark_tf.sh ``` -## Performance +## 性能 -### Result +### 结果 -Our results was obtained by running the applicable inference script. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results +#### 推理精度结果 -------------------------- | Dataset | Numbers | SSRC | |-------------------|--------------|---------| | AVA test dataset | 5000 images | 51.78% | -## Reference +## 参考 [1] https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/NIMA/NIMA_ID0853_for_TensorFlow diff --git a/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..6da3324ca952d2697e88526f8e54c2dc02c4c389 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/NIMA_for_ACL/README_EN.md @@ -0,0 +1,93 @@ +English|[中文](README.md) + +# NIMA Inference for Tensorflow +This respository provides a scripts and recipe to Inference of the NIMA model + +## Notice +**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' | + +## Quick Start Guide + +### 1.Clone the respository + + ``` + git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git + cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/NIMA_for_ACL + ``` + +### 2. Download and preprocess the dataset + + +1. Download the AVA test dataset by yourself and it should contains 5000 pictures and a AVA.txt. + +2. Move AVA test dataset to 'scripts/AVA_DATASET_TEST' like this: + + ``` + AVA_DATASET_TEST + | + |__image + | |____12315.jpg + | |____12316.jpg + | ..... + |__AVA.txt + + ``` + +3. Image Preprocess + + ``` + cd scripts + mkdir input_bins + python3 data_preprocess.py AVA_DATASET_TEST ./input_bins/ + + ``` +The pictures will be preprocessed to input_bins files. The lables will be preprocessed to predict_txt files. + +### 3.Offline Inference + +1.configure the env + +Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +2.convert pb to om + +[**pb download link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/NIMA_for_ACL.zip) + +``` +atc --model=./nima.pb --framework=3 --output=./nima_1batch_input_fp16_output_fp32 --soc_version=Ascend310 --input_shape="input_1:1,224,224,3" --soc_version=Ascend310 +``` +3.Build the program +``` +bash build.sh +``` +An executable file **benchmark** will be generated under the path: **Benchmark/output/** + +4.Run the program +``` +cd scripts +bash benchmark_tf.sh +``` + +## Performance + +### Result + +Our results was obtained by running the applicable inference script. + +#### Inference accuracy results +-------------------------- +| Dataset | Numbers | SSRC | +|-------------------|--------------|---------| +| AVA test dataset | 5000 images | 51.78% | + + +## Reference +[1] https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/NIMA/NIMA_ID0853_for_TensorFlow diff --git a/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README.md index 459c3c130cbf328c507247fc08629f13534d24fb..a28e40f2ce5cf4dcc3b8eb43227d2f56fd508da1 100644 --- a/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README.md @@ -1,40 +1,39 @@ +中文|[English](README_EN.md) +# PWCNet TensorFlow离线推理 -# PWCNet Inference for Tensorflow +此链接提供PWCNet TensorFlow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference the PWCNet model. +## 注意 +**此案例仅为您学习Ascend软件栈提供参考,不用于商业目的。** -## Notice -**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' | +| CANN版本 | >=5.0.3 | +| 芯片平台| Ascend310/Ascend310P3 | +| 第三方依赖| 请参考 'requirements.txt' | -## Quick Start Guide +## 快速指南 -### 1. Clone the respository +### 1. 拷贝代码 ```shell git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL ``` -### 2. Download and preprocess the dataset - -1. Download the MPI Sintel dataset by yourself and follow the [guide](https://github.com/philferriere/tfoptflow) to process the dataset then put it to the path: **scripts/dataset/MPI-Sintel-complete** +### 2. 下载数据集和预处理 +1. 请自行下载MPI Sintel测试数据集遵循[指南](https://github.com/philferriere/tfoptflow) 把预处理好数据集放到**scripts/dataset/MPI-Sintel-complete**目录下 -2. Preprocess of the test datasets and labels: +2. 测试数据集和标签的预处理: ``` cd scripts mkdir input_bins python3 data_preprocess.py --dataset ./dataset--output ./input_bins ``` -and it will generate **image** and **gt** directories under **input_bins**: +将在**input_bins**目录下生成 **image** 和**gt**目录: ``` input_bins | @@ -53,23 +52,17 @@ input_bins ``` -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**Pb模型转换为om模型** -- configure the env +- 环境变量设置 - ``` - export install_path=/usr/local/Ascend - export PATH=/usr/local/python3.7.5/bin:${install_path}/atc/ccec_compiler/bin:${install_path}/atc/bin:$PATH - export PYTHONPATH=${install_path}/atc/python/site-packages:${install_path}/atc/python/site-packages/auto_tune.egg/auto_tune:${install_path}/atc/python/site-packages/schedule_search.egg:$PYTHONPATH - export LD_LIBRARY_PATH=${install_path}/atc/lib64:$LD_LIBRARY_PATH - export ASCEND_OPP_PATH=${install_path}/opp - ``` + 请参考[说明](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719),设置环境变量 -- convert pb to om +- Pb模型转换为om模型 - [**Pb Download Link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/006_train_backup/PWCNet_tf_wosaisai/offline_infer/pwcnet.pb) + [**pb模型下载链接**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/006_train_backup/PWCNet_tf_wosaisai/offline_infer/pwcnet.pb) batchsize=1 @@ -77,14 +70,14 @@ input_bins atc --model=pwcnet.pb --framework=3 --input_shape="x_tnsr:1,2,448,1024,3" --output=./pwcnet_1batch --soc_version=Ascend310 --log=info ``` -- Build the program +- 编译程序 ``` bash build.sh ``` An executable file **benchmark** will be generated under the path: **Benchmark/output/** -- Run the program: +- 开始运行: ``` cd scripts @@ -93,17 +86,17 @@ input_bins -## Performance +## 性能 -### Result +### 结果 -Our result were obtained by running the applicable training script. To achieve the same results, follow the steps in the Quick Start Guide. +本结果是通过运行上面适配的推理脚本获得的。要获得相同的结果,请按照《快速指南》中的步骤操作。 -#### Inference accuracy results: +#### 推理精度结果 | Test Dataset | Number of pictures | EPE | |--------------|-------------------|-------------------| | MPI Sintel | 1041 | 1.25 | -## Reference +## 参考 [1] https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/pwcnet/PWCNet_ID0171_for_TensorFlow diff --git a/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..9f50bed45c4301b1101bc24550741b102564b681 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL/README_EN.md @@ -0,0 +1,103 @@ +English|[中文](README.md) + +# PWCNet Inference for Tensorflow + +This repository provides a script and recipe to Inference the PWCNet model. + +## Notice +**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' | + +## Quick Start Guide + +### 1. Clone the respository + +```shell +git clone https://gitee.com/ascend/ModelZoo-TensorFlow.git +cd Modelzoo-TensorFlow/ACL_TensorFlow/contrib/cv/PWCNet_for_ACL +``` + +### 2. Download and preprocess the dataset + +1. Download the MPI Sintel dataset by yourself and follow the [guide](https://github.com/philferriere/tfoptflow) to process the dataset then put it to the path: **scripts/dataset/MPI-Sintel-complete** + +2. Preprocess of the test datasets and labels: +``` +cd scripts +mkdir input_bins +python3 data_preprocess.py --dataset ./dataset--output ./input_bins +``` +and it will generate **image** and **gt** directories under **input_bins**: +``` +input_bins +| +|__image + |______alley_1-frames_0001_0002.bin + |______alley_1-frames_0002_0003.bin + |______alley_1-frames_0003_0004.bin +... + +| +|__gt + |______alley_1-frames_0001_0002.bin + |______alley_1-frames_0002_0003.bin + |______alley_1-frames_0003_0004.bin +... + +``` + +### 3. Offline Inference + +**Convert pb to om.** + +- configure the env + + Please follow the [guide](https://gitee.com/ascend/ModelZoo-TensorFlow/wikis/02.%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%A1%88%E4%BE%8B/Ascend%E5%B9%B3%E5%8F%B0%E6%8E%A8%E7%90%86%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%AE%BE%E7%BD%AE?sort_id=6458719) to set the envs + +- convert pb to om + + [**Pb Download Link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/006_train_backup/PWCNet_tf_wosaisai/offline_infer/pwcnet.pb) + + batchsize=1 + + ``` + atc --model=pwcnet.pb --framework=3 --input_shape="x_tnsr:1,2,448,1024,3" --output=./pwcnet_1batch --soc_version=Ascend310 --log=info + ``` + +- Build the program + + ``` + bash build.sh + ``` + An executable file **benchmark** will be generated under the path: **Benchmark/output/** + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh + ``` + + + +## Performance + +### Result + +Our result were obtained by running the applicable training script. To achieve the same results, follow the steps in the Quick Start Guide. + +#### Inference accuracy results: + +| Test Dataset | Number of pictures | EPE | +|--------------|-------------------|-------------------| +| MPI Sintel | 1041 | 1.25 | + +## Reference +[1] https://gitee.com/ascend/ModelZoo-TensorFlow/tree/master/TensorFlow/contrib/cv/pwcnet/PWCNet_ID0171_for_TensorFlow diff --git a/ACL_TensorFlow/contrib/nlp/LSTM_for_ACL/README.md b/ACL_TensorFlow/contrib/nlp/LSTM_for_ACL/README.md index b95fdd00d8854ee1c376771daaec2187152287a6..e67bd447c8918c444d48ca9cd7f20e0229a43414 100644 --- a/ACL_TensorFlow/contrib/nlp/LSTM_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/nlp/LSTM_for_ACL/README.md @@ -156,7 +156,7 @@ python3 xnlp_fmk.py \ ``` -**通过pb模型运行推理l** +**通过pb模型运行推理** * --in_nodes, --out_nodes:根据实际情况传参 * 保持其他参数与上一步相同 ```Bash @@ -173,7 +173,7 @@ python3 xnlp_fmk.py \ ``` -## Reference +## 参考 [1] https://arxiv.org/abs/1810.04805