forked from PaddlePaddle/PaddleSeg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from PaddlePaddle/develop
Develop
- Loading branch information
Showing
33 changed files
with
620 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
English | [简体中文](README_CN.md) | ||
|
||
## Deploy the PaddleSeg model using Paddle Inference C++ | ||
|
||
|
||
### 1、Install | ||
|
||
- Paddle Inference C++ | ||
|
||
- OpenCV | ||
|
||
- Yaml | ||
|
||
More install informations,please refer to [Tutorial](../../../../docs/deployment/inference/cpp_inference.md)。 | ||
|
||
### 2、Models and Pictures | ||
|
||
- Downdload model | ||
|
||
Enter to `LaneSeg/` directory, and execute commands as follows: | ||
```shell | ||
mkdir output # if not exists | ||
wget -P output https://paddleseg.bj.bcebos.com/lane_seg/bisenet/model.pdparams | ||
``` | ||
- Export Model | ||
|
||
```shell | ||
python export.py \ | ||
--config configs/bisenetV2_tusimple_640x368_300k.yml \ | ||
--model_path output/model.pdparams \ | ||
--save_dir output/export | ||
``` | ||
|
||
- Using the image `data/test_images/3.jpg` | ||
|
||
### 3、Compile and execute | ||
|
||
Enter to the `LaneSeg/deploy/cpp` | ||
|
||
Execute `sh run_seg_cpu.sh`, it will compile and then perform prediction on X86 CPU. | ||
|
||
Execute `sh run_seg_gpu.sh`, it will compile and then perform prediction on Nvidia GPU. | ||
|
||
The result will be saved in the`out_img_seg.jpg` and `out_image_points.jpg` images | ||
|
||
- Note:For the path of the model and image, you can change the files `run_seg_cpu.sh` and `run_seg_gpu.sh` as needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
简体中文 | [English](README.md) | ||
|
||
## 使用Paddle Inference C++部署PaddleSeg模型 | ||
|
||
### 1、安装 | ||
|
||
- Paddle Inference C++ | ||
|
||
- OpenCV | ||
|
||
- Yaml | ||
|
||
更多的安装信息,请参考[教程](../../../../docs/deployment/inference/cpp_inference_cn.md)。 | ||
|
||
### 2、模型和图片 | ||
|
||
- 下载模型 | ||
|
||
进入`LaneSeg/`目录下,执行如下命令: | ||
```shell | ||
mkdir output # if not exists | ||
wget -P output https://paddleseg.bj.bcebos.com/lane_seg/bisenet/model.pdparams | ||
``` | ||
- 导出模型 | ||
```shell | ||
python export.py \ | ||
--config configs/bisenetV2_tusimple_640x368_300k.yml \ | ||
--model_path output/model.pdparams \ | ||
--save_dir output/export | ||
``` | ||
|
||
- 图片使用 `data/test_images/3.jpg` | ||
|
||
### 3、编译、执行 | ||
|
||
进入目录`LaneSeg/deploy/cpp` | ||
|
||
执行`sh run_seg_cpu.sh`,会进行编译,然后在X86 CPU上执行预测。 | ||
|
||
执行`sh run_seg_gpu.sh`,会进行编译,然后在Nvidia GPU上执行预测。 | ||
|
||
结果会保存在当前目录的`out_img_seg.jpg`和`out_image_points.jpg`图片。 | ||
|
||
- 注意:对于模型和图片的路径,可以按需要对文件`run_seg_cpu.sh`和`run_seg_gpu.sh`进行修改。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set +x | ||
set -e | ||
|
||
WITH_MKL=ON | ||
WITH_GPU=OFF | ||
USE_TENSORRT=OFF | ||
DEMO_NAME=test_seg | ||
|
||
work_path=$(dirname $(readlink -f $0)) | ||
LIB_DIR="${work_path}/paddle_inference" | ||
|
||
# compile | ||
mkdir -p build | ||
cd build | ||
rm -rf * | ||
|
||
cmake .. \ | ||
-DDEMO_NAME=${DEMO_NAME} \ | ||
-DWITH_MKL=${WITH_MKL} \ | ||
-DWITH_GPU=${WITH_GPU} \ | ||
-DUSE_TENSORRT=${USE_TENSORRT} \ | ||
-DWITH_STATIC_LIB=OFF \ | ||
-DPADDLE_LIB=${LIB_DIR} | ||
|
||
make -j | ||
|
||
# run | ||
cd .. | ||
# change model_dir and img_path according to your needs | ||
./build/test_seg \ | ||
--model_dir=../../output/export/ \ | ||
--img_path=../../data/test_images/3.jpg \ | ||
--use_cpu=true \ | ||
--use_mkldnn=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set +x | ||
set -e | ||
|
||
WITH_MKL=ON | ||
WITH_GPU=ON | ||
USE_TENSORRT=OFF | ||
DEMO_NAME=test_seg | ||
|
||
work_path=$(dirname $(readlink -f $0)) | ||
LIB_DIR="${work_path}/paddle_inference" | ||
|
||
# compile | ||
mkdir -p build | ||
cd build | ||
rm -rf * | ||
|
||
cmake .. \ | ||
-DDEMO_NAME=${DEMO_NAME} \ | ||
-DWITH_MKL=${WITH_MKL} \ | ||
-DWITH_GPU=${WITH_GPU} \ | ||
-DUSE_TENSORRT=${USE_TENSORRT} \ | ||
-DWITH_STATIC_LIB=OFF \ | ||
-DPADDLE_LIB=${LIB_DIR} | ||
|
||
make -j | ||
|
||
# run | ||
cd .. | ||
# change model_dir and img_path according to your needs | ||
./build/test_seg \ | ||
--model_dir=../../output/export/ \ | ||
--img_path=../../data/test_images/3.jpg \ | ||
--use_cpu=false |
Oops, something went wrong.