From 4aa737e2648355994efe762edc1382f802b9816c Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Wed, 19 Jan 2022 21:24:21 +0800 Subject: [PATCH 01/25] Add 2.4 version info in __init__.py --- paddleseg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddleseg/__init__.py b/paddleseg/__init__.py index f5d34517d0..8715cff78f 100644 --- a/paddleseg/__init__.py +++ b/paddleseg/__init__.py @@ -14,4 +14,4 @@ from . import models, datasets, transforms -__version__ = 'develop' +__version__ = '2.4.0' From 72b2e54ef638dc641cb43e4755b4a0faa576ea2d Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Thu, 20 Jan 2022 14:50:30 +0800 Subject: [PATCH 02/25] [Issue] Add the bug report template (#1735) --- .../ISSUE_TEMPLATE/---bug-report---bug--.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/---bug-report---bug--.md diff --git a/.github/ISSUE_TEMPLATE/---bug-report---bug--.md b/.github/ISSUE_TEMPLATE/---bug-report---bug--.md new file mode 100644 index 0000000000..36942c46f2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---bug-report---bug--.md @@ -0,0 +1,32 @@ +--- +name: "\U0001F41B Bug report / Bug反馈" +about: Create a report to help us improve / 反馈Bug问题 +title: "[Bug]" +labels: bug +assignees: '' + +--- + +Thanks for your bug report. To help us solve the issue better, please provide following information: + 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) + 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) + 3. Operation system: (e.g. Linux/Windows/MacOS) + 4. Python version: (e.g. Python3.6/7/8) + 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) + 6. Full codes: (if you modify any original code,please show the comparison of the codes before and after) + 7. Detailed error information, releated running log: (if using multi-gpus,the log is saved to log/worklog.0 by default) + 8. Running command or reproduce details: + 9. Additional context: (Add any other context about the problem) + +--- + +欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: + 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) + 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) + 3. 操作系统信息:(如Linux/Windows/MacOS) + 4. Python版本号:(如Python3.6/7/8) + 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) + 6. 完整的代码:(若修改过原代码,请提供修改前后代码对比) + 7. 详细的错误信息、相关log:(若使用多卡,log默认保存在log/worklog.0) + 8. 运行指令或复现步骤: + 9. 其他内容: (增加其他与问题相关的内容) From c1cdf0131b9a7f6def0e348be9b15bda6309fa34 Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Thu, 20 Jan 2022 17:31:38 +0800 Subject: [PATCH 03/25] [Issue] Add feature request template --- .../---feature-request--------.md | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/---feature-request--------.md diff --git a/.github/ISSUE_TEMPLATE/---feature-request--------.md b/.github/ISSUE_TEMPLATE/---feature-request--------.md new file mode 100644 index 0000000000..fd99658a99 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---feature-request--------.md @@ -0,0 +1,20 @@ +--- +name: "\U0001F680 Feature request / 新功能需求" +about: Suggest an idea for this project / 提出一个新的功能需求或改进建议 +title: "[Feature Request]" +labels: enhancement +assignees: '' + +--- + +Welcome to propose a new feature! To help us understand your great feature, please provide following information: +1. A clear and concise description of the proposed feature. +2. Tell us why the feature is useful. +3. If possible, please show related codes . + +--- + +欢迎提出一个新功能需求,为了帮助我们更好理解您的需求,辛苦提供下面信息: +1. 清晰简洁的语言提出新功能需求。 +2. 请描述这个需求的必要性。 +3. 如果可以,辛苦您提供相关代码实现效果。 From 3dbbe083ba47aad1c06d8371a71a75b2a44abbab Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Thu, 20 Jan 2022 17:43:14 +0800 Subject: [PATCH 04/25] [Issue] Add general issue template --- .../ISSUE_TEMPLATE/general-issue-------.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/general-issue-------.md diff --git a/.github/ISSUE_TEMPLATE/general-issue-------.md b/.github/ISSUE_TEMPLATE/general-issue-------.md new file mode 100644 index 0000000000..90482b7510 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general-issue-------.md @@ -0,0 +1,26 @@ +--- +name: General Issue / 一般问题 +about: Report any issue about PaddleSeg / 提出任何一个与PaddleSeg相关的问题 +title: "[General Issue]" +labels: question +assignees: '' + +--- + +Thanks for your issue. To help us solve the issue better, please provide following information: + 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) + 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) + 3. Operation system: (e.g. Linux/Windows/MacOS) + 4. Python version: (e.g. Python3.6/7/8) + 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) + 6. Additional context: (Add any other context about the problem) + +--- + +欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: + 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) + 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) + 3. 操作系统信息:(如Linux/Windows/MacOS) + 4. Python版本号:(如Python3.6/7/8) + 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) + 6. 其他内容: (增加其他与问题相关的内容) From 7cc3d43fc4079ce69f6b0b52123c401c8537f5dd Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Thu, 20 Jan 2022 17:44:36 +0800 Subject: [PATCH 05/25] [Issue] Add general issue template --- .github/ISSUE_TEMPLATE/general-issue-------.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/general-issue-------.md b/.github/ISSUE_TEMPLATE/general-issue-------.md index 90482b7510..819ca44ba2 100644 --- a/.github/ISSUE_TEMPLATE/general-issue-------.md +++ b/.github/ISSUE_TEMPLATE/general-issue-------.md @@ -1,5 +1,5 @@ --- -name: General Issue / 一般问题 +name: General issue / 一般问题 about: Report any issue about PaddleSeg / 提出任何一个与PaddleSeg相关的问题 title: "[General Issue]" labels: question From 6722bc6cd8bc7036736e6bec6ebb9edf0c4676c6 Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Thu, 20 Jan 2022 19:42:39 +0800 Subject: [PATCH 06/25] [Issue] Update issue templates --- .../ISSUE_TEMPLATE/---general-issue-------.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/---general-issue-------.md diff --git a/.github/ISSUE_TEMPLATE/---general-issue-------.md b/.github/ISSUE_TEMPLATE/---general-issue-------.md new file mode 100644 index 0000000000..2cf14c07f7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---general-issue-------.md @@ -0,0 +1,26 @@ +--- +name: "\U0001F4DD General issue / 一般问题" +about: Report any issue about PaddleSeg / 提出任何一个与PaddleSeg相关的问题 +title: "[General Issue]" +labels: question +assignees: '' + +--- + +Thanks for your issue. To help us solve the issue better, please provide following information: + 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) + 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) + 3. Operation system: (e.g. Linux/Windows/MacOS) + 4. Python version: (e.g. Python3.6/7/8) + 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) + 6. Additional context: (Add any other context about the problem) + +--- + +欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: + 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) + 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) + 3. 操作系统信息:(如Linux/Windows/MacOS) + 4. Python版本号:(如Python3.6/7/8) + 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) + 6. 其他内容: (增加其他与问题相关的内容) From b7e9559670a6b02c9dd0d744fa2858a6ca72d176 Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Fri, 21 Jan 2022 09:16:10 +0800 Subject: [PATCH 07/25] Delete general-issue-------.md --- .../ISSUE_TEMPLATE/general-issue-------.md | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/general-issue-------.md diff --git a/.github/ISSUE_TEMPLATE/general-issue-------.md b/.github/ISSUE_TEMPLATE/general-issue-------.md deleted file mode 100644 index 819ca44ba2..0000000000 --- a/.github/ISSUE_TEMPLATE/general-issue-------.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: General issue / 一般问题 -about: Report any issue about PaddleSeg / 提出任何一个与PaddleSeg相关的问题 -title: "[General Issue]" -labels: question -assignees: '' - ---- - -Thanks for your issue. To help us solve the issue better, please provide following information: - 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) - 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) - 3. Operation system: (e.g. Linux/Windows/MacOS) - 4. Python version: (e.g. Python3.6/7/8) - 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) - 6. Additional context: (Add any other context about the problem) - ---- - -欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: - 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) - 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) - 3. 操作系统信息:(如Linux/Windows/MacOS) - 4. Python版本号:(如Python3.6/7/8) - 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) - 6. 其他内容: (增加其他与问题相关的内容) From bc19fd71fdde4b53f0dbfc24b0bb7145c7f5ed75 Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Fri, 21 Jan 2022 14:17:00 +0800 Subject: [PATCH 08/25] Update paper.md --- contrib/PP-HumanSeg/paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/PP-HumanSeg/paper.md b/contrib/PP-HumanSeg/paper.md index 8ee3073204..285bdb56fb 100644 --- a/contrib/PP-HumanSeg/paper.md +++ b/contrib/PP-HumanSeg/paper.md @@ -36,7 +36,7 @@ The experimental results on our Teleconferencing Video Dataset are shown in pape ## PP-HumanSeg14K: A Large-Scale Teleconferencing Video Dataset -A large-scale video portrait dataset that contains 291 videos from 23 conference scenes with 14K frames. This dataset contains various teleconferencing scenes, various actions of the participants, interference of passers-by and illumination change. The data can be obtained by sending an email to paddleseg@baidu.com including your institution/company information and the purpose on the dataset. +A large-scale video portrait dataset that contains 291 videos from 23 conference scenes with 14K frames. This dataset contains various teleconferencing scenes, various actions of the participants, interference of passers-by and illumination change. The data can be obtained by sending an email to paddleseg@baidu.com via an **offical email** (not use qq, gmail, etc.) including your institution/company information and the purpose on the dataset.

From f8c3a11b33db70d6af11a33d721a918e9c1dc0de Mon Sep 17 00:00:00 2001 From: Liu Yi Date: Fri, 21 Jan 2022 14:35:27 +0800 Subject: [PATCH 09/25] Update infer.py --- contrib/LaneSeg/deploy/python/infer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/LaneSeg/deploy/python/infer.py b/contrib/LaneSeg/deploy/python/infer.py index c6e2ddaf11..5dc60d83d5 100644 --- a/contrib/LaneSeg/deploy/python/infer.py +++ b/contrib/LaneSeg/deploy/python/infer.py @@ -116,7 +116,7 @@ def run(self, imgs): cut_height = 160 num_classes = 7 postprocessor = tusimple_processor.TusimpleProcessor( - num_classes=num_classes, cut_height=cut_height) + num_classes=num_classes, cut_height=cut_height, save_dir=args.save_dir) for i, im_path in enumerate(imgs): im = cv2.imread(im_path) From e69e75dfb3a4e8f01515bb3106573f17311d7c87 Mon Sep 17 00:00:00 2001 From: neonhuang <1174748008@qq.com> Date: Sat, 22 Jan 2022 02:32:06 +0000 Subject: [PATCH 10/25] add c++ exec script --- contrib/LaneSeg/deploy/cpp/CMakeLists.txt | 8 +-- contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh | 35 ++++++++++++ contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh | 34 ++++++++++++ contrib/LaneSeg/deploy/cpp/src/test_seg.cc | 63 +++++++++++----------- 4 files changed, 102 insertions(+), 38 deletions(-) create mode 100755 contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh create mode 100755 contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh diff --git a/contrib/LaneSeg/deploy/cpp/CMakeLists.txt b/contrib/LaneSeg/deploy/cpp/CMakeLists.txt index f148d9d0bb..025581027b 100644 --- a/contrib/LaneSeg/deploy/cpp/CMakeLists.txt +++ b/contrib/LaneSeg/deploy/cpp/CMakeLists.txt @@ -1,16 +1,12 @@ cmake_minimum_required(VERSION 3.0) project(cpp_inference_demo CXX C) -option(WITH_MKL "Compile demo with MKL/OpenBlas support, default use MKL." OFF) +option(WITH_MKL "Compile demo with MKL/OpenBlas support, default use MKL." ON) option(WITH_GPU "Compile demo with GPU/CPU, default use CPU." OFF) option(WITH_STATIC_LIB "Compile demo with static/shared library, default use static." ON) option(USE_TENSORRT "Compile demo with TensorRT." OFF) option(WITH_ROCM "Compile demo with rocm." OFF) - -set(PADDLE_LIB ${CMAKE_SOURCE_DIR}/paddle) -set(DEMO_NAME test_seg) - if(NOT WITH_STATIC_LIB) add_definitions("-DPADDLE_WITH_SHARED_LIB") else() @@ -150,7 +146,7 @@ else() endif() if (NOT WIN32) - set(EXTERNAL_LIB "-ldl -lpthread") + set(EXTERNAL_LIB "-lrt -ldl -lpthread") set(DEPS ${DEPS} ${MATH_LIB} ${MKLDNN_LIB} glog gflags protobuf xxhash cryptopp diff --git a/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh b/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh new file mode 100755 index 0000000000..cc5cfe9e28 --- /dev/null +++ b/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh @@ -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 .. + +./build/test_seg \ + --model_dir=../../output/export/ \ + --img_path=../../data/test_images/3.jpg \ + --use_cpu=true \ + --use_mkldnn=true diff --git a/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh b/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh new file mode 100755 index 0000000000..097041ab09 --- /dev/null +++ b/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh @@ -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 .. + +./build/test_seg \ + --model_dir=../../output/export/ \ + --img_path=../../data/test_images/3.jpg \ + --use_cpu=false diff --git a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc index 1613ba030c..b2ce177bbf 100644 --- a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc +++ b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc @@ -1,17 +1,3 @@ -// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - #include #include #include @@ -28,14 +14,12 @@ #include "opencv2/highgui.hpp" #include "lane_postprocess.hpp" -using namespace std; -using namespace cv; - DEFINE_string(model_dir, "", "Directory of the inference model. " "It constains deploy.yaml and infer models"); DEFINE_string(img_path, "", "Path of the test image."); DEFINE_bool(use_cpu, false, "Wether use CPU. Default: use GPU."); - +DEFINE_bool(use_trt, false, "Wether enable TensorRT when use GPU. Defualt: false."); +DEFINE_bool(use_mkldnn, false, "Wether enable MKLDNN when use CPU. Defualt: false."); DEFINE_string(save_dir, "", "Directory of the output image."); typedef struct YamlConfig { @@ -77,6 +61,22 @@ std::shared_ptr create_predictor( model_dir + "/" + yaml_config.params_file); infer_config.EnableMemoryOptim(); + if (FLAGS_use_cpu) { + LOG(INFO) << "Use CPU"; + if (FLAGS_use_mkldnn) { + // TODO(jc): fix the bug + //infer_config.EnableMKLDNN(); + infer_config.SetCpuMathLibraryNumThreads(5); + } + } else { + LOG(INFO) << "Use GPU"; + infer_config.EnableUseGpu(100, 0); + if (FLAGS_use_trt) { + infer_config.EnableTensorRtEngine(1 << 20, 1, 3, + paddle_infer::PrecisionType::kFloat32, false, false); + } + } + auto predictor = paddle_infer::CreatePredictor(infer_config); return predictor; } @@ -90,7 +90,7 @@ void hwc_img_2_chw_data(const cv::Mat& hwc_img, float* data) { } } -void process_image(const YamlConfig& yaml_config, cv::Mat& img) { +void read_process_image(const YamlConfig& yaml_config, cv::Mat& img) { if (yaml_config.is_resize) { cv::resize(img, img, cv::Size(yaml_config.resize_width, yaml_config.resize_height)); } @@ -100,12 +100,13 @@ void process_image(const YamlConfig& yaml_config, cv::Mat& img) { } } + int main(int argc, char *argv[]) { google::ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_model_dir == "") { - LOG(FATAL) << "The model_dir should not be empty."; + LOG(FATAL) << "The model_dir should not be empty."; } - + // Load yaml std::string yaml_path = FLAGS_model_dir + "/deploy.yaml"; YamlConfig yaml_config = load_yaml(yaml_path); @@ -117,9 +118,8 @@ int main(int argc, char *argv[]) { int input_width = img.cols; int input_height = img.rows; cv::Rect roi = {0, cut_height, input_width, input_height-cut_height}; - img = img(roi); - process_image(yaml_config, img); + read_process_image(yaml_config, img); int rows = img.rows; int cols = img.cols; int chs = img.channels(); @@ -144,13 +144,13 @@ int main(int argc, char *argv[]) { auto output_t = predictor->GetOutputHandle(output_names[0]); std::vector output_shape = output_t->shape(); int out_num = std::accumulate(output_shape.begin(), output_shape.end(), 1, - std::multiplies()); + std::multiplies()); std::vector out_data(out_num); output_t->CopyToCpu(out_data.data()); - + cv::Size size = cv::Size(cols, rows); int skip_index = size.height * size.width; - + const int num_classes = 7; LanePostProcess* laneNet = new LanePostProcess(input_height, input_width, rows, cols, num_classes); auto lane_coords = laneNet->lane_process(out_data, cut_height); @@ -170,10 +170,9 @@ int main(int argc, char *argv[]) { } lane_id++; } - - cv::imshow("image lane", image_ori); - cv::waitKey(); - + + cv::imwrite("out_image_points.jpg", image_ori); + cv::Mat seg_planes[num_classes]; for(int i = 0; i < num_classes; i++) { seg_planes[i].create(size, CV_32FC(1)); @@ -192,7 +191,7 @@ int main(int argc, char *argv[]) { for (int y = cut_height; y < image_final.rows + cut_height; y++){ for (int x = 0; x< image_final.cols; x++) { cv::Vec elem = image_final.at>(y - cut_height, x); - int index = std::distance(&elem[0], max_element(&elem[0], &elem[0] + num_classes)); + int index = std::distance(&elem[0], std::max_element(&elem[0], &elem[0] + num_classes)); binary_image.at(y,x)= index; } } @@ -200,7 +199,7 @@ int main(int argc, char *argv[]) { // Get pseudo image cv::Mat out_eq_img; cv::equalizeHist(binary_image, out_eq_img); - cv::imwrite("out_img.jpg", binary_image*255); + cv::imwrite("out_img_seg.jpg", binary_image*255); LOG(INFO) << "Finish"; } From 92605dacf4c0a552bd88057dc5318c79e05305bb Mon Sep 17 00:00:00 2001 From: neonhuang <1174748008@qq.com> Date: Sat, 22 Jan 2022 02:59:01 +0000 Subject: [PATCH 11/25] update test_seg.cc --- contrib/LaneSeg/deploy/cpp/src/test_seg.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc index b2ce177bbf..260d82d8bb 100644 --- a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc +++ b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc @@ -14,6 +14,9 @@ #include "opencv2/highgui.hpp" #include "lane_postprocess.hpp" +using namespace std; +using namespace cv; + DEFINE_string(model_dir, "", "Directory of the inference model. " "It constains deploy.yaml and infer models"); DEFINE_string(img_path, "", "Path of the test image."); @@ -90,7 +93,7 @@ void hwc_img_2_chw_data(const cv::Mat& hwc_img, float* data) { } } -void read_process_image(const YamlConfig& yaml_config, cv::Mat& img) { +void process_image(const YamlConfig& yaml_config, cv::Mat& img) { if (yaml_config.is_resize) { cv::resize(img, img, cv::Size(yaml_config.resize_width, yaml_config.resize_height)); } @@ -118,8 +121,9 @@ int main(int argc, char *argv[]) { int input_width = img.cols; int input_height = img.rows; cv::Rect roi = {0, cut_height, input_width, input_height-cut_height}; + img = img(roi); - read_process_image(yaml_config, img); + process_image(yaml_config, img); int rows = img.rows; int cols = img.cols; int chs = img.channels(); @@ -191,7 +195,7 @@ int main(int argc, char *argv[]) { for (int y = cut_height; y < image_final.rows + cut_height; y++){ for (int x = 0; x< image_final.cols; x++) { cv::Vec elem = image_final.at>(y - cut_height, x); - int index = std::distance(&elem[0], std::max_element(&elem[0], &elem[0] + num_classes)); + int index = std::distance(&elem[0], max_element(&elem[0], &elem[0] + num_classes)); binary_image.at(y,x)= index; } } From 00f194991e4571dd5a386c677b3004a9c5bcd333 Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:16:50 +0800 Subject: [PATCH 12/25] Delete ---bug-report---bug--.md delete --- .../ISSUE_TEMPLATE/---bug-report---bug--.md | 32 ------------------- 1 file changed, 32 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/---bug-report---bug--.md diff --git a/.github/ISSUE_TEMPLATE/---bug-report---bug--.md b/.github/ISSUE_TEMPLATE/---bug-report---bug--.md deleted file mode 100644 index 36942c46f2..0000000000 --- a/.github/ISSUE_TEMPLATE/---bug-report---bug--.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -name: "\U0001F41B Bug report / Bug反馈" -about: Create a report to help us improve / 反馈Bug问题 -title: "[Bug]" -labels: bug -assignees: '' - ---- - -Thanks for your bug report. To help us solve the issue better, please provide following information: - 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) - 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) - 3. Operation system: (e.g. Linux/Windows/MacOS) - 4. Python version: (e.g. Python3.6/7/8) - 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) - 6. Full codes: (if you modify any original code,please show the comparison of the codes before and after) - 7. Detailed error information, releated running log: (if using multi-gpus,the log is saved to log/worklog.0 by default) - 8. Running command or reproduce details: - 9. Additional context: (Add any other context about the problem) - ---- - -欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: - 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) - 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) - 3. 操作系统信息:(如Linux/Windows/MacOS) - 4. Python版本号:(如Python3.6/7/8) - 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) - 6. 完整的代码:(若修改过原代码,请提供修改前后代码对比) - 7. 详细的错误信息、相关log:(若使用多卡,log默认保存在log/worklog.0) - 8. 运行指令或复现步骤: - 9. 其他内容: (增加其他与问题相关的内容) From 27c36f983c4fa842d095360a3cb08815ee5bf993 Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:17:09 +0800 Subject: [PATCH 13/25] Delete ---feature-request--------.md delete --- .../---feature-request--------.md | 20 ------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/---feature-request--------.md diff --git a/.github/ISSUE_TEMPLATE/---feature-request--------.md b/.github/ISSUE_TEMPLATE/---feature-request--------.md deleted file mode 100644 index fd99658a99..0000000000 --- a/.github/ISSUE_TEMPLATE/---feature-request--------.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: "\U0001F680 Feature request / 新功能需求" -about: Suggest an idea for this project / 提出一个新的功能需求或改进建议 -title: "[Feature Request]" -labels: enhancement -assignees: '' - ---- - -Welcome to propose a new feature! To help us understand your great feature, please provide following information: -1. A clear and concise description of the proposed feature. -2. Tell us why the feature is useful. -3. If possible, please show related codes . - ---- - -欢迎提出一个新功能需求,为了帮助我们更好理解您的需求,辛苦提供下面信息: -1. 清晰简洁的语言提出新功能需求。 -2. 请描述这个需求的必要性。 -3. 如果可以,辛苦您提供相关代码实现效果。 From 49e12faafdcfdeac4af5f7d44bef16c0149653e4 Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:17:24 +0800 Subject: [PATCH 14/25] Delete ---general-issue-------.md delete --- .../ISSUE_TEMPLATE/---general-issue-------.md | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/---general-issue-------.md diff --git a/.github/ISSUE_TEMPLATE/---general-issue-------.md b/.github/ISSUE_TEMPLATE/---general-issue-------.md deleted file mode 100644 index 2cf14c07f7..0000000000 --- a/.github/ISSUE_TEMPLATE/---general-issue-------.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -name: "\U0001F4DD General issue / 一般问题" -about: Report any issue about PaddleSeg / 提出任何一个与PaddleSeg相关的问题 -title: "[General Issue]" -labels: question -assignees: '' - ---- - -Thanks for your issue. To help us solve the issue better, please provide following information: - 1. PaddleSeg version: (please specify the branch as well,e.g. PaddleSeg release/2.3) - 2. PaddlePaddle version: (e.g. PaddlePaddle 2.1.0) - 3. Operation system: (e.g. Linux/Windows/MacOS) - 4. Python version: (e.g. Python3.6/7/8) - 5. CUDA/cuDNN version: (e.g. CUDA10.2/cuDNN 7.6.5) - 6. Additional context: (Add any other context about the problem) - ---- - -欢迎您反馈PaddleSeg使用问题,辛苦您提供以下信息,方便我们快速定位和解决问题: - 1. PaddleSeg版本:(请提供版本号和分支信息,如PaddleSeg release/2.3) - 2. PaddlePaddle版本:(如PaddlePaddle 2.1.0) - 3. 操作系统信息:(如Linux/Windows/MacOS) - 4. Python版本号:(如Python3.6/7/8) - 5. CUDA/cuDNN版本:( 如CUDA10.2/cuDNN 7.6.5等) - 6. 其他内容: (增加其他与问题相关的内容) From ef6873e1811b5dfbfcfec8a5d8149dee2c5c31e6 Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:18:48 +0800 Subject: [PATCH 15/25] Update __init__.py update --- paddleseg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddleseg/__init__.py b/paddleseg/__init__.py index 8715cff78f..f5d34517d0 100644 --- a/paddleseg/__init__.py +++ b/paddleseg/__init__.py @@ -14,4 +14,4 @@ from . import models, datasets, transforms -__version__ = '2.4.0' +__version__ = 'develop' From 087681242cdb8394acd272c6ec2c750ca0c522d8 Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:21:38 +0800 Subject: [PATCH 16/25] Update test_seg.cc update license --- contrib/LaneSeg/deploy/cpp/src/test_seg.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc index 260d82d8bb..faf7333e18 100644 --- a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc +++ b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc @@ -1,3 +1,17 @@ +// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #include #include #include From c144ec134b57fc1932b168c99bdc88bc50ea9afd Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:26:04 +0800 Subject: [PATCH 17/25] Update test_seg.cc update style --- contrib/LaneSeg/deploy/cpp/src/test_seg.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc index faf7333e18..f70f53e1f4 100644 --- a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc +++ b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc @@ -165,10 +165,8 @@ int main(int argc, char *argv[]) { std::multiplies()); std::vector out_data(out_num); output_t->CopyToCpu(out_data.data()); - cv::Size size = cv::Size(cols, rows); int skip_index = size.height * size.width; - const int num_classes = 7; LanePostProcess* laneNet = new LanePostProcess(input_height, input_width, rows, cols, num_classes); auto lane_coords = laneNet->lane_process(out_data, cut_height); @@ -188,7 +186,7 @@ int main(int argc, char *argv[]) { } lane_id++; } - + cv::imwrite("out_image_points.jpg", image_ori); cv::Mat seg_planes[num_classes]; From da5bdaed2be3233d994ccac75de9b931efea294e Mon Sep 17 00:00:00 2001 From: neonhuang <87560459+neonhuang@users.noreply.github.com> Date: Sat, 22 Jan 2022 11:28:40 +0800 Subject: [PATCH 18/25] Update test_seg.cc update style --- contrib/LaneSeg/deploy/cpp/src/test_seg.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc index f70f53e1f4..3fdb9323bc 100644 --- a/contrib/LaneSeg/deploy/cpp/src/test_seg.cc +++ b/contrib/LaneSeg/deploy/cpp/src/test_seg.cc @@ -165,8 +165,10 @@ int main(int argc, char *argv[]) { std::multiplies()); std::vector out_data(out_num); output_t->CopyToCpu(out_data.data()); + cv::Size size = cv::Size(cols, rows); int skip_index = size.height * size.width; + const int num_classes = 7; LanePostProcess* laneNet = new LanePostProcess(input_height, input_width, rows, cols, num_classes); auto lane_coords = laneNet->lane_process(out_data, cut_height); From 33e001233d18e004f2bccaae2f0ac52a4b3e668b Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:35:56 +0800 Subject: [PATCH 19/25] update ReadMe --- contrib/LaneSeg/README.md | 2 +- contrib/LaneSeg/README_CN.md | 2 +- contrib/LaneSeg/deploy/cpp/README.md | 44 +++++++++++++++++++++++ contrib/LaneSeg/deploy/cpp/README_cn.md | 41 +++++++++++++++++++++ contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh | 2 +- contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh | 2 +- 6 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 contrib/LaneSeg/deploy/cpp/README.md create mode 100644 contrib/LaneSeg/deploy/cpp/README_cn.md diff --git a/contrib/LaneSeg/README.md b/contrib/LaneSeg/README.md index d8d8949c3a..17ea626d35 100644 --- a/contrib/LaneSeg/README.md +++ b/contrib/LaneSeg/README.md @@ -227,6 +227,6 @@ python deploy/python/infer.py --help ``` #### Paddle Inference(C++) -reference [Paddle Inference tutorial](../../deploy/cpp/) +reference [Paddle Inference tutorial](./deploy/cpp/README.md) the C++ sources files of the project is in LaneSeg/deploy/cpp diff --git a/contrib/LaneSeg/README_CN.md b/contrib/LaneSeg/README_CN.md index b02ac9dc8a..8ce98ceac2 100644 --- a/contrib/LaneSeg/README_CN.md +++ b/contrib/LaneSeg/README_CN.md @@ -230,6 +230,6 @@ python deploy/python/infer.py --help ``` #### Paddle Inference部署(C++) -参见[Paddle Inference部署教程](../../deploy/cpp/) +参见[Paddle Inference部署教程](./deploy/cpp/README_cn.md) 本项目使用的C++源文件在LaneSeg/deploy/cpp目录下 diff --git a/contrib/LaneSeg/deploy/cpp/README.md b/contrib/LaneSeg/deploy/cpp/README.md new file mode 100644 index 0000000000..b20c0e393d --- /dev/null +++ b/contrib/LaneSeg/deploy/cpp/README.md @@ -0,0 +1,44 @@ +# PaddleSeg C++ Predictive Deployment Scenario + +## Deploy the PaddleSeg model using Paddle Inference C++ + +To deploy PaddleSeg model using Paddle Inference C++, please refer to [Tutorial](../../../../docs/deployment/inference/cpp_inference.md). + +###1、Install + +- Paddle Inference C++ + +- OpenCV + +- Yaml + +~~More 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 diff --git a/contrib/LaneSeg/deploy/cpp/README_cn.md b/contrib/LaneSeg/deploy/cpp/README_cn.md new file mode 100644 index 0000000000..32d0c9c73e --- /dev/null +++ b/contrib/LaneSeg/deploy/cpp/README_cn.md @@ -0,0 +1,41 @@ +# PaddleSeg C++ 预测部署方案 + +## 使用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进行修改。 diff --git a/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh b/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh index cc5cfe9e28..21cd95814b 100755 --- a/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh +++ b/contrib/LaneSeg/deploy/cpp/run_seg_cpu.sh @@ -27,7 +27,7 @@ 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 \ diff --git a/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh b/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh index 097041ab09..9570e00854 100755 --- a/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh +++ b/contrib/LaneSeg/deploy/cpp/run_seg_gpu.sh @@ -27,7 +27,7 @@ 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 \ From a8df53baa6054a31590e403020a145804916f997 Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:40:29 +0800 Subject: [PATCH 20/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/README.md | 9 ++++----- contrib/LaneSeg/deploy/cpp/README_cn.md | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/LaneSeg/deploy/cpp/README.md b/contrib/LaneSeg/deploy/cpp/README.md index b20c0e393d..4827a318c7 100644 --- a/contrib/LaneSeg/deploy/cpp/README.md +++ b/contrib/LaneSeg/deploy/cpp/README.md @@ -1,10 +1,9 @@ -# PaddleSeg C++ Predictive Deployment Scenario +English | [简体中文](README_CN.md) ## Deploy the PaddleSeg model using Paddle Inference C++ -To deploy PaddleSeg model using Paddle Inference C++, please refer to [Tutorial](../../../../docs/deployment/inference/cpp_inference.md). -###1、Install +### 1、Install - Paddle Inference C++ @@ -14,7 +13,7 @@ To deploy PaddleSeg model using Paddle Inference C++, please refer to [Tutorial] ~~More informations,please refer to [Tutorial](../../docs/deployment/inference/cpp_inference.md)。 -###2、Models and Pictures +### 2、Models and Pictures - Downdload model Enter to `LaneSeg/` directory, and execute commands as follows: @@ -32,7 +31,7 @@ To deploy PaddleSeg model using Paddle Inference C++, please refer to [Tutorial] - Using the image `data/test_images/3.jpg` -###3、Compile and execute +### 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. diff --git a/contrib/LaneSeg/deploy/cpp/README_cn.md b/contrib/LaneSeg/deploy/cpp/README_cn.md index 32d0c9c73e..fa7873b89e 100644 --- a/contrib/LaneSeg/deploy/cpp/README_cn.md +++ b/contrib/LaneSeg/deploy/cpp/README_cn.md @@ -1,8 +1,8 @@ -# PaddleSeg C++ 预测部署方案 +简体中文 | [English](README.md) ## 使用Paddle Inference C++部署PaddleSeg模型 -###1、安装 +### 1、安装 - Paddle Inference C++ @@ -12,7 +12,7 @@ ~~更多的信息,请参考[教程](../../../../docs/deployment/inference/cpp_inference_cn.md)。 -###2、模型和图片 +### 2、模型和图片 - 下载模型 在LaneSeg/目录下执行如下命令: ```shell @@ -29,7 +29,7 @@ - 图片使用 data/test_images/3.jpg -###3、编译、执行 +### 3、编译、执行 进入目录LaneSeg/deploy/cpp 执行sh run_seg_cpu.sh,会进行编译,然后在X86 CPU上执行预测。 From e68ac6e2ea14eb0865a794bab3ff54f0a2ff8a7b Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:44:28 +0800 Subject: [PATCH 21/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/README.md | 2 +- contrib/LaneSeg/deploy/cpp/README_cn.md | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/LaneSeg/deploy/cpp/README.md b/contrib/LaneSeg/deploy/cpp/README.md index 4827a318c7..44b9b27018 100644 --- a/contrib/LaneSeg/deploy/cpp/README.md +++ b/contrib/LaneSeg/deploy/cpp/README.md @@ -11,7 +11,7 @@ English | [简体中文](README_CN.md) - Yaml -~~More informations,please refer to [Tutorial](../../docs/deployment/inference/cpp_inference.md)。 + More install informations,please refer to [Tutorial](../../docs/deployment/inference/cpp_inference.md)。 ### 2、Models and Pictures - Downdload model diff --git a/contrib/LaneSeg/deploy/cpp/README_cn.md b/contrib/LaneSeg/deploy/cpp/README_cn.md index fa7873b89e..66345cd971 100644 --- a/contrib/LaneSeg/deploy/cpp/README_cn.md +++ b/contrib/LaneSeg/deploy/cpp/README_cn.md @@ -10,11 +10,11 @@ - Yaml -~~更多的信息,请参考[教程](../../../../docs/deployment/inference/cpp_inference_cn.md)。 + 更多的安装信息,请参考[教程](../../../../docs/deployment/inference/cpp_inference_cn.md)。 ### 2、模型和图片 - 下载模型 -在LaneSeg/目录下执行如下命令: + 在`LaneSeg/`目录下执行如下命令: ```shell mkdir output # if not exists wget -P output https://paddleseg.bj.bcebos.com/lane_seg/bisenet/model.pdparams @@ -27,15 +27,15 @@ --save_dir output/export ``` - - 图片使用 data/test_images/3.jpg + - 图片使用 `data/test_images/3.jpg` ### 3、编译、执行 -进入目录LaneSeg/deploy/cpp +进入目录`LaneSeg/deploy/cpp` -执行sh run_seg_cpu.sh,会进行编译,然后在X86 CPU上执行预测。 +执行`sh run_seg_cpu.sh`,会进行编译,然后在X86 CPU上执行预测。 -执行sh run_seg_gpu.sh,会进行编译,然后在Nvidia GPU上执行预测。 +执行`sh run_seg_gpu.sh`,会进行编译,然后在Nvidia GPU上执行预测。 -结果会保存在当前目录的“out_img_seg.jpg“和“out_image_points.jpg“图片。 +结果会保存在当前目录的`out_img_seg.jpg`和`out_image_points.jpg`图片。 -- 注意:对于模型和图片的路径,可以按需要对文件run_seg_cpu.sh和run_seg_gpu.sh进行修改。 +- 注意:对于模型和图片的路径,可以按需要对文件`run_seg_cpu.sh`和`run_seg_gpu.sh`进行修改。 From f3dabe9ef7e5714c567260b5feee40997c3d7103 Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:50:54 +0800 Subject: [PATCH 22/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/README.md | 5 ++++- contrib/LaneSeg/deploy/cpp/README_cn.md | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/LaneSeg/deploy/cpp/README.md b/contrib/LaneSeg/deploy/cpp/README.md index 44b9b27018..fc78a9c92a 100644 --- a/contrib/LaneSeg/deploy/cpp/README.md +++ b/contrib/LaneSeg/deploy/cpp/README.md @@ -11,9 +11,10 @@ English | [简体中文](README_CN.md) - Yaml - More install informations,please refer to [Tutorial](../../docs/deployment/inference/cpp_inference.md)。 + 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: @@ -22,6 +23,7 @@ English | [简体中文](README_CN.md) 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 \ @@ -32,6 +34,7 @@ English | [简体中文](README_CN.md) - 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. diff --git a/contrib/LaneSeg/deploy/cpp/README_cn.md b/contrib/LaneSeg/deploy/cpp/README_cn.md index 66345cd971..3fc7551a8b 100644 --- a/contrib/LaneSeg/deploy/cpp/README_cn.md +++ b/contrib/LaneSeg/deploy/cpp/README_cn.md @@ -13,6 +13,7 @@ 更多的安装信息,请参考[教程](../../../../docs/deployment/inference/cpp_inference_cn.md)。 ### 2、模型和图片 + - 下载模型 在`LaneSeg/`目录下执行如下命令: ```shell @@ -30,6 +31,7 @@ - 图片使用 `data/test_images/3.jpg` ### 3、编译、执行 + 进入目录`LaneSeg/deploy/cpp` 执行`sh run_seg_cpu.sh`,会进行编译,然后在X86 CPU上执行预测。 From 3eb7e4a048c6752a8d02d26b8b8b476b82c7a9a2 Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:53:24 +0800 Subject: [PATCH 23/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/{README_cn.md => README_CN1.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename contrib/LaneSeg/deploy/cpp/{README_cn.md => README_CN1.md} (100%) diff --git a/contrib/LaneSeg/deploy/cpp/README_cn.md b/contrib/LaneSeg/deploy/cpp/README_CN1.md similarity index 100% rename from contrib/LaneSeg/deploy/cpp/README_cn.md rename to contrib/LaneSeg/deploy/cpp/README_CN1.md From 5ae22ae5c26821823e844c6aa6901a085a0e8400 Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 13:53:46 +0800 Subject: [PATCH 24/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/{README_CN1.md => README_CN.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename contrib/LaneSeg/deploy/cpp/{README_CN1.md => README_CN.md} (100%) diff --git a/contrib/LaneSeg/deploy/cpp/README_CN1.md b/contrib/LaneSeg/deploy/cpp/README_CN.md similarity index 100% rename from contrib/LaneSeg/deploy/cpp/README_CN1.md rename to contrib/LaneSeg/deploy/cpp/README_CN.md From 6c1903c5d802d2f7d43e314187297b92de3adba4 Mon Sep 17 00:00:00 2001 From: huangshenghui Date: Sat, 22 Jan 2022 14:01:28 +0800 Subject: [PATCH 25/25] update ReadMe --- contrib/LaneSeg/deploy/cpp/README_CN.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/LaneSeg/deploy/cpp/README_CN.md b/contrib/LaneSeg/deploy/cpp/README_CN.md index 3fc7551a8b..b92caad4e7 100644 --- a/contrib/LaneSeg/deploy/cpp/README_CN.md +++ b/contrib/LaneSeg/deploy/cpp/README_CN.md @@ -15,7 +15,8 @@ ### 2、模型和图片 - 下载模型 - 在`LaneSeg/`目录下执行如下命令: + + 进入`LaneSeg/`目录下,执行如下命令: ```shell mkdir output # if not exists wget -P output https://paddleseg.bj.bcebos.com/lane_seg/bisenet/model.pdparams