diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md index 570bc07c24d0f6d3ecab176eacc647ff62f8a05b..f1a5acca67cd30cfccf8e8cc4311e24db68e4b99 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README.md @@ -29,7 +29,7 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL 1. 请自行下载Massachusetts Roads数据集 -2. 将数据集文件放到 **'2D_Attention_Unet_for_ACL/image_ori/'** 中: +2. 将数据集文件放到 **2D_Attention_Unet_for_ACL/image_ori/** 中: ``` --image_ori |----lashan @@ -61,37 +61,25 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/2D_Attention_Unet_for_ACL.zip) - For Ascend310: ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg - ``` - For Ascend310P3: - ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg + cd .. + mkdir model + atc --model=model/2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg ``` - 编译程序 - - For Ascend310: - ``` - unset ASCEND310P3_DVPP - bash build.sh - ``` - For Ascend310P3: ``` - export ASCEND310P3_DVPP=1 bash build.sh ``` - 开始运行: ``` - cd scripts bash benchmark_tf.sh ``` -## 推理结果 +## 性能 ### 结果 diff --git a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md index c415d205b24a3f558bfd25647d54e979809b83bc..7da7f5a6e8c9efc15c8e4bb5bd020b3086310e48 100644 --- a/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md +++ b/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL/README_EN.md @@ -59,32 +59,21 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/2D_Attention_Unet_for_ACL [pb download link](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/2D_Attention_Unet_for_ACL.zip) - For Ascend310: ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg - ``` - For Ascend310P3: - ``` - atc --model=2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_aipp.cfg + cd .. + mkdir model + atc --model=model/2D_Attention_Unet_tf.pb --framework=3 --output=model/2DAttention_fp16_1batch --soc_version=Ascend310P3 --input_shape=inputs:1,224,224,3 --enable_small_channel=1 --insert_op_conf=2DAttention_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 ``` diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md index b057dea9f122123d8cca54411d9b397777077141..7bb8232780f26d53c7c20e47decd69a5ccffcee3 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README.md @@ -1,31 +1,33 @@ -# Densenet24 inference for Tensorflow +中文|[English](README_EN.md) -This repository provides a script and recipe to Inference the +# Densenet24 TensorFlow离线推理 -## Notice -**This sample only provides reference for you to learn the Ascend software stack and is not for commercial purposes.** +此链接提供Densenet24 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 | -| 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/Densenet24_for_ACL ``` -### 2. Download and preprocess the dataset +### 2. 下载数据集和预处理 -1. Download the dataset by yourself -2. Put the dataset files to **'Densenet24_for_ACL/ori_images'** like this: +1. 请自行下载数据集 +2. 将数据集放入 **Densenet24_for_ACL/ori_images** 中: ``` --ori_images |----BRATS2017 @@ -47,55 +49,50 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL |----d24_correction-4.index |----d24_correction-4.meta ``` -3. Executing the Preprocessing Script +3. 执行预处理脚本 ``` cd scripts python3 preprocess.py -m ../ori_images/npu/dense24_correction-4 -mn dense24 -nc True -r ../ori_images/BRATS2017/Brats17ValidationData/ -input1 ../datasets/input_flair/ -input2 ../datasets/input_t1/ ``` -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to om.** +**离线模型转换** -- configure the env +- 环境变量设置 + + 请参考[说明](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/DenseNet24_for_ACL.zip) + [pb模型下载链接](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Official/cv/DenseNet24_for_ACL.zip) ``` cd .. atc --model=model/densenet24.pb --framework=3 --output=model/densenet24_1batch --soc_version=Ascend310P3 --input_shape="Placeholder:1,38,38,38,2;Placeholder_1:1,38,38,38,2" ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -## 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** | TumorCore | PeritumoralEdema | EnhancingTumor | | :---------------: | :------: | :-----------: | :--------------------: | :-----------------: | diff --git a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md index ea074c1d656bc82b6bc076fdfda1d4662337f65e..399cbe947f542e325b9550d17c63a8f803d322a9 100644 --- a/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md +++ b/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL/README_EN.md @@ -61,13 +61,8 @@ cd Modelzoo-TensorFlow/ACL_TensorFlow/built-in/cv/Densenet24_for_ACL - 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 - ``` + 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 diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md index 855e57ab526fd16275c446c4f0288b50f67a5554..c86e8338888998d77ec104bdda6a88b82c117cea 100644 --- a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md +++ b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README.md @@ -1,77 +1,71 @@ +中文|[English](README_EN.md) +# 3DResNet Tensorflow离线推理 -# 3DResNet Inference for Tensorflow +此链接提供3DResNet Tensorflow模型在NPU上离线推理的脚本和方法 -This repository provides a script and recipe to Inference of the 3DResNet 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/3DResNet_for_ACL ``` -### 2. Generate random test dataset +### 2. 生成随机测试数据集 -1. Because of this is not a well trained model we test the model with random test dataset +1. 由于这不是一个训练好的模型,我们使用随机测试数据集测试模型 -2. Generate random test dataset: +2. 生成随机测试数据集: ``` cd scripts python3 generate_random_data.py ``` -There will random testdata bin fils under *input_bins/*. +随机数bin文件保存在 **input_bins/** 中. -### 3. Offline Inference +### 3. 离线推理 -**Convert pb to 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:${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模型 - [**pb download link**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) + [**pb模型下载链接**](https://obs-9be7.obs.cn-east-2.myhuaweicloud.com/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) ``` atc --model=3DResNet_tf_gpu.pb --framework=3 --output=3DResNet_tf_gpu --soc_version=Ascend310 --input_shape="input_1:1,64,64,32,1" --log=info ``` -- Build the program +- 编译程序 ``` bash build.sh ``` -- Run the program: +- 开始运行: ``` cd scripts bash benchmark_tf.sh ``` -- Run the post process: +- 运行后处理: ``` cd scripts @@ -79,5 +73,5 @@ There will random testdata bin fils under *input_bins/*. ``` -## Reference +## 参考 [1] https://github.com/JihongJu/keras-resnet3d diff --git a/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md new file mode 100644 index 0000000000000000000000000000000000000000..691a567bb3ddba63a8e089c055d70f21fed7f0c9 --- /dev/null +++ b/ACL_TensorFlow/contrib/cv/3DResNet_for_ACL/README_EN.md @@ -0,0 +1,78 @@ +English|[中文](README.md) + +# 3DResNet Inference for Tensorflow + +This repository provides a script and recipe to Inference of the 3DResNet 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/3DResNet_for_ACL +``` + +### 2. Generate random test dataset + +1. Because of this is not a well trained model we test the model with random test dataset + +2. Generate random test dataset: +``` +cd scripts +python3 generate_random_data.py +``` +There will random testdata bin fils under *input_bins/*. + +### 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/003_Atc_Models/modelzoo/Research/cv/3DResNet_for_ACL.zip) + + ``` + atc --model=3DResNet_tf_gpu.pb --framework=3 --output=3DResNet_tf_gpu --soc_version=Ascend310 --input_shape="input_1:1,64,64,32,1" --log=info + + ``` + +- Build the program + + ``` + bash build.sh + ``` + +- Run the program: + + ``` + cd scripts + bash benchmark_tf.sh + ``` + +- Run the post process: + + ``` + cd scripts + python3 post_processing.py + ``` + + +## Reference +[1] https://github.com/JihongJu/keras-resnet3d