Răsfoiți Sursa

update doc_1109

yzl19940819 4 ani în urmă
părinte
comite
9b5f848bcc
48 a modificat fișierele cu 8 adăugiri și 5113 ștergeri
  1. 0 4
      README.md
  2. 0 3
      deploy/README.md
  3. 0 142
      deploy/cpp/docs/compile/paddle/jetson.md
  4. 0 157
      deploy/cpp/docs/jetson-deploy/CMakeLists.txt
  5. 0 44
      deploy/cpp/docs/jetson-deploy/Deploy_infer/Deploy_infer.pro
  6. 0 336
      deploy/cpp/docs/jetson-deploy/Deploy_infer/Deploy_infer.pro.user
  7. 0 1872
      deploy/cpp/docs/jetson-deploy/Deploy_infer/inferthread.cpp
  8. 0 135
      deploy/cpp/docs/jetson-deploy/Deploy_infer/inferthread.h
  9. 0 11
      deploy/cpp/docs/jetson-deploy/Deploy_infer/main.cpp
  10. 0 577
      deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.cpp
  11. 0 126
      deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.h
  12. 0 829
      deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.ui
  13. 0 473
      deploy/cpp/docs/jetson-deploy/README.md
  14. BIN
      deploy/cpp/docs/jetson-deploy/images/cmakelist_set.png
  15. BIN
      deploy/cpp/docs/jetson-deploy/images/cpu_infer.png
  16. BIN
      deploy/cpp/docs/jetson-deploy/images/debug_incode.png
  17. BIN
      deploy/cpp/docs/jetson-deploy/images/deploy_build_sh.png
  18. BIN
      deploy/cpp/docs/jetson-deploy/images/dong_tai_lianjieku.png
  19. BIN
      deploy/cpp/docs/jetson-deploy/images/gpu_infer.png
  20. BIN
      deploy/cpp/docs/jetson-deploy/images/import_opencv.png
  21. BIN
      deploy/cpp/docs/jetson-deploy/images/infer_demo_cmakelist.png
  22. BIN
      deploy/cpp/docs/jetson-deploy/images/main_slot.png
  23. BIN
      deploy/cpp/docs/jetson-deploy/images/output_info.png
  24. BIN
      deploy/cpp/docs/jetson-deploy/images/pro_set_libpath.png
  25. BIN
      deploy/cpp/docs/jetson-deploy/images/project_list.png
  26. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_add_newfile.png
  27. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_create_class.png
  28. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_create_guipro.png
  29. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_importppipeline.png
  30. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_inferthreadcpp_set.png
  31. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_mainwindowset.png
  32. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_project_inferlib.png
  33. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_set_proname.png
  34. BIN
      deploy/cpp/docs/jetson-deploy/images/qt_start_new_pro.png
  35. BIN
      deploy/cpp/docs/jetson-deploy/images/show_menu.png
  36. BIN
      deploy/cpp/docs/jetson-deploy/images/thread_import_opencv.png
  37. BIN
      deploy/cpp/docs/jetson-deploy/images/thread_signal.png
  38. BIN
      deploy/cpp/docs/jetson-deploy/images/tupian_suofang.png
  39. BIN
      deploy/cpp/docs/jetson-deploy/images/yaml_cmakelist.png
  40. 0 312
      deploy/cpp/docs/jetson-deploy/model_infer.cpp
  41. 1 1
      deploy/cpp/docs/models/paddleclas.md
  42. 1 1
      deploy/cpp/docs/models/paddledetection.md
  43. 1 1
      deploy/cpp/docs/models/paddleseg.md
  44. 0 84
      docs/install.md
  45. 1 1
      docs/quick_start_GUI.md
  46. 2 2
      examples/helmet_detection/README.md
  47. 1 1
      examples/helmet_detection/accuracy_improvement.md
  48. 1 1
      examples/meter_reader/README.md

+ 0 - 4
README.md

@@ -91,15 +91,11 @@ PaddleX提供了图像化开发界面、本地API、Restful-API三种开发模
       - [C++源码编译](./deploy/cpp/README.md)
       - [C#工程化示例](./deploy/cpp/docs/CSharp_deploy)
     - [Python部署](./docs/python_deploy.md)
-  - 边缘侧部署
-    - [NVIDIA-Jetson部署(C++)](./deploy/cpp/docs/compile/paddle/jetson.md)
-
   - 服务化部署
     - [HubServing部署(Python)](./docs/hub_serving_deploy.md)
   - [基于ONNX部署(C++)](./deploy/cpp/docs/compile/README.md)
     - [OpenVINO推理引擎](./deploy/cpp/docs/compile/openvino/README.md)
     - [Triton部署](./deploy/cpp/docs/compile/triton/docker.md)
-
 - [模型加密](./deploy/cpp/docs/demo/decrypt_infer.md)
 
 ### 5. 附录

+ 0 - 3
deploy/README.md

@@ -7,9 +7,6 @@ PaddleX提供了多种部署方式,用户可根据实际需要选择本地部
       - [C++源码编译](./../deploy/cpp/README.md)
       - [C#工程化示例](./../deploy/cpp/docs/CSharp_deploy)
     - [Python部署](./../docs/python_deploy.md)
-  - 边缘侧部署
-    - [NVIDIA-Jetson部署(C++)](./../deploy/cpp/docs/compile/paddle/jetson.md)
-
   - 服务化部署
     - [HubServing部署(Python)](./../docs/hub_serving_deploy.md)
   - [基于ONNX部署(C++)](./../deploy/cpp/docs/compile/README.md)

+ 0 - 142
deploy/cpp/docs/compile/paddle/jetson.md

@@ -1,142 +0,0 @@
-# 基于PaddleInference的推理-Jetson环境编译
-本文档指引用户如何基于PaddleInference在Jetson平台上对飞桨模型进行推理,并编译执行。
-
-## 环境依赖
-gcc >= 5.4.0
-cmake >= 3.5.1
-
-(Jetson环境下)Ubuntu 16.04/18.04
-
-## 编译步骤
-### Step1: 获取部署代码
-```
-git clone https://github.com/PaddlePaddle/PaddleX.git
-cd PaddleX/deploy/cpp
-```
-**说明**:`C++`预测代码在`PaddleX/deploy/cpp` 目录,该目录不依赖任何`PaddleX`下其他目录。所有的公共实现代码在`model_deploy`目录下,所有示例代码都在`demo`目录下。
-
-> 也可手动下载完整的`PaddleX`,进行离线安装(接下来的步骤都相通)
-
-### Step 2. 下载Jetson下PaddlePaddle C++ 预编译预测库
-PaddlePaddle C++ 预测库针对是否使用GPU、是否支持TensorRT、以及不同的CUDA版本提供了已经编译好的预测库,目前PaddleX支持Paddle预测库2.0+,最新2.1版本下载链接如下所示:
-
-| 版本说明                               | 预测库(2.1)                                                                                                                   | 编译器  |
-| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------- |
-| Jetpack4.4: nv-jetson-cuda10.2-cudnn8-trt7(all) | [paddle_inference.tgz](https://paddle-inference-lib.bj.bcebos.com/2.1.1-nv-jetson-jetpack4.4-all/paddle_inference_install_dir.tgz)   | gcc 8.2 |
-| Jetpack4.4: nv-jetson-cuda10.2-cudnn8-trt7(nano) | [ paddle_inference.tgz](https://paddle-inference-lib.bj.bcebos.com/2.1.1-nv-jetson-jetpack4.4-nano/paddle_inference_install_dir.tgz)  | gcc 8.2 |
-| Jetpack4.4: nv-jetson-cuda10.2-cudnn8-trt7(tx2)	 | [ paddle_inference.tgz](https://paddle-inference-lib.bj.bcebos.com/2.1.1-nv-jetson-jetpack4.4-tx2/paddle_inference_install_dir.tgz) | gcc 8.2 |
-| Jetpack4.4: nv-jetson-cuda10.2-cudnn8-trt7(xavier) | [ paddle_inference.tgz](https://paddle-inference-lib.bj.bcebos.com/2.1.1-nv-jetson-jetpack4.4-xavier/paddle_inference_install_dir.tgz) | gcc 8.2 |
-
-请根据实际情况选择下载,如若以上版本不满足您的需求,请至[C++预测库下载列表](https://paddleinference.paddlepaddle.org.cn/v2.1/user_guides/download_lib.html)选择符合的版本。
-
-将预测库解压后,其所在目录(例如解压至`PaddleX/deploy/cpp/paddle_inferenc/`)下主要包含的内容有:
-```
-|—— CmakeCache.txt
-|
-├── paddle/ # paddle核心库和头文件
-|
-├── third_party # 第三方依赖库和头文件
-|
-└── version.txt # 版本和编译信息(里边有编译时gcc、cuda、cudnn的版本信息)
-```
-<div>
-  <img src="../../images/paddleinference_filelist.png">
-  </div>
-
-### Step 3. 修改编译参数
-
-根据自己的系统环境,修改`PaddleX/deploy/cpp/script/jetson_build.sh`脚本中的参数,主要修改的参数为以下几个
-| 参数          | 说明                                                                                 |
-| :------------ | :----------------------------------------------------------------------------------- |
-| WITH_GPU      | ON或OFF,表示是否使用GPU,当下载的为CPU预测库时,设为OFF                             |
-| PADDLE_DIR    | 预测库所在路径,默认为`PaddleX/deploy/cpp/paddle_inference`目录下                    |
-| CUDA_LIB      | cuda相关lib文件所在的目录路径 -- 请注意jetson预装的cuda所在路径(如:/usr/local/cuda/lib64) |
-| CUDNN_LIB     | cudnn相关lib文件所在的目录路径 -- 请注意jetson预装的cuda所在路径(如:/usr/lib/aarch64-linux-gnu)    |
-| WITH_TENSORRT | ON或OFF,表示是否使用开启TensorRT                                                    |
-| TENSORRT_DIR  | TensorRT 的路径,如果开启TensorRT开关WITH_TENSORRT,需修改为您实际安装的TensorRT路径     |
-| WITH_ENCRYPTION      | ON或OFF,表示是否开启加密模块                             |
-| OPENSSL_DIR    | OPENSSL所在路径,解密所需。默认为`PaddleX/deploy/cpp/deps/penssl-1.1.0k`目录下        |
-
-> **要注意相关参数路径不要有误——特别是CUDA_LIB以及CUDNN_LIB,如果需要启动TensorRt,也需指定当前的路径。**
-
-<div>
-  <img src="../../images/deploy_build_sh.png">
-  </div>
-
-> 不需要添加oepncv路径,在jetson中编译可直接使用环境本身预装的opencv进行deploy编译——具体配置在Step4中。
-
-
-### Step 4. 修改build时需对应的CMakeLists.txt
-根据自己的系统环境,修改`PaddleX/deploy/cpp/CMakeLists.txt`脚本中的参数,主要修改的参数为以下几个:位于其中注释`#OPENCV`之后的部分
-| 参数          | 说明                                                                                 |
-| :------------ | :----------------------------------------------------------------------------------- |
-| set(OpenCV_INCLUDE_DIRS "/usr/include/opencv")      | 配置Jetson预置opencv的include路径    |
-| file(GLOB OpenCV_LIBS /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX})    | 配置opencv动态链接库*.so    |
-
-替换具体如下:(xavier为例)
-
-1. /usr/include/opencv --> /usr/include/opencv4
-  > 具体路径,以部署环境中opencv的include路径为准。
-  > opencv4 中包含: opencv, opencv2
-
-2. /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX} --> /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX}
-  > 具体路径,以部署环境中opencv的*.so路径为准, 主要修改libopencv_前的路径。
-
-<div>
-  <img src="../../images/cmakelist_set.png">
-  </div>
-
-### Step 5. 添加yaml库源码
-由于Jetson环境下编译还需要yaml,所以这里需要手动下载yaml包,保证编译的正常运行。
-
-> 1. 点击[下载yaml依赖包](https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip),无需解压
-> 2. 修改`PaddleX/deploy/cpp/cmake/yaml.cmake`文件,将`URL https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip`中网址替换为第3步中下载的路径,如改为`URL /Users/Download/yaml-cpp.zip`
-
-**这里yaml存放路径为了确保使用最好保证全英文路径**
-eg:
-
-<div>
-  <img src="../../images/yaml_cmakelist.png">
-  </div>
-
-> 其它支持的加密操作以及TensorRT,可参考[Linux环境编译指南](./linux.md).
-
-### Step 6. 编译
-以上yaml库添加完成,同时也修改完jetson_build.sh后,即可执行编译, **[注意]**: 以下命令在`PaddleX/deploy/cpp`目录下进行执行
-
-```
-sh script/jetson_build.sh
-```
-
-> 编译时,如果存在cmake多线程问题——请前往`jetson_build.sh`末尾,将`make -j8`改为`make`或者小于8.
-
-
-### Step 7. 编译结果
-
-编译后会在`PaddleX/deploy/cpp/build/demo`目录下生成`model_infer`、`multi_gpu_model_infer`和`batch_infer`等几个可执行二进制文件示例,分别用于在单卡/多卡/多batch上加载模型进行预测,示例使用参考如下文档:
-
-- [单卡加载模型预测示例](../../demo/model_infer.md)
-- [多卡加载模型预测示例](../../demo/multi_gpu_model_infer.md)
-
-如果编译时开启TensorRT, 会多成一个`tensorrt_infer`二进制文件示例。示例使用参考如下文档:
-- [PaddleInference集成TensorRT加载模型预测示例](../../demo/tensorrt_infer.md)
-
-如果编译时开启加密, 会多成一个`decrypt_infer`二进制文件示例。示例使用参考如下文档:
-- [模型加密预测示例](../../demo/decrypt_infer.md)
-
-
-### Step 8. QT界面部署应用Demo
-
-通过修改`PaddleX/deploy/cpp/demo/model_infer.cpp`以及`PaddleX/deploy/cpp/demo/CMakeLists.txt`, 再执行`jetson_build.sh`生成`libmodel_infer.so`动态链接库,用于QT应用调用,执行模型初始化、模型推理预测、模型注销等操作。[现已经在Jetson Xavier上利用原生编译的opencv实现了模型单张预测与文件夹连续预测,由于预编译opencv不支持解析视频格式,因此暂未对视频进行测试——仅在windows上完成了单张图片-文件夹连续预测-视频流预测的全流程验证。]
-
-> 该版本对于MaskRCNN模型的推理需要使用GPU进行推理——如果CPU下进行推理可能由于内存使用问题报错。
->
-> 鉴于Qt跨平台属性,因此如果部署环境下opencv支持视频格式,则该Demo-Gui程序可启动完整的推理可视化功能。
-
-<div>
-  <img src="../../images/show_menu.png">
-  <img src="../../images/cpu_infer.png">
-  </div>
-
-具体Demo信息可前往如下文档链接:
-- [基于QT的Jetson部署Demo](../../jetson-deploy/README.md)

+ 0 - 157
deploy/cpp/docs/jetson-deploy/CMakeLists.txt

@@ -1,157 +0,0 @@
-#paddle inference
-if (NOT DEFINED PADDLE_DIR OR ${PADDLE_DIR} STREQUAL "")
-    message(FATAL_ERROR "please set PADDLE_DIR with -DPADDLE_DIR=/path/paddle_influence_dir")
-endif()
-
-#paddle inference third party
-include_directories("${PADDLE_DIR}")
-include_directories("${PADDLE_DIR}/third_party/install/protobuf/include")
-include_directories("${PADDLE_DIR}/third_party/install/glog/include")
-include_directories("${PADDLE_DIR}/third_party/install/gflags/include")
-include_directories("${PADDLE_DIR}/third_party/install/xxhash/include")
-include_directories("${PADDLE_DIR}/third_party/install/cryptopp/include")
-
-link_directories("${PADDLE_DIR}/paddle/lib/")
-link_directories("${PADDLE_DIR}/third_party/install/protobuf/lib")
-link_directories("${PADDLE_DIR}/third_party/install/glog/lib")
-link_directories("${PADDLE_DIR}/third_party/install/gflags/lib")
-link_directories("${PADDLE_DIR}/third_party/install/xxhash/lib")
-link_directories("${PADDLE_DIR}/third_party/install/cryptopp/lib")
-
-if (WIN32)
-  set(DEPS ${DEPS} ${PADDLE_DIR}/paddle/lib/paddle_inference.lib)
-  set(DEPS ${DEPS} glog gflags_static libprotobuf xxhash cryptopp-static libyaml-cppmt shlwapi)
-else()
-  if (WITH_STATIC_LIB)
-    set(DEPS ${DEPS} ${PADDLE_DIR}/paddle/lib/libpaddle_inference${CMAKE_STATIC_LIBRARY_SUFFIX})
-  else()
-    set(DEPS ${DEPS} ${PADDLE_DIR}/paddle/lib/libpaddle_inference${CMAKE_SHARED_LIBRARY_SUFFIX})
-  endif()
-  set(DEPS ${DEPS} glog gflags protobuf xxhash cryptopp yaml-cpp)
-endif(WIN32)
-
-#MKL
-if(WITH_MKL)
-  ADD_DEFINITIONS(-DUSE_MKL)
-  set(MKLML_PATH "${PADDLE_DIR}/third_party/install/mklml")
-  include_directories("${MKLML_PATH}/include")
-  if (WIN32)
-    set(MATH_LIB ${MKLML_PATH}/lib/mklml.lib ${MKLML_PATH}/lib/libiomp5md.lib)
-  else ()
-    set(MATH_LIB ${MKLML_PATH}/lib/libmklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX} ${MKLML_PATH}/lib/libiomp5${CMAKE_SHARED_LIBRARY_SUFFIX})
-    execute_process(COMMAND cp -r ${MKLML_PATH}/lib/libmklml_intel${CMAKE_SHARED_LIBRARY_SUFFIX} /usr/lib)
-  endif ()
-  set(MKLDNN_PATH "${PADDLE_DIR}/third_party/install/mkldnn")
-  if(EXISTS ${MKLDNN_PATH})
-    include_directories("${MKLDNN_PATH}/include")
-    if (WIN32)
-      set(MKLDNN_LIB ${MKLDNN_PATH}/lib/mkldnn.lib)
-    else ()
-      set(MKLDNN_LIB ${MKLDNN_PATH}/lib/libmkldnn.so.0)
-    endif ()
-  endif()
-else()
-  set(MATH_LIB ${PADDLE_DIR}/third_party/install/openblas/lib/libopenblas${CMAKE_STATIC_LIBRARY_SUFFIX})
-endif()
-
-set(DEPS ${DEPS} ${MATH_LIB} ${MKLDNN_LIB})
-
-#set GPU
-if (WITH_PADDLE_TENSORRT AND WITH_GPU)
-  include_directories("${TENSORRT_DIR}/include")
-  link_directories("${TENSORRT_DIR}/lib")
-
-  file(READ ${TENSORRT_DIR}/include/NvInfer.h TENSORRT_VERSION_FILE_CONTENTS)
-  string(REGEX MATCH "define NV_TENSORRT_MAJOR +([0-9]+)" TENSORRT_MAJOR_VERSION
-    "${TENSORRT_VERSION_FILE_CONTENTS}")
-  if("${TENSORRT_MAJOR_VERSION}" STREQUAL "")
-    file(READ ${TENSORRT_DIR}/include/NvInferVersion.h TENSORRT_VERSION_FILE_CONTENTS)
-    string(REGEX MATCH "define NV_TENSORRT_MAJOR +([0-9]+)" TENSORRT_MAJOR_VERSION
-      "${TENSORRT_VERSION_FILE_CONTENTS}")
-  endif()
-  if("${TENSORRT_MAJOR_VERSION}" STREQUAL "")
-    message(SEND_ERROR "Failed to detect TensorRT version.")
-  endif()
-  string(REGEX REPLACE "define NV_TENSORRT_MAJOR +([0-9]+)" "\\1"
-    TENSORRT_MAJOR_VERSION "${TENSORRT_MAJOR_VERSION}")
-  message(STATUS "Current TensorRT header is ${TENSORRT_INCLUDE_DIR}/NvInfer.h. "
-    "Current TensorRT version is v${TENSORRT_MAJOR_VERSION}. ")
-endif()
-
-if(WITH_GPU)
-  if (NOT DEFINED CUDA_LIB OR ${CUDA_LIB} STREQUAL "")
-    message(FATAL_ERROR "please set CUDA_LIB with -DCUDA_LIB=/path/cuda/lib64")
-  endif()
-
-
-  if(NOT WIN32)
-    if (NOT DEFINED CUDNN_LIB)
-      message(FATAL_ERROR "please set CUDNN_LIB with -DCUDNN_LIB=/path/cudnn/")
-    endif()
-
-    set(DEPS ${DEPS} ${CUDA_LIB}/libcudart${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(DEPS ${DEPS} ${CUDNN_LIB}/libcudnn${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-    if (WITH_PADDLE_TENSORRT)
-      set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/libnvinfer${CMAKE_SHARED_LIBRARY_SUFFIX})
-      set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/libnvinfer_plugin${CMAKE_SHARED_LIBRARY_SUFFIX})
-    endif()
-
-  else()
-    set(DEPS ${DEPS} ${CUDA_LIB}/cudart${CMAKE_STATIC_LIBRARY_SUFFIX} )
-    set(DEPS ${DEPS} ${CUDA_LIB}/cublas${CMAKE_STATIC_LIBRARY_SUFFIX} )
-    set(DEPS ${DEPS} ${CUDA_LIB}/cudnn${CMAKE_STATIC_LIBRARY_SUFFIX})
-
-    if (WITH_PADDLE_TENSORRT)
-      set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/nvinfer${CMAKE_STATIC_LIBRARY_SUFFIX})
-      set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/nvinfer_plugin${CMAKE_STATIC_LIBRARY_SUFFIX})
-      if(${TENSORRT_MAJOR_VERSION} GREATER_EQUAL 7)
-        set(DEPS ${DEPS} ${TENSORRT_DIR}/lib/myelin64_1${CMAKE_STATIC_LIBRARY_SUFFIX})
-      endif()
-    endif()
-  endif()
-endif()
-
-message("-----DEPS = ${DEPS}")
-
-# engine src
-set(ENGINE_SRC ${PROJECT_SOURCE_DIR}/model_deploy/engine/src/ppinference_engine.cpp)
-
-ADD_library(model_infer SHARED ${PROJECT_SOURCE_DIR}/demo/model_infer.cpp ${SRC} ${ENGINE_SRC} ${DETECTOR_SRC} ${ENCRYPTION_SRC})
-# add_executable(model_infer model_infer.cpp ${SRC} ${ENGINE_SRC} ${DETECTOR_SRC} ${ENCRYPTION_SRC})
-ADD_DEPENDENCIES(model_infer ext-yaml-cpp)
-target_link_libraries(model_infer ${DEPS})
-
-add_executable(batch_infer batch_infer.cpp ${SRC} ${ENGINE_SRC} ${DETECTOR_SRC} ${ENCRYPTION_SRC})
-ADD_DEPENDENCIES(batch_infer ext-yaml-cpp)
-target_link_libraries(batch_infer ${DEPS})
-
-add_executable(multi_gpu_model_infer multi_gpu_model_infer.cpp ${SRC} ${ENGINE_SRC} ${DETECTOR_SRC} ${ENCRYPTION_SRC})
-ADD_DEPENDENCIES(multi_gpu_model_infer ext-yaml-cpp)
-target_link_libraries(multi_gpu_model_infer ${DEPS})
-
-if (WITH_PADDLE_TENSORRT)
-  add_executable(tensorrt_infer tensorrt_infer.cpp ${SRC} ${ENGINE_SRC} ${DETECTOR_SRC} ${ENCRYPTION_SRC})
-  ADD_DEPENDENCIES(tensorrt_infer ext-yaml-cpp)
-  target_link_libraries(tensorrt_infer ${DEPS})
-endif()
-
-if(WIN32)
-  add_custom_command(TARGET model_infer POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy ${PADDLE_DIR}/third_party/install/mklml/lib/mklml.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-    COMMAND ${CMAKE_COMMAND} -E copy ${PADDLE_DIR}/third_party/install/mklml/lib/libiomp5md.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-    COMMAND ${CMAKE_COMMAND} -E copy ${PADDLE_DIR}/third_party/install/mkldnn/lib/mkldnn.dll  ${CMAKE_BINARY_DIR}/paddle_deploy
-    COMMAND ${CMAKE_COMMAND} -E copy ${PADDLE_DIR}/paddle/lib/paddle_inference.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-  )
-  if (WITH_PADDLE_TENSORRT)
-    add_custom_command(TARGET model_infer POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy ${TENSORRT_DIR}/lib/nvinfer.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-      COMMAND ${CMAKE_COMMAND} -E copy ${TENSORRT_DIR}/lib/nvinfer_plugin.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-    )
-    if(${TENSORRT_MAJOR_VERSION} GREATER_EQUAL 7)
-      add_custom_command(TARGET model_infer POST_BUILD
-        COMMAND ${CMAKE_COMMAND} -E copy ${TENSORRT_DIR}/lib/myelin64_1.dll ${CMAKE_BINARY_DIR}/paddle_deploy
-      )
-    endif()
-  endif()
-endif()

+ 0 - 44
deploy/cpp/docs/jetson-deploy/Deploy_infer/Deploy_infer.pro

@@ -1,44 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2021-10-08T16:09:04
-#
-#-------------------------------------------------
-
-QT       += core gui
-
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-
-TARGET = Deploy_infer
-TEMPLATE = app
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which has been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
-
-
-SOURCES += \
-        main.cpp \
-        mainwindow.cpp \
-    inferthread.cpp
-
-HEADERS += \
-        mainwindow.h \
-    inferthread.h
-
-FORMS += \
-        mainwindow.ui
-
-INCLUDEPATH += /usr/include/opencv4 \
-               /usr/include/opencv4/opencv \
-               /usr/include/opencv4/opencv2
-
-LIBS += /usr/lib/libopencv_*.so
-
-

+ 0 - 336
deploy/cpp/docs/jetson-deploy/Deploy_infer/Deploy_infer.pro.user

@@ -1,336 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.5.2, 2021-10-09T20:31:16. -->
-<qtcreator>
- <data>
-  <variable>EnvironmentId</variable>
-  <value type="QByteArray">{cd61ab8b-668c-491d-9e63-a017e466d6ff}</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.ActiveTarget</variable>
-  <value type="int">0</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.EditorSettings</variable>
-  <valuemap type="QVariantMap">
-   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
-   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
-   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
-   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
-    <value type="QString" key="language">Cpp</value>
-    <valuemap type="QVariantMap" key="value">
-     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
-    </valuemap>
-   </valuemap>
-   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
-    <value type="QString" key="language">QmlJS</value>
-    <valuemap type="QVariantMap" key="value">
-     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
-    </valuemap>
-   </valuemap>
-   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
-   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
-   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
-   <value type="int" key="EditorConfiguration.IndentSize">4</value>
-   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
-   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
-   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
-   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
-   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
-   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
-   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
-   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
-   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
-   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
-   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
-   <value type="int" key="EditorConfiguration.TabSize">8</value>
-   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
-   <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
-   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
-   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
-   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
-   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
-  </valuemap>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.PluginSettings</variable>
-  <valuemap type="QVariantMap"/>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.Target.0</variable>
-  <valuemap type="QVariantMap">
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
-   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{a77c2a71-4b3f-4a86-9f9a-11225dc72ef8}</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/nvidia/Desktop/build-Deploy_infer-Desktop-Debug</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
-      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
-    </valuemap>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
-    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
-    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
-   </valuemap>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/nvidia/Desktop/build-Deploy_infer-Desktop-Release</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
-      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
-    </valuemap>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
-    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
-    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
-   </valuemap>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
-    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/nvidia/Desktop/build-Deploy_infer-Desktop-Profile</value>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
-      <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
-      <value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
-     </valuemap>
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
-    </valuemap>
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
-     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
-      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
-      <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
-       <value type="QString">-w</value>
-       <value type="QString">-r</value>
-      </valuelist>
-      <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
-      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
-     </valuemap>
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
-    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
-    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
-    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
-    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
-     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
-    </valuemap>
-    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
-   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
-    <value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
-    <value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
-    <value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
-    <value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
-    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
-    <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
-    <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
-    <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
-    <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
-    <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
-    <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
-    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
-    <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
-    <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
-    <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
-    <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
-     <value type="int">0</value>
-     <value type="int">1</value>
-     <value type="int">2</value>
-     <value type="int">3</value>
-     <value type="int">4</value>
-     <value type="int">5</value>
-     <value type="int">6</value>
-     <value type="int">7</value>
-     <value type="int">8</value>
-     <value type="int">9</value>
-     <value type="int">10</value>
-     <value type="int">11</value>
-     <value type="int">12</value>
-     <value type="int">13</value>
-     <value type="int">14</value>
-    </valuelist>
-    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
-    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy_infer</value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
-    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/nvidia/Desktop/Deploy_infer/Deploy_infer.pro</value>
-    <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">Deploy_infer.pro</value>
-    <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
-    <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/nvidia/Desktop/build-Deploy_infer-Desktop-Debug</value>
-    <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
-    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
-    <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
-    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
-   </valuemap>
-   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
-  </valuemap>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.TargetCount</variable>
-  <value type="int">1</value>
- </data>
- <data>
-  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
-  <value type="int">18</value>
- </data>
- <data>
-  <variable>Version</variable>
-  <value type="int">18</value>
- </data>
-</qtcreator>

+ 0 - 1872
deploy/cpp/docs/jetson-deploy/Deploy_infer/inferthread.cpp

@@ -1,1872 +0,0 @@
-#include "inferthread.h"
-#include <QTimer>
-#include <ctime>
-
-void InferThread::setStopBtn(QPushButton *btn)
-{
-    btnStop = btn;
-}
-
-void InferThread::setInferBtn(QPushButton *btn)
-{
-    btnInfer = btn;
-}
-
-void InferThread::setDetThreshold(float threshold)
-{
-    det_Threshold = threshold;
-}
-
-void InferThread::setInferDelay(int delay)
-{
-    infer_Delay = delay;
-}
-
-uchar *InferThread::get_color_map_list(int num_classes)
-{
-    uchar *color_list = new uchar[num_classes * 3];
-    num_classes += 1;
-    for (int i = 1; i < num_classes; i++)
-    {
-        int j = 0;
-        int lab = i;
-        while (lab != 0)
-        {
-            color_list[(i-1) * 3] |= (uchar)(((lab >> 0) & 1) << (7 - j));
-            color_list[(i-1) * 3 + 1] |= (uchar)(((lab >> 1) & 1) << (7 - j));
-            color_list[(i-1) * 3 + 2] |= (uchar)(((lab >> 2) & 1) << (7 - j));
-
-            j += 1;
-            lab >>= 3;
-        }
-    }
-    return color_list;
-}
-
-InferThread::InferThread(QObject *parent) : QThread(parent)
-{
-    doing_Infer = false;
-    break_Infer = false;
-    dataLoaded = false;  // false: Unloaded data
-    color_map = get_color_map_list();
-
-    model_Type = "det";
-    image_path = "";
-    images_path = QStringList();
-    video_path = "";
-
-    label1_image = nullptr;
-    label2_image = nullptr;
-
-    image1 = nullptr;
-    image2 = nullptr;
-}
-
-void InferThread::setModelType(QString &model_type)
-{
-    if (model_type=="det") // Check whether the type is met, otherwise set ""
-    {
-        model_Type = model_type;
-        return;
-    }
-    else if (model_type=="seg")
-    {
-        model_Type = model_type;
-        return;
-    }
-    else if (model_type=="clas")
-    {
-        model_Type = model_type;
-        return;
-    }
-    else if (model_type=="mask")
-    {
-        model_Type = model_type;
-        return;
-    }
-    else
-    {
-        // set empty
-        model_Type = "";
-    }
-}
-
-void InferThread::setInputImage(QString &image_path)
-{
-    this->image_path = image_path;
-    this->images_path = QStringList();
-    this->video_path = "";
-
-    dataLoaded = true;
-}
-
-void InferThread::setInputImages(QStringList &images_path)
-{
-    this->images_path = images_path;
-    this->image_path = "";
-    this->video_path = "";
-
-    dataLoaded = true;
-}
-
-void InferThread::setInputVideo(QString &video_path)
-{
-    this->video_path = video_path;
-    this->image_path = "";
-    this->images_path = QStringList();
-
-    dataLoaded = true;
-}
-
-void InferThread::setInferFuncs(Det_ModelPredict det_Inferfunc, Seg_ModelPredict seg_Inferfunc, Cls_ModelPredict cls_Inferfunc, Mask_ModelPredict mask_Inferfunc)
-{
-    det_ModelPredict = det_Inferfunc;
-    seg_ModelPredict = seg_Inferfunc;
-    cls_ModelPredict = cls_Inferfunc;
-    mask_ModelPredict = mask_Inferfunc;
-}
-
-void InferThread::runInferDet()
-{
-    if (doing_Infer == false)
-    {
-        if (is_InferImage())
-        {
-            Det_Image();
-        }
-        else if (is_InferImages())
-        {
-            Det_Images();
-        }
-        else if (is_InferVideo())
-        {
-            Det_Video();
-        }
-    }
-    else
-    {
-        // TODO
-    }
-}
-
-void InferThread::runInferSeg()
-{
-    if (doing_Infer == false)
-    {
-        if (is_InferImage())
-        {
-            Seg_Image();
-        }
-        else if (is_InferImages())
-        {
-            Seg_Images();
-        }
-        else if (is_InferVideo())
-        {
-            Seg_Video();
-        }
-    }
-    else
-    {
-        // TODO
-    }
-}
-
-void InferThread::runInferCls()
-{
-    if (doing_Infer == false)
-    {
-        if (is_InferImage())
-        {
-            Cls_Image();
-        }
-        else if (is_InferImages())
-        {
-            Cls_Images();
-        }
-        else if (is_InferVideo())
-        {
-            Cls_Video();
-        }
-    }
-    else
-    {
-        // TODO
-    }
-}
-
-void InferThread::runInferMask()
-{
-    if (doing_Infer == false)
-    {
-        if (is_InferImage())
-        {
-            Mask_Image();
-        }
-        else if (is_InferImages())
-        {
-            Mask_Images();
-        }
-        else if (is_InferVideo())
-        {
-            Mask_Video();
-        }
-    }
-    else
-    {
-        // TODO
-    }
-}
-
-// The thread actually runs the configuration
-void InferThread::run()
-{
-    if (model_Type == "det")
-    {
-        runInferDet();
-    }
-    else if (model_Type == "seg")
-    {
-        runInferSeg();
-    }
-    else if (model_Type == "clas")
-    {
-        runInferCls();
-    }
-    else if (model_Type == "mask")
-    {
-        runInferMask();
-    }
-
-}
-
-bool InferThread::is_InferImage()
-{
-    if (image_path.isEmpty()) return false;
-    else return true;
-}
-
-bool InferThread::is_InferImages()
-{
-    if (images_path.isEmpty()) return false;
-    else return true;
-}
-
-bool InferThread::is_InferVideo()
-{
-    if (video_path.isEmpty()) return false;
-    else return true;
-}
-
-QString InferThread::makeLabelInfo(QString label, int id, float score)
-{
-    QString describe_str = QString::number(id) + ":";
-    describe_str += label + "-";
-    describe_str += QString::number(score);
-
-    return describe_str;
-}
-
-void InferThread::Det_Image()
-{
-    // Read the picture
-    Mat image = imread(image_path.toLocal8Bit().toStdString());  //BGR
-
-    if (image.cols > 512 || image.rows > 512)
-    {
-        float ratio = min(image.cols, image.rows) / 512.;
-        int new_h = image.cols / ratio;
-        int new_w = image.rows / ratio;
-
-        cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4)); // Make sure pixMap displays properly - cut to scale images
-    }
-
-    // Predict output result
-    float bboxs[600];
-    int bbox_num[1];
-    char labellist[1000];
-
-    // Set the start reasoning state
-    doing_Infer = true;
-    try {
-        clock_t start_infer_time = clock();
-        // Perform reasoning and get results
-        qDebug() << "Doing Det-Infer." << "\n";
-        det_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, bboxs, bbox_num, labellist);
-        double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-        emit SetCostTime(cost_time);
-    } catch (QException &e) {
-        // Set the end reasoning state
-        doing_Infer = false;
-        qDebug() << "Finished Det-Infer, but it is raise a exception." << "\n";
-
-        emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-//    btnStop->setEnabled(false);  // When reasoning is complete, close the button of reasoning interruption to prevent late point
-//    btnInfer->setEnabled(true);  // When the reasoning is complete, the button for the execution of the reasoning is opened to allow the reasoning again
-        return;
-    }
-
-    // Post-processing
-    cvtColor(image, image, COLOR_BGR2RGB);
-    if (image1 == nullptr)
-    {
-        image1 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image1;
-        image1 = new Mat(image.clone());
-    }
-    if (label1_image == nullptr)
-    {
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label1_image;
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-
-    QString labels(labellist);
-    QStringList label_list = labels.split(' ');  // Get Label
-    for (int i = 0; i < bbox_num[0]; i++)
-    {
-        int categry_id = (int)bboxs[i*6];
-        float score = bboxs[i*6 + 1];
-        int left_topx = (int)bboxs[i*6 + 2];
-        int left_topy = (int)bboxs[i*6 + 3];
-        int right_downx = left_topx + (int)bboxs[i*6 + 4];  // Parameters 4 and 5 are width and height, but the same DLL using c# is the lower right vertex
-        int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-        if (score >= det_Threshold)
-        {
-            int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                              (int)(color_map[(categry_id % 256) * 3 + 1]),
-                              (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-            QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-            int baseline[1];
-            auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                              1.0, 2, baseline);
-            int text_left_downx = left_topx; // Small offset adjustment: (int)(text_size.Width/10)
-            int text_left_downy = left_topy + text_size.height;
-
-            rectangle(image, Point(left_topx, left_topy),
-                      Point(right_downx, right_downy),
-                      Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                    FONT_HERSHEY_SIMPLEX, 1.0,
-                    Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-        }
-    }
-
-    if (image2 == nullptr)
-    {
-        image2 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image2;
-        image2 = new Mat(image.clone());
-    }
-    if (label2_image == nullptr)
-    {
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label2_image;
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-
-    emit InferFinished(label1_image, label2_image);
-
-    // Set the end reasoning state
-    doing_Infer = false;
-    qDebug() << "Finished Det-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-//    btnStop->setEnabled(false);
-//    btnInfer->setEnabled(true);
-}
-
-void InferThread::Det_Images()
-{
-    doing_Infer = true;
-
-    for (int j = 0; j < images_path.count(); j++)
-    {
-        if (break_Infer) // Exit continuous detection
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Det-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-            return;
-        }
-
-        QString img_file = images_path[j]; // Get image path
-        Mat image = imread(img_file.toLocal8Bit().toStdString());  // Help with Chinese paths
-
-        if (image.cols > 512 || image.rows > 512)
-        {
-            float ratio = min(image.cols, image.rows) / 512.;
-            int new_h = image.cols / ratio;
-            int new_w = image.rows / ratio;
-
-            cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        float bboxs[600];
-        int bbox_num[1];
-        char labellist[1000];
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Det-Infer." << "\n";
-            det_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, bboxs, bbox_num, labellist);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Det-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-            return;
-        }
-
-        cvtColor(image, image, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(image.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        QString labels(labellist);
-        QStringList label_list = labels.split(' ');
-        for (int i = 0; i < bbox_num[0]; i++)
-        {
-            int categry_id = (int)bboxs[i*6];
-            float score = bboxs[i*6 + 1];
-            int left_topx = (int)bboxs[i*6 + 2];
-            int left_topy = (int)bboxs[i*6 + 3];
-            int right_downx = left_topx + (int)bboxs[i*6 + 4];
-            int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-            if (score >= det_Threshold)
-            {
-                int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 1]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-                QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-                int baseline[1];
-                auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                                  1.0, 2, baseline);
-                int text_left_downx = left_topx;
-                int text_left_downy = left_topy + text_size.height;
-
-                rectangle(image, Point(left_topx, left_topy),
-                          Point(right_downx, right_downy),
-                          Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-                putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                        FONT_HERSHEY_SIMPLEX, 1.0,
-                        Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            }
-        }
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(image.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        this->msleep(infer_Delay); // Thread sleep wait
-    }
-
-    doing_Infer = false;
-    qDebug() << "Finished Det-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-}
-
-void InferThread::Det_Video()
-{
-    doing_Infer = true;
-
-    VideoCapture cap = VideoCapture(video_path.toLocal8Bit().toStdString());
-    if(!cap.isOpened()) return; // Return if the video does not open properly
-
-    Mat frame;
-    cap >> frame;
-    while(!frame.empty()) // Exit the loop if a frame is empty
-    {
-        if (frame.cols > 512 || frame.rows > 512)
-        {
-            float ratio = min(frame.cols, frame.rows) / 512.;
-            int new_h = frame.cols / ratio;
-            int new_w = frame.rows / ratio;
-
-            cv::resize(frame, frame, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Det-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-            return;
-        }
-
-        float bboxs[600];
-        int bbox_num[1];
-        char labellist[1000];
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Det-Infer." << "\n";
-            det_ModelPredict((const uchar*)frame.data, frame.cols, frame.rows, 3, bboxs, bbox_num, labellist);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Det-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        cvtColor(frame, frame, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(frame.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        QString labels(labellist);
-        QStringList label_list = labels.split(' ');
-        for (int i = 0; i < bbox_num[0]; i++)
-        {
-            int categry_id = (int)bboxs[i*6];
-            float score = bboxs[i*6 + 1];
-            int left_topx = (int)bboxs[i*6 + 2];
-            int left_topy = (int)bboxs[i*6 + 3];
-            int right_downx = left_topx + (int)bboxs[i*6 + 4];
-            int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-            if (score >= det_Threshold)
-            {
-                int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 1]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-                QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-                int baseline[1];
-                auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                                  1.0, 2, baseline);
-                int text_left_downx = left_topx;
-                int text_left_downy = left_topy + text_size.height;
-
-                rectangle(frame, Point(left_topx, left_topy),
-                          Point(right_downx, right_downy),
-                          Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-                putText(frame, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                        FONT_HERSHEY_SIMPLEX, 1.0,
-                        Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            }
-        }
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(frame.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        cap >> frame;
-    }
-
-    doing_Infer = false;
-    qDebug() << "Finished Det-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-}
-
-void InferThread::Seg_Image()
-{
-    Mat image = imread(image_path.toLocal8Bit().toStdString());  //BGR
-
-    if (image.cols > 512 || image.rows > 512)
-    {
-        float ratio = min(image.cols, image.rows) / 512.;
-        int new_h = image.cols / ratio;
-        int new_w = image.rows / ratio;
-
-        cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-    }
-
-    // Predict output result
-    unsigned char out_image[image.cols * image.rows];
-
-    doing_Infer = true;
-    try {
-        clock_t start_infer_time = clock();
-
-        qDebug() << "Doing Seg-Infer." << "\n";
-        seg_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, out_image);
-        double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-        emit SetCostTime(cost_time);
-    } catch (QException &e) {
-
-        doing_Infer = false;
-        qDebug() << "Finished Seg-Infer, but it is raise a exception." << "\n";
-
-        emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-        return;
-    }
-
-    // Generate the mask three-channel image
-    Mat out3c_image = Mat(image.clone());
-    for (int i = 0; i < out3c_image.rows; i++)   // height
-    {
-        for (int j = 0; j < out3c_image.cols; j++)  // width
-        {
-            int indexSrc = i*out3c_image.cols + j;
-
-            unsigned char color_id = (int)out_image[indexSrc] % 256; // Pixel category ID
-
-            if (color_id == 0)
-                out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-            else
-                out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-        }
-    }
-
-    cvtColor(image, image, COLOR_BGR2RGB);
-    if (image1 == nullptr)
-    {
-        image1 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image1;
-        image1 = new Mat(image.clone());
-    }
-    if (label1_image == nullptr)
-    {
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label1_image;
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-
-    // merge images
-    addWeighted(image, 0.5, out3c_image, 0.5, 0, image);
-
-    if (image2 == nullptr)
-    {
-        image2 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image2;
-        image2 = new Mat(image.clone());
-    }
-    if (label2_image == nullptr)
-    {
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label2_image;
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-
-    emit InferFinished(label1_image, label2_image);
-
-    doing_Infer = false;
-    qDebug() << "Finished Seg-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Seg_Images()
-{
-
-    doing_Infer = true;
-
-    for (int j = 0; j < images_path.count(); j++)
-    {
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Seg-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        QString img_file = images_path[j];
-        Mat image = imread(img_file.toLocal8Bit().toStdString());
-
-        if (image.cols > 512 || image.rows > 512)
-        {
-            float ratio = min(image.cols, image.rows) / 512.;
-            int new_h = image.cols / ratio;
-            int new_w = image.rows / ratio;
-
-            cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        unsigned char out_image[image.cols * image.rows];
-        memset(out_image, 0, sizeof (out_image));
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing --Seg Infer." << "\n";
-            seg_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, out_image);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Seg-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        Mat out3c_image = Mat(image.clone());
-        for (int i = 0; i < out3c_image.rows; i++)   // height
-        {
-            for (int j = 0; j < out3c_image.cols; j++)  // width
-            {
-                int indexSrc = i*out3c_image.cols + j;
-
-                unsigned char color_id = (int)out_image[indexSrc] % 256;
-
-                if (color_id == 0)
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-                else
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-            }
-        }
-
-
-        cvtColor(image, image, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(image.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-
-        addWeighted(image, 0.5, out3c_image, 0.5, 0, image);
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(image.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        this->msleep(infer_Delay);
-    }
-
-
-    doing_Infer = false;
-    qDebug() << "Finished Seg-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Seg_Video()
-{
-
-    doing_Infer = true;
-
-    VideoCapture cap = VideoCapture(video_path.toLocal8Bit().toStdString());
-    if(!cap.isOpened()) return;
-
-    Mat frame;
-    cap >> frame;
-    while(!frame.empty())
-    {
-        if (frame.cols > 512 || frame.rows > 512)
-        {
-            float ratio = min(frame.cols, frame.rows) / 512.;
-            int new_h = frame.cols / ratio;
-            int new_w = frame.rows / ratio;
-
-            cv::resize(frame, frame, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Seg-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        unsigned char out_image[frame.cols * frame.rows];
-        memset(out_image, 0, sizeof (out_image));
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Seg-Infer." << "\n";
-            seg_ModelPredict((const uchar*)frame.data, frame.cols, frame.rows, 3, out_image);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Seg-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        Mat out3c_image = Mat(frame.clone());
-        for (int i = 0; i < out3c_image.rows; i++)   // height
-        {
-            for (int j = 0; j < out3c_image.cols; j++)  // width
-            {
-                int indexSrc = i*out3c_image.cols + j;
-
-                unsigned char color_id = (int)out_image[indexSrc] % 256;
-
-                if (color_id == 0)
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-                else
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-            }
-        }
-
-
-        cvtColor(frame, frame, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(frame.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-
-        addWeighted(frame, 0.5, out3c_image, 0.5, 0, frame);
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(frame.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        cap >> frame;
-    }
-
-
-    doing_Infer = false;
-    qDebug() << "Finished Seg-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Cls_Image()
-{
-
-    Mat image = imread(image_path.toLocal8Bit().toStdString());  //BGR
-
-    if (image.cols > 512 || image.rows > 512)
-    {
-        float ratio = min(image.cols, image.rows) / 512.;
-        int new_h = image.cols / ratio;
-        int new_w = image.rows / ratio;
-
-        cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-    }
-
-    // Predict output result
-    float pre_score[1];
-    int pre_category_id[1];
-    char pre_category[200];
-
-    doing_Infer = true;
-    try {
-        clock_t start_infer_time = clock();
-
-        qDebug() << "Doing Clas-Infer." << "\n";
-        cls_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, pre_score, pre_category, pre_category_id);
-        double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-        emit SetCostTime(cost_time);
-    } catch (QException &e) {
-
-        doing_Infer = false;
-        qDebug() << "Finished Clas-Infer, but it is raise a exception." << "\n";
-
-        emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-        return;
-    }
-
-
-    cvtColor(image, image, COLOR_BGR2RGB);
-
-    float ratio = min(image.cols, image.rows) / 512.;
-    int new_h = image.cols / ratio;
-    int new_w = image.rows / ratio;
-    cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-
-    if (image1 == nullptr)
-    {
-        image1 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image1;
-        image1 = new Mat(image.clone());
-    }
-    if (label1_image == nullptr)
-    {
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label1_image;
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-
-    int color_[3] = { (int)(color_map[(pre_category_id[0] % 256) * 3]),
-                      (int)(color_map[(pre_category_id[0] % 256) * 3 + 1]),
-                      (int)(color_map[(pre_category_id[0] % 256) * 3 + 2]) };
-
-    QString disscribe_str = makeLabelInfo(QString(pre_category), pre_category_id[0], pre_score[0]);
-    int baseline[1];
-    auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                      1.0, 2, baseline);
-    int text_left_downx = 0;
-    int text_left_downy = 0 + text_size.height;
-
-    putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-            FONT_HERSHEY_SIMPLEX, 1.0,
-            Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-
-
-    if (image2 == nullptr)
-    {
-        image2 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image2;
-        image2 = new Mat(image.clone());
-    }
-    if (label2_image == nullptr)
-    {
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label2_image;
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-
-    emit InferFinished(label1_image, label2_image);
-
-    doing_Infer = false;
-    qDebug() << "Finished Clas-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Cls_Images()
-{
-
-    doing_Infer = true;
-
-    for (int j = 0; j < images_path.count(); j++)
-    {
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Clas-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        QString img_file = images_path[j];
-        Mat image = imread(img_file.toLocal8Bit().toStdString());
-
-        if (image.cols > 512 || image.rows > 512)
-        {
-            float ratio = min(image.cols, image.rows) / 512.;
-            int new_h = image.cols / ratio;
-            int new_w = image.rows / ratio;
-
-            cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-
-        float pre_score[1];
-        int pre_category_id[1];
-        char pre_category[200];
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Clas-Infer." << "\n";
-            cls_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, pre_score, pre_category, pre_category_id);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Clas-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        cvtColor(image, image, COLOR_BGR2RGB);
-
-        float ratio = min(image.cols, image.rows) / 512.;
-        int new_h = image.cols / ratio;
-        int new_w = image.rows / ratio;
-        cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(image.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        int color_[3] = { (int)(color_map[(pre_category_id[0] % 256) * 3]),
-                          (int)(color_map[(pre_category_id[0] % 256) * 3 + 1]),
-                          (int)(color_map[(pre_category_id[0] % 256) * 3 + 2]) };
-
-        QString disscribe_str = makeLabelInfo(QString(pre_category), pre_category_id[0], pre_score[0]);
-        int baseline[1];
-        auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                          1.0, 2, baseline);
-        int text_left_downx = 0;
-        int text_left_downy = 0 + text_size.height;
-
-        putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                FONT_HERSHEY_SIMPLEX, 1.0,
-                Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(image.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        this->msleep(infer_Delay);
-    }
-
-
-    doing_Infer = false;
-    qDebug() << "Finished Clas-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Cls_Video()
-{
-
-    doing_Infer = true;
-
-    VideoCapture cap = VideoCapture(video_path.toLocal8Bit().toStdString());
-    if(!cap.isOpened()) return;
-
-    Mat frame;
-    cap >> frame;
-    while(!frame.empty())
-    {
-        if (frame.cols > 512 || frame.rows > 512)
-        {
-            float ratio = min(frame.cols, frame.rows) / 512.;
-            int new_h = frame.cols / ratio;
-            int new_w = frame.rows / ratio;
-
-            cv::resize(frame, frame, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Clas-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        float pre_score[1];
-        int pre_category_id[1];
-        char pre_category[200];
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Clas-Infer." << "\n";
-            cls_ModelPredict((const uchar*)frame.data, frame.cols, frame.rows, 3, pre_score, pre_category, pre_category_id);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Clas-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        cvtColor(frame, frame, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(frame.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        int color_[3] = { (int)(color_map[(pre_category_id[0] % 256) * 3]),
-                          (int)(color_map[(pre_category_id[0] % 256) * 3 + 1]),
-                          (int)(color_map[(pre_category_id[0] % 256) * 3 + 2]) };
-
-        QString disscribe_str = makeLabelInfo(QString(pre_category), pre_category_id[0], pre_score[0]);
-        int baseline[1];
-        auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                          1.0, 2, baseline);
-        int text_left_downx = 0;
-        int text_left_downy = 0 + text_size.height;
-
-        putText(frame, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                FONT_HERSHEY_SIMPLEX, 1.0,
-                Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(frame.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        cap >> frame;
-    }
-
-
-    doing_Infer = false;
-    qDebug() << "Finished Clas-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Mask_Image()
-{
-
-    Mat image = imread(image_path.toLocal8Bit().toStdString());  //BGR
-
-    if (image.cols > 512 || image.rows > 512)
-    {
-        float ratio = min(image.cols, image.rows) / 512.;
-        int new_h = image.cols / ratio;
-        int new_w = image.rows / ratio;
-
-        cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-    }
-
-    // Predict output result
-    float bboxs[600];
-    int bbox_num[1];
-    char labellist[1000];
-    unsigned char out_image[image.cols * image.rows];
-
-    doing_Infer = true;
-    try {
-        clock_t start_infer_time = clock();
-
-        qDebug() << "Doing Mask-Infer." << "\n";
-        mask_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, bboxs, out_image, bbox_num, labellist);
-        double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-        emit SetCostTime(cost_time);
-    } catch (QException &e) {
-
-        doing_Infer = false;
-        qDebug() << "Finished Mask-Infer, but it is raise a exception." << "\n";
-
-        emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-        return;
-    }
-
-    Mat out3c_image = Mat(image.clone());
-    for (int i = 0; i < out3c_image.rows; i++)   // height
-    {
-        for (int j = 0; j < out3c_image.cols; j++)  // width
-        {
-            int indexSrc = i*out3c_image.cols + j;
-
-            unsigned char color_id = (int)out_image[indexSrc] % 256;
-
-            if (color_id == 0)
-                out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-            else
-                out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-        }
-    }
-
-
-    cvtColor(image, image, COLOR_BGR2RGB);
-    if (image1 == nullptr)
-    {
-        image1 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image1;
-        image1 = new Mat(image.clone());
-    }
-    if (label1_image == nullptr)
-    {
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label1_image;
-        label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                  image1->step, QImage::Format_RGB888);
-    }
-
-
-    addWeighted(image, 0.5, out3c_image, 0.5, 0, image);
-
-    QString labels(labellist);
-    QStringList label_list = labels.split(' ');  // Get Label
-    for (int i = 0; i < bbox_num[0]; i++)
-    {
-        int categry_id = (int)bboxs[i*6];
-        float score = bboxs[i*6 + 1];
-        int left_topx = (int)bboxs[i*6 + 2];
-        int left_topy = (int)bboxs[i*6 + 3];
-        int right_downx = left_topx + (int)bboxs[i*6 + 4];
-        int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-        if (score >= det_Threshold)
-        {
-            int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                              (int)(color_map[(categry_id % 256) * 3 + 1]),
-                              (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-            QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-            int baseline[1];
-            auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                              1.0, 2, baseline);
-            int text_left_downx = left_topx;
-            int text_left_downy = left_topy + text_size.height;
-
-            rectangle(image, Point(left_topx, left_topy),
-                      Point(right_downx, right_downy),
-                      Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                    FONT_HERSHEY_SIMPLEX, 1.0,
-                    Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-        }
-    }
-
-    if (image2 == nullptr)
-    {
-        image2 = new Mat(image.clone());
-    }
-    else
-    {
-        delete image2;
-        image2 = new Mat(image.clone());
-    }
-    if (label2_image == nullptr)
-    {
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-    else
-    {
-        delete label2_image;
-        label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                  image2->step, QImage::Format_RGB888);
-    }
-
-    emit InferFinished(label1_image, label2_image);
-
-
-    doing_Infer = false;
-    qDebug() << "Finished Mask-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Mask_Images()
-{
-
-    doing_Infer = true;
-
-    for (int j = 0; j < images_path.count(); j++)
-    {
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Mask-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        QString img_file = images_path[j];
-        Mat image = imread(img_file.toLocal8Bit().toStdString());
-
-        if (image.cols > 512 || image.rows > 512)
-        {
-            float ratio = min(image.cols, image.rows) / 512.;
-            int new_h = image.cols / ratio;
-            int new_w = image.rows / ratio;
-
-            cv::resize(image, image, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        float bboxs[600];
-        int bbox_num[1];
-        char labellist[1000];
-        unsigned char out_image[image.cols * image.rows];
-        memset(out_image, 0, sizeof (out_image));
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Mask-Infer." << "\n";
-            mask_ModelPredict((const uchar*)image.data, image.cols, image.rows, 3, bboxs, out_image, bbox_num, labellist);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Mask-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        Mat out3c_image = Mat(image.clone());
-        for (int i = 0; i < out3c_image.rows; i++)   // height
-        {
-            for (int j = 0; j < out3c_image.cols; j++)  // width
-            {
-                int indexSrc = i*out3c_image.cols + j;
-
-                unsigned char color_id = (int)out_image[indexSrc] % 256;
-
-                if (color_id == 0)
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-                else
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-            }
-        }
-
-
-        cvtColor(image, image, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(image.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        addWeighted(image, 0.5, out3c_image, 0.5, 0, image);
-
-        QString labels(labellist);
-        QStringList label_list = labels.split(' ');  // 获取label
-        for (int i = 0; i < bbox_num[0]; i++)
-        {
-            int categry_id = (int)bboxs[i*6];
-            float score = bboxs[i*6 + 1];
-            int left_topx = (int)bboxs[i*6 + 2];
-            int left_topy = (int)bboxs[i*6 + 3];
-            int right_downx = left_topx + (int)bboxs[i*6 + 4];
-            int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-            if (score >= det_Threshold)
-            {
-                int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 1]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-                QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-                int baseline[1];
-                auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                                  1.0, 2, baseline);
-                int text_left_downx = left_topx;
-                int text_left_downy = left_topy + text_size.height;
-
-                rectangle(image, Point(left_topx, left_topy),
-                          Point(right_downx, right_downy),
-                          Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-                putText(image, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                        FONT_HERSHEY_SIMPLEX, 1.0,
-                        Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            }
-        }
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(image.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(image.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        this->msleep(infer_Delay);
-    }
-
-    doing_Infer = false;
-    qDebug() << "Finished Mask-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}
-
-void InferThread::Mask_Video()
-{
-    doing_Infer = true;
-
-    VideoCapture cap = VideoCapture(video_path.toLocal8Bit().toStdString());
-    if(!cap.isOpened()) return;
-
-    Mat frame;
-    cap >> frame;
-    while(!frame.empty())
-    {
-        if (frame.cols > 512 || frame.rows > 512)
-        {
-            float ratio = min(frame.cols, frame.rows) / 512.;
-            int new_h = frame.cols / ratio;
-            int new_w = frame.rows / ratio;
-
-            cv::resize(frame, frame, cv::Size(new_h/4*4,new_w/4*4));
-        }
-
-        if (break_Infer)
-        {
-            doing_Infer = false;
-            break_Infer = false;
-
-            qDebug() << "Mask-Infer has Break." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-
-        float bboxs[600];
-        int bbox_num[1];
-        char labellist[1000];
-        unsigned char out_image[frame.cols * frame.rows];
-        memset(out_image, 0, sizeof (out_image));
-
-        try {
-            clock_t start_infer_time = clock();
-
-            qDebug() << "Doing Mask-Infer." << "\n";
-            mask_ModelPredict((const uchar*)frame.data, frame.cols, frame.rows, 3, bboxs, out_image, bbox_num, labellist);
-            double cost_time = 1000 * (clock() - start_infer_time) / (double)CLOCKS_PER_SEC;
-            emit SetCostTime(cost_time);
-        } catch (QException &e) {
-
-            doing_Infer = false;
-            qDebug() << "Finished Mask-Infer, but it is raise a exception." << "\n";
-
-            emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-            return;
-        }
-
-        Mat out3c_image = Mat(frame.clone());
-        for (int i = 0; i < out3c_image.rows; i++)   // height
-        {
-            for (int j = 0; j < out3c_image.cols; j++)  // width
-            {
-                int indexSrc = i*out3c_image.cols + j;
-
-                unsigned char color_id = (int)out_image[indexSrc] % 256;
-
-                if (color_id == 0)
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(0, 0, 0);
-                else
-                    out3c_image.at<Vec3b>(i, j) = Vec3b(color_map[color_id * 3], color_map[color_id * 3 + 1], color_map[color_id * 3 + 2]);
-            }
-        }
-
-        cvtColor(frame, frame, COLOR_BGR2RGB);
-        if (image1 == nullptr)
-        {
-            image1 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image1;
-            image1 = new Mat(frame.clone());
-        }
-        if (label1_image == nullptr)
-        {
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label1_image;
-            label1_image = new QImage((const uchar*)image1->data, image1->cols, image1->rows,
-                                      image1->step, QImage::Format_RGB888);
-        }
-
-        addWeighted(frame, 0.5, out3c_image, 0.5, 0, frame);
-
-        QString labels(labellist);
-        QStringList label_list = labels.split(' ');
-        for (int i = 0; i < bbox_num[0]; i++)
-        {
-            int categry_id = (int)bboxs[i*6];
-            float score = bboxs[i*6 + 1];
-            int left_topx = (int)bboxs[i*6 + 2];
-            int left_topy = (int)bboxs[i*6 + 3];
-            int right_downx = left_topx + (int)bboxs[i*6 + 4];
-            int right_downy = left_topy + (int)bboxs[i*6 + 5];
-
-            if (score >= det_Threshold)
-            {
-                int color_[3] = { (int)(color_map[(categry_id % 256) * 3]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 1]),
-                                  (int)(color_map[(categry_id % 256) * 3 + 2]) };
-
-                QString disscribe_str = makeLabelInfo(label_list[i], categry_id, score);
-                int baseline[1];
-                auto text_size = getTextSize(disscribe_str.toStdString(), FONT_HERSHEY_SIMPLEX,
-                                  1.0, 2, baseline);
-                int text_left_downx = left_topx;
-                int text_left_downy = left_topy + text_size.height;
-
-                rectangle(frame, Point(left_topx, left_topy),
-                          Point(right_downx, right_downy),
-                          Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-                putText(frame, disscribe_str.toStdString(), Point(text_left_downx, text_left_downy),
-                        FONT_HERSHEY_SIMPLEX, 1.0,
-                        Scalar(color_[0], color_[1], color_[2]), 2, LINE_8);
-            }
-        }
-
-        if (image2 == nullptr)
-        {
-            image2 = new Mat(frame.clone());
-        }
-        else
-        {
-            delete image2;
-            image2 = new Mat(frame.clone());
-        }
-        if (label2_image == nullptr)
-        {
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-        else
-        {
-            delete label2_image;
-            label2_image = new QImage((const uchar*)image2->data, image2->cols, image2->rows,
-                                      image2->step, QImage::Format_RGB888);
-        }
-
-        emit InferFinished(label1_image, label2_image);
-
-        cap >> frame;
-    }
-
-    doing_Infer = false;
-    qDebug() << "Finished Mask-Infer." << "\n";
-
-    emit SetState_Btn_StopAndInfer(false, true);  // first is stop, second is infer
-
-}

+ 0 - 135
deploy/cpp/docs/jetson-deploy/Deploy_infer/inferthread.h

@@ -1,135 +0,0 @@
-#ifndef INFERTHREAD_H
-#define INFERTHREAD_H
-
-#include <QObject>
-#include <QString>
-#include <QException>
-#include <QDebug>
-#include <QPixmap>
-#include <QtWidgets/QPushButton>
-#include <QtWidgets/QLabel>
-#include <QThread>
-
-#include "opencv2/opencv.hpp"
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-using namespace cv;
-
-// Model inference API: det, seg, clas, mask
-typedef void (*Det_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 float* , int* , char* );
-typedef void (*Seg_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 unsigned char* );
-typedef void (*Cls_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 float* , char* , int* );
-typedef void (*Mask_ModelPredict)(const unsigned char* ,
-                                  int , int , int ,
-                                  float* , unsigned char* ,
-                                  int* , char* );
-
-class InferThread : public QThread
-{
-    Q_OBJECT
-private:
-    QString model_Type;
-    uchar *color_map;   // visual color table/map
-
-    QString image_path;
-    QStringList images_path;
-    QString video_path;
-
-public:
-    float det_Threshold;  // Target detection threshold
-    int infer_Delay;    // Continuous inference interval
-
-    bool doing_Infer;  // Sign reasoning
-    bool break_Infer;  // Terminate continuous reasoning/video reasoning
-
-    bool dataLoaded;  // Whether data has been loaded
-
-    QImage* label1_image;
-    QImage* label2_image;
-
-    Mat* image1;
-    Mat* image2;
-
-
-private:
-    // Model inference API
-    Det_ModelPredict det_ModelPredict;
-    Seg_ModelPredict seg_ModelPredict;
-    Cls_ModelPredict cls_ModelPredict;
-    Mask_ModelPredict mask_ModelPredict;
-
-private:
-    // don`t use
-    QPushButton *btnStop;  // Point to the external termination button
-    QPushButton *btnInfer;  // Point to the external reasoning button
-    QLabel *labelImage1;   // Image display area-Label--left
-    QLabel *labelImage2;   // Image display area-Label--right
-
-public:
-    void setStopBtn(QPushButton *btn);
-    void setInferBtn(QPushButton *btn);
-
-    void setDetThreshold(float threshold);
-    void setInferDelay(int delay);
-    uchar* get_color_map_list(int num_classes=256);
-
-public:
-    explicit InferThread(QObject *parent = nullptr);
-    void setModelType(QString & model_type);  // Setting the model type of reasoning - use the correct model reasoning interface
-    void setInputImage(QString & image_path);
-    void setInputImages(QStringList & images_path);
-    void setInputVideo(QString & video_path);
-    void setInferFuncs(Det_ModelPredict det_Inferfunc, Seg_ModelPredict seg_Inferfunc,
-                       Cls_ModelPredict cls_Inferfunc, Mask_ModelPredict mask_Inferfunc);
-    void runInferDet();
-    void runInferSeg();
-    void runInferCls();
-    void runInferMask();
-    void run() override; // Execute this thread
-
-private:
-    bool is_InferImage();
-    bool is_InferImages();
-    bool is_InferVideo();
-    QString makeLabelInfo(QString label, int id, float score);
-
-// Detecting the inference interface
-public:
-    void Det_Image();
-    void Det_Images();
-    void Det_Video();
-
-// Semantic segmentation reasoning interface
-public:
-    void Seg_Image();
-    void Seg_Images();
-    void Seg_Video();
-
-// Classification inference interface
-public:
-    void Cls_Image();
-    void Cls_Images();
-    void Cls_Video();
-
-// Instance split reasoning interface
-public:
-    void Mask_Image();
-    void Mask_Images();
-    void Mask_Video();
-
-signals:
-    void InferFinished(QImage* label1, QImage* label2);
-    void SetState_Btn_StopAndInfer(bool stop_state, bool infer_state);
-    void SetCostTime(double cost_time);
-
-public slots:
-};
-
-#endif // INFERTHREAD_H

+ 0 - 11
deploy/cpp/docs/jetson-deploy/Deploy_infer/main.cpp

@@ -1,11 +0,0 @@
-#include "mainwindow.h"
-#include <QApplication>
-
-int main(int argc, char *argv[])
-{
-    QApplication a(argc, argv);
-    MainWindow w;
-    w.show();
-
-    return a.exec();
-}

+ 0 - 577
deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.cpp

@@ -1,577 +0,0 @@
-#include <QMessageBox>
-#include <QException>
-#include <QFileDialog>
-#include <QPixmap>
-#include <QDebug>
-
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-
-#include "opencv2/opencv.hpp"
-#include "opencv2/core/core.hpp"
-#include "opencv2/highgui/highgui.hpp"
-#include "opencv2/imgproc/imgproc.hpp"
-using namespace cv;
-
-void MainWindow::Init_SystemState()
-{
-    qDebug() << "Now Using Opencv Version: " << CV_VERSION << "\n";
-//    qDebug() << cv::getBuildInformation().c_str() << "\n"; // out build infomation
-
-    has_Init = false;
-    doing_Infer = false;
-    is_paddlex = false;
-    is_mask = false;
-
-    model_Envs[0] = "cpu";
-    model_Envs[1] = "gpu";
-    model_Kinds[0] = "det";
-    model_Kinds[1] = "seg";
-    model_Kinds[2] = "clas";
-    model_Kinds[3] = "mask";
-    model_Kinds[4] = "paddlex";
-
-    model_Env = "cpu";
-    model_Kind = "det";
-    gpu_Id = 0;
-
-    det_threshold = 0.5;
-    infer_Delay = 50;
-
-    ui->cBoxEnv->setCurrentIndex(0); // Initialize the environment to CPU
-    ui->cBoxKind->setCurrentIndex(0); // Initialization type Det
-    ui->labelImage1->setStyleSheet("background-color:white;"); // Set the background to initialize the image display area
-    ui->labelImage2->setStyleSheet("background-color:white;");
-
-    // Dynamic link library startup
-    inferLibrary = new QLibrary("/home/nvidia/Desktop/Deploy_infer/infer_lib/libmodel_infer");
-    if(!inferLibrary->load()){
-        //Loading failed
-        qDebug() << "Load libmodel_infer.so is failed!";
-        qDebug() << inferLibrary->errorString();
-    }
-    else
-    {
-        qDebug() << "Load libmodel_infer.so is OK!";
-    }
-
-    // Export model loading / destruction interface in dynamic library
-    initModel = (InitModel)inferLibrary->resolve("InitModel");
-    destructModel = (DestructModel)inferLibrary->resolve("DestructModel");
-    // Export A model insertion interface in dynamic graph
-    det_ModelPredict = (Det_ModelPredict)inferLibrary->resolve("Det_ModelPredict");
-    seg_ModelPredict = (Seg_ModelPredict)inferLibrary->resolve("Seg_ModelPredict");
-    cls_ModelPredict = (Cls_ModelPredict)inferLibrary->resolve("Cls_ModelPredict");
-    mask_ModelPredict = (Mask_ModelPredict)inferLibrary->resolve("Mask_ModelPredict");
-
-    // Thread initialization - Configures the reasoning function
-    inferThread = new InferThread(this);
-    inferThread->setInferFuncs(det_ModelPredict, seg_ModelPredict, cls_ModelPredict, mask_ModelPredict);
-    inferThread->setStopBtn(ui->btnStop);
-    inferThread->setInferBtn(ui->btnInfer);
-    inferThread->setDetThreshold(det_threshold);
-    inferThread->setInferDelay(infer_Delay);
-
-    // Configure signals and slots
-    connect(inferThread, SIGNAL(InferFinished(QImage*, QImage*)),
-            this, SLOT(ImageUpdate(QImage*, QImage*)),
-            Qt::BlockingQueuedConnection);
-    connect(inferThread, SIGNAL(SetState_Btn_StopAndInfer(bool , bool )),
-            this, SLOT(Btn_StopAndInfer_StateUpdate(bool , bool )),
-            Qt::BlockingQueuedConnection);
-    connect(inferThread, SIGNAL(SetCostTime(double )),
-            this, SLOT(CostTimeUpdate(double )),
-            Qt::BlockingQueuedConnection);
-}
-
-void MainWindow::Init_SystemShow()
-{
-    ui->btnDistory->setEnabled(false);  // There is no initial initialization of the model and the destroy button is invalid
-    ui->btnInfer->setEnabled(false);
-    ui->btnStop->setEnabled(false);
-}
-
-MainWindow::MainWindow(QWidget *parent) :
-    QMainWindow(parent),
-    ui(new Ui::MainWindow)
-{
-    ui->setupUi(this);
-
-    this->Init_SystemState(); // Initialization state at startup
-    this->Init_SystemShow();  // Initialize button state at startup
-}
-
-MainWindow::~MainWindow()
-{
-    // Wait for thread to end
-    if (inferThread->doing_Infer)
-    {
-        inferThread->break_Infer=false;
-        while(inferThread->doing_Infer==true); // Wait for thread to stop
-    }
-    // Destruction of the model
-    if (has_Init == true)
-    {
-        destructModel();
-    }
-    // Unload library
-    inferLibrary->unload();
-
-    delete ui;  // Finally close the screen
-}
-
-// Model initialization
-void MainWindow::on_btnInit_clicked()
-{
-    QString dialog_title = "Load model";
-    QStringList filters = {"*.pdmodel", "*.pdiparams", "*.yml", "*.yaml"};
-    QDir model_dir(QFileDialog::getExistingDirectory(this,
-                                                     dialog_title));
-    QFileInfoList model_files = model_dir.entryInfoList(filters);  // All valid file names obtained by filtering
-
-    switch (model_files.count()) {
-    case 0:
-        return;
-    case 3:  // det,seg,clas--Load
-        for (int i = 0; i < 3; i++)
-        {
-            QString tag = model_files[i].fileName().split('.')[1];
-            if (tag == "pdmodel") model_path = model_files[i].filePath();
-            else if (tag == "pdiparams") param_path = model_files[i].filePath();
-            else if (tag == "yml" || tag == "yaml") config_path = model_files[i].filePath();
-        }
-        break;
-    case 4: // paddlex和mask--Load
-        for (int i = 0; i < 4; i++)
-        {
-            QString tag = model_files[i].fileName().split('.')[1];
-            if (tag == "pdmodel") model_path = model_files[i].filePath();
-            else if (tag == "pdiparams") param_path = model_files[i].filePath();
-            else if (tag == "yml" || tag == "yaml")
-            {
-                if (model_files[i].fileName() == "model.yml" || model_files[i].fileName() == "model.yaml")
-                    config_path = model_files[i].filePath();
-            }
-        }
-        break;
-    default: // Other undefined situations
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Make sure the following files are correctly included in the models folder:\n*.pdmodel, *.pdiparams, *.yml/*.yaml."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-        return;
-    }
-
-    char paddlex_model_type[10]="";
-    try
-    {
-        if (has_Init == true)
-        {
-            destructModel();  // Destroy the model and initialize it
-            if (model_Kind == "paddlex")  // Paddlex model special identification
-            {
-                is_paddlex = true;
-            }
-            if (model_Kind == "mask")  // MASKRCNN from Paddlex
-            {
-                model_Kind = "paddlex";
-                is_mask = true;
-            }
-
-            // input string to char*/[]
-            initModel(model_Kind.toLocal8Bit().data(),
-                      model_path.toLocal8Bit().data(),
-                      param_path.toLocal8Bit().data(),
-                      config_path.toLocal8Bit().data(),
-                      model_Env=="gpu" ? true: false,
-                      gpu_Id, paddlex_model_type);
-
-            if (is_paddlex && is_mask==false)  // Replace the actual type of the Paddlex model
-            {
-                model_Kind = QString::fromLocal8Bit(paddlex_model_type);  // to real type
-                is_paddlex = false;
-            }
-            if (is_paddlex==false && is_mask)  // Revert to MASKRCNN type
-            {
-                model_Kind = "mask";  // to mask type
-                is_mask = false;
-            }
-        }
-        else
-        {
-            if (model_Kind == "paddlex")
-            {
-                is_paddlex = true;
-            }
-            if (model_Kind == "mask")
-            {
-                model_Kind = "paddlex";
-                is_mask = true;
-            }
-
-            // input string to char*/[]
-            initModel(model_Kind.toLocal8Bit().data(),
-                      model_path.toLocal8Bit().data(),
-                      param_path.toLocal8Bit().data(),
-                      config_path.toLocal8Bit().data(),
-                      model_Env=="gpu" ? true: false,
-                      gpu_Id, paddlex_model_type);
-
-            if (is_paddlex && is_mask==false)
-            {
-                model_Kind = QString::fromLocal8Bit(paddlex_model_type);  // to real type
-                is_paddlex = false;
-            }
-            if (is_paddlex==false && is_mask)
-            {
-                model_Kind = "mask";  // to mask type
-                is_mask = false;
-            }
-
-            has_Init = true; // Initialization is complete
-        }
-    }
-    catch (QException &e) // Failed to initialize a message
-    {
-        QMessageBox::information(this,
-            tr("Initialization failed"),
-            tr("1.Please ensure that the model folder correctly contains the following files:\n*.pdmodel, *.pdiparams, *.yml/*.yaml.\n2.Please ensure that the model type is consistent with the loading model."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-
-        if (is_paddlex)  // Paddlex is not initialized, restore type
-        {
-            model_Kind = "paddlex";
-            is_paddlex = false;
-        }
-        if (is_mask)  // Mask is not initialized, restore type
-        {
-            model_Kind = "mask";
-            is_mask = false;
-        }
-
-        return;
-    }
-
-    inferThread->setModelType(model_Kind); // Set the reasoning interface type
-    // Initialization Successful Tips
-    QMessageBox::information(this,
-        tr("Initialization successful"),
-        QString("Model type: ")+model_Kind+QString(", Runtime environment: ")+model_Env+QString("."),
-        QMessageBox::Ok,
-        QMessageBox::Ok);
-    ui->btnInit->setText("模型已初始化");
-
-    ui->btnInfer->setEnabled(true);  // Open reasoning function
-    ui->btnDistory->setEnabled(true); // Open the destruction function
-    ui->cBoxEnv->setEnabled(false);   // Close the choice of running environment
-    ui->cBoxKind->setEnabled(false);   // Turn off the run type selection
-    ui->lEditGpuId->setEnabled(false);  // Disable GPU specification
-}
-
-// Model destruction
-void MainWindow::on_btnDistory_clicked()
-{
-    if (inferThread->doing_Infer)  // Reasoning, it cannot be destroyed, issued a hint
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("The model is being reasoning, can't be destroyed!\n(after reasoning the completion / termination, the model is destroyed."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-        return;
-    }
-
-    if (has_Init == true)
-    {
-        destructModel();
-        has_Init = false;
-
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("The model has been destroyed."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-        ui->btnInit->setText("初始化模型");
-
-        ui->btnInfer->setEnabled(false);
-        ui->btnDistory->setEnabled(false);
-        ui->cBoxEnv->setEnabled(true);
-        ui->cBoxKind->setEnabled(true);
-        ui->lEditGpuId->setEnabled(true);
-    }
-    else
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Not initialized, no need to destroy."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-    }
-}
-
-// Loading pictures
-void MainWindow::on_btnLoadImg_clicked()
-{
-    QString dialog_title = "Loading pictures";
-    QString filters = "Loading pictures(*.jpg *.jpeg *.png *.JPEG);;";
-    QUrl img_path = QFileDialog::getOpenFileUrl(this,
-                                                   dialog_title, QUrl(), filters);
-    if (img_path.isEmpty())
-    {
-        return;
-    }
-
-    img_file = img_path.url().split("//")[1];
-    qDebug() << "Input Video Path:" << img_file << "\n";
-
-    // Picture reading
-    cv::Mat image = cv::imread(img_file.toLocal8Bit().toStdString());  //BGR
-    cv::cvtColor(image, image, COLOR_BGR2RGB);  // BGR --> RGB
-    cv::resize(image, image, cv::Size(image.cols/4*4,image.rows/4*4));
-    QImage image_from_mat((const uchar*)image.data, image.cols, image.rows, QImage::Format_RGB888);
-    QPixmap pixmap(QPixmap::fromImage(image_from_mat));
-
-    // Display images
-    ui->labelImage1->setPixmap(pixmap);
-    ui->labelImage1->setScaledContents(true);  // Full Label
-
-    inferThread->setInputImage(img_file);  // Introduced into the reasoning data
-    img_files = QStringList();
-    video_file = "";
-
-    ui->btnLoadImg->setText("图片已加载");
-    ui->btnLoadImgs->setText("加载文件夹");
-    ui->btnLoadVideo->setText("加载视频");
-}
-
-// Loading images folder
-void MainWindow::on_btnLoadImgs_clicked()
-{
-    QString dialog_title = "Loading images folder";
-    QStringList filters = {"*.jpg", "*.jpeg", "*.png", "*.JPEG"};
-    QDir img_dir(QFileDialog::getExistingDirectory(this,
-                                                     dialog_title));
-    QFileInfoList img_paths = img_dir.entryInfoList(filters);
-
-    if (img_paths.isEmpty())
-    {
-        return;
-    }
-
-    img_files.clear();
-    for (int i = 0; i < img_paths.count(); i++)
-    {
-        img_files.append(img_paths[i].filePath());
-    }
-
-    qDebug() << img_files[0] << "\n";
-
-    // Display the first image
-    cv::Mat image = cv::imread(img_files[0].toLocal8Bit().toStdString());  //BGR
-    cv::cvtColor(image, image, COLOR_BGR2RGB);  // BGR --> RGB
-    cv::resize(image, image, cv::Size(image.cols/4*4,image.rows/4*4));
-    QImage image_from_mat((const uchar*)image.data, image.cols, image.rows, QImage::Format_RGB888);
-    QPixmap pixmap(QPixmap::fromImage(image_from_mat));
-
-
-    ui->labelImage1->setPixmap(pixmap);
-    ui->labelImage1->setScaledContents(true);
-
-    inferThread->setInputImages(img_files);
-    img_file = "";
-    video_file = "";
-
-    ui->btnLoadImg->setText("加载图片");
-    ui->btnLoadImgs->setText("文件夹已加载");
-    ui->btnLoadVideo->setText("加载视频");
-}
-
-// Load the video stream
-void MainWindow::on_btnLoadVideo_clicked()
-{
-    QString dialog_title = "Load video stream";
-    QString filters = "video(*.mp4 *.MP4);;";
-    QUrl video_path = QFileDialog::getOpenFileUrl(this,
-                                                   dialog_title, QUrl(), filters);
-    if (video_path.isEmpty())
-    {
-        return;
-    }
-
-    video_file = video_path.url().split("//")[1];
-    qDebug() << "Input Video Path:" << video_file.toStdString().c_str() << "\n";
-
-    // Display the first image of the video
-    VideoCapture capture;
-    Mat frame;
-    capture.open(video_file.toLocal8Bit().toStdString()); // Read video
-    if(!capture.isOpened())
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("1.Video read failed, please check if the video is complete, is it MP4.\n2.(Maybe)Opencv doesn't support the video!"),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-        return;
-    }
-    capture >> frame;  // Get the first frame
-    cvtColor(frame, frame, COLOR_BGR2RGB);  // BGR --> RGB
-    QImage image((const uchar*)frame.data, frame.cols, frame.rows, QImage::Format_RGB888);
-    ui->labelImage1->setPixmap(QPixmap::fromImage(image));
-    ui->labelImage1->setScaledContents(true);
-    capture.release();
-
-    inferThread->setInputVideo(video_file);
-    img_file = "";
-    img_files = QStringList();
-
-    ui->btnLoadImg->setText("加载图片");
-    ui->btnLoadImgs->setText("加载文件夹");
-    ui->btnLoadVideo->setText("视频已加载");
-}
-
-// Model reasoning - multiple threads
-void MainWindow::on_btnInfer_clicked()
-{
-    if (inferThread->dataLoaded != true)  // Data is not loaded
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Please load the data, then reinforce."),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-        return;
-    }
-    if (has_Init == true && inferThread->doing_Infer == false)
-    {
-        ui->btnStop->setEnabled(true);     // Stop button start
-        ui->btnInfer->setEnabled(false);     // Inference button off
-
-        // Perform the corresponding type of reasoning
-        inferThread->start();
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Model reasoning"),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-    }
-}
-
-// Reasoning to terminate
-void MainWindow::on_btnStop_clicked()
-{
-    if (inferThread->doing_Infer == true)
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Stop model reasoning"),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-
-        inferThread->break_Infer = true;  // Termination Reasoning -> Auto Go to doing_Infer==false
-    }
-    else
-    {
-        QMessageBox::information(this,
-            tr("Prompt"),
-            tr("Not reasoning, no need to terminate the model reasoning"),
-            QMessageBox::Ok,
-            QMessageBox::Ok);
-    }
-}
-
-// Select the model running environment
-void MainWindow::on_cBoxEnv_currentIndexChanged(int index)
-{
-    if (has_Init) // Has been initialized, this operation is invalid
-    {
-        ui->cBoxEnv->setCurrentIndex(old_model_Env);
-        return;
-    }
-    model_Env = model_Envs[index];
-    old_model_Env = index;  // Retain this result
-}
-
-// Set the model type
-void MainWindow::on_cBoxKind_currentIndexChanged(int index)
-{
-    if (has_Init) // Has been initialized, this operation is invalid
-    {
-        ui->cBoxKind->setCurrentIndex(old_model_Kind);
-        return;
-    }
-    model_Kind = model_Kinds[index];
-    old_model_Kind = index;
-}
-
-// Set detection threshold
-void MainWindow::on_sBoxThreshold_valueChanged(double arg1)
-{
-    if (inferThread->doing_Infer)
-    {
-        ui->sBoxThreshold->setValue(old_det_threshold);
-        return;
-    }
-    det_threshold = (float)arg1;
-    inferThread->setDetThreshold(det_threshold);
-
-    old_det_threshold = det_threshold;
-}
-
-// set gpu_id
-void MainWindow::on_lEditGpuId_textChanged(const QString &arg1)
-{
-    if (has_Init) // Has been initialized, this operation is invalid
-    {
-        ui->lEditGpuId->setText(QString::number(old_gpu_Id));
-        return;
-    }
-    gpu_Id = arg1.toInt(); // If you enter a normal number, resolve to the specified number; otherwise 0
-    old_gpu_Id = gpu_Id;
-}
-
-// Continuous reasoning interval duration setting
-void MainWindow::on_sBoxDelay_valueChanged(const QString &arg1)
-{
-    if (inferThread->doing_Infer)
-    {
-        ui->sBoxDelay->setValue(old_infer_Delay);
-        return;
-    }
-    infer_Delay = arg1.toInt(); // If you enter a normal number, resolve to the specified number; otherwise 0
-    inferThread->setInferDelay(infer_Delay);
-
-    old_infer_Delay = infer_Delay;
-}
-
-
-/*  slot funcs blob  */
-// update image show
-void MainWindow::ImageUpdate(QImage* label1, QImage* label2)
-{
-    if (inferThread->doing_Infer)
-    {
-        ui->labelImage1->clear();
-        ui->labelImage1->setPixmap(QPixmap::fromImage(*label1));
-        ui->labelImage1->setScaledContents(true); // Full Label
-
-        ui->labelImage2->clear();
-        ui->labelImage2->setPixmap(QPixmap::fromImage(*label2));
-        ui->labelImage2->setScaledContents(true); // Full Label
-    }
-}
-
-// update btn Enable_state
-void MainWindow::Btn_StopAndInfer_StateUpdate(bool stop_state, bool infer_state)
-{
-    ui->btnStop->setEnabled(stop_state);
-    ui->btnInfer->setEnabled(infer_state);
-}
-
-// update label value to show cost time
-void MainWindow::CostTimeUpdate(double cost_time)
-{
-    ui->labelCostTime->setText(QString::number(cost_time));
-}

+ 0 - 126
deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.h

@@ -1,126 +0,0 @@
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QMainWindow>
-#include <QString>
-#include <QLibrary>
-
-#include "inferthread.h"
-
-// Model initialization and destruction API
-typedef void (*InitModel)(const char*,
-                          const char*,
-                          const char*,
-                          const char*,
-                          bool , int , char* );
-typedef void (*DestructModel)();
-// Model reasoning API: det, seg, clas, mask
-typedef void (*Det_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 float* , int* , char* );
-typedef void (*Seg_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 unsigned char* );
-typedef void (*Cls_ModelPredict)(const unsigned char* ,
-                                 int , int , int ,
-                                 float* , char* , int* );
-typedef void (*Mask_ModelPredict)(const unsigned char* ,
-                                  int , int , int ,
-                                  float* , unsigned char* ,
-                                  int* , char* );
-
-namespace Ui {
-class MainWindow;
-}
-
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-private: // Some logo or data storage variables
-    bool has_Init;  // Whether it is initialized
-    bool doing_Infer; // Whether it is in reason
-    QString model_Envs[2]; // Running environment collection
-    QString model_Kinds[5]; // Model type collection
-    bool is_paddlex;  // Special record PADDLEX model
-    bool is_mask;     // Specially recorded Mask model under Paddlex
-    QString model_Env;  // Current operating environment
-    int old_model_Env; // Last run environment
-    QString model_Kind; // Current model type
-    int old_model_Kind; // The last model type
-    int gpu_Id;  // Current GPU_ID
-    int old_gpu_Id;  // Last GPU_ID
-
-    float det_threshold; // Target detection detection threshold
-    float old_det_threshold; // The detection threshold of the last target detection
-    int infer_Delay; // Continuous reasoning interval
-    int old_infer_Delay; // The last continuous reasoning interval
-
-    // Model file path
-    QString model_path;
-    QString param_path;
-    QString config_path;
-
-    // Inferential data path
-    QString img_file;
-    QStringList img_files;
-    QString video_file;
-
-    // Link pointer to a dynamic library
-    QLibrary *inferLibrary;
-    // Model initialization and destruction API
-    InitModel initModel;
-    DestructModel destructModel;
-    // Model reasoning API
-    Det_ModelPredict det_ModelPredict;
-    Seg_ModelPredict seg_ModelPredict;
-    Cls_ModelPredict cls_ModelPredict;
-    Mask_ModelPredict mask_ModelPredict;
-
-private:
-    InferThread *inferThread;
-
-public: // Some basic methods
-    void Init_SystemState();  // Initialize state and data variables
-    void Init_SystemShow();  // Initialize the state of the visual key: enable and disable
-
-public:
-    explicit MainWindow(QWidget *parent = 0);
-    ~MainWindow();
-
-private slots:
-    void on_btnInit_clicked();
-
-    void on_btnDistory_clicked();
-
-    void on_btnLoadImg_clicked();
-
-    void on_btnLoadImgs_clicked();
-
-    void on_btnLoadVideo_clicked();
-
-    void on_btnInfer_clicked();
-
-    void on_btnStop_clicked();
-
-    void on_cBoxEnv_currentIndexChanged(int index);
-
-    void on_cBoxKind_currentIndexChanged(int index);
-
-    void on_sBoxThreshold_valueChanged(double arg1);
-
-    void on_lEditGpuId_textChanged(const QString &arg1);
-
-    void on_sBoxDelay_valueChanged(const QString &arg1);
-
-
-private slots:
-    void ImageUpdate(QImage* label1, QImage* label2);
-    void Btn_StopAndInfer_StateUpdate(bool stop_state, bool infer_state);
-    void CostTimeUpdate(double cost_time);
-
-private:
-    Ui::MainWindow *ui;
-};
-
-#endif // MAINWINDOW_H

+ 0 - 829
deploy/cpp/docs/jetson-deploy/Deploy_infer/mainwindow.ui

@@ -1,829 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>880</width>
-    <height>640</height>
-   </rect>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>880</width>
-    <height>640</height>
-   </size>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>880</width>
-    <height>640</height>
-   </size>
-  </property>
-  <property name="contextMenuPolicy">
-   <enum>Qt::NoContextMenu</enum>
-  </property>
-  <property name="windowTitle">
-   <string>PaddleX可视化推理界面</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <widget class="QWidget" name="verticalLayoutWidget_4">
-    <property name="geometry">
-     <rect>
-      <x>40</x>
-      <y>10</y>
-      <width>794</width>
-      <height>644</height>
-     </rect>
-    </property>
-    <layout class="QVBoxLayout" name="verticalLayout_7">
-     <item>
-      <layout class="QVBoxLayout" name="verticalLayout_6">
-       <item>
-        <widget class="Line" name="line_2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_10">
-         <item>
-          <layout class="QVBoxLayout" name="verticalLayout_4">
-           <item>
-            <spacer name="verticalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>40</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_6">
-             <item>
-              <widget class="QLabel" name="label_3">
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>40</height>
-                </size>
-               </property>
-               <property name="lineWidth">
-                <number>1</number>
-               </property>
-               <property name="text">
-                <string>实时推理耗时</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_7">
-             <item>
-              <spacer name="horizontalSpacer_38">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Maximum</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>25</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QLabel" name="labelCostTime">
-               <property name="maximumSize">
-                <size>
-                 <width>100</width>
-                 <height>40</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>0.00</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QLabel" name="label_5">
-               <property name="maximumSize">
-                <size>
-                 <width>40</width>
-                 <height>40</height>
-                </size>
-               </property>
-               <property name="text">
-                <string>ms</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_39">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeType">
-                <enum>QSizePolicy::Maximum</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>5</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_4">
-           <item>
-            <widget class="Line" name="line_8">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_5">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_2">
-             <item>
-              <widget class="QPushButton" name="btnInit">
-               <property name="text">
-                <string>初始化模型</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="Line" name="line_9">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="btnDistory">
-               <property name="text">
-                <string>销毁模型</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_3">
-             <item>
-              <widget class="Line" name="line_5">
-               <property name="orientation">
-                <enum>Qt::Vertical</enum>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="btnLoadImg">
-               <property name="text">
-                <string>加载图片</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_2">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="btnLoadImgs">
-               <property name="text">
-                <string>加载文件夹</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_19">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QPushButton" name="btnLoadVideo">
-               <property name="text">
-                <string>加载视频流</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="Line" name="line_6">
-               <property name="orientation">
-                <enum>Qt::Vertical</enum>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_4">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout">
-             <item>
-              <widget class="QPushButton" name="btnInfer">
-               <property name="text">
-                <string>模型推理</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="Line" name="line_10">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QPushButton" name="btnStop">
-               <property name="text">
-                <string>推理终止</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_6">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="Line" name="line_7">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QVBoxLayout" name="verticalLayout_5">
-             <item>
-              <spacer name="verticalSpacer_4">
-               <property name="orientation">
-                <enum>Qt::Vertical</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>20</width>
-                 <height>40</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout_8">
-               <item>
-                <widget class="QLabel" name="label_6">
-                 <property name="maximumSize">
-                  <size>
-                   <width>100</width>
-                   <height>40</height>
-                  </size>
-                 </property>
-                 <property name="text">
-                  <string>连续推理间隔</string>
-                 </property>
-                </widget>
-               </item>
-              </layout>
-             </item>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout_9">
-               <item>
-                <spacer name="horizontalSpacer_40">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeType">
-                  <enum>QSizePolicy::Maximum</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>20</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-               <item>
-                <widget class="QSpinBox" name="sBoxDelay">
-                 <property name="minimumSize">
-                  <size>
-                   <width>42</width>
-                   <height>0</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>50</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                 <property name="minimum">
-                  <number>50</number>
-                 </property>
-                 <property name="maximum">
-                  <number>1000</number>
-                 </property>
-                 <property name="singleStep">
-                  <number>50</number>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QLabel" name="label_7">
-                 <property name="maximumSize">
-                  <size>
-                   <width>20</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                 <property name="text">
-                  <string>ms</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer_41">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeType">
-                  <enum>QSizePolicy::Maximum</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>10</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line_4">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_11">
-         <item>
-          <spacer name="horizontalSpacer_9">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_5">
-           <item>
-            <widget class="QLabel" name="label_10">
-             <property name="text">
-              <string>运行环境:</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QComboBox" name="cBoxEnv">
-             <item>
-              <property name="text">
-               <string>CPU</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>GPU</string>
-              </property>
-             </item>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_12">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="Line" name="line_11">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLabel" name="label_9">
-             <property name="text">
-              <string>模型类型:</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QComboBox" name="cBoxKind">
-             <item>
-              <property name="text">
-               <string>det</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>seg</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>clas</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>mask</string>
-              </property>
-             </item>
-             <item>
-              <property name="text">
-               <string>paddlex</string>
-              </property>
-             </item>
-            </widget>
-           </item>
-           <item>
-            <widget class="Line" name="line_12">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_8">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QLabel" name="label_8">
-             <property name="maximumSize">
-              <size>
-               <width>55</width>
-               <height>55</height>
-              </size>
-             </property>
-             <property name="text">
-              <string>检测阈值:</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QDoubleSpinBox" name="sBoxThreshold">
-             <property name="maximumSize">
-              <size>
-               <width>50</width>
-               <height>40</height>
-              </size>
-             </property>
-             <property name="decimals">
-              <number>1</number>
-             </property>
-             <property name="maximum">
-              <double>0.900000000000000</double>
-             </property>
-             <property name="singleStep">
-              <double>0.100000000000000</double>
-             </property>
-             <property name="value">
-              <double>0.500000000000000</double>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_7">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_10">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <widget class="Line" name="line_3">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout">
-       <item>
-        <spacer name="horizontalSpacer_14">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>GPU_id</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QLineEdit" name="lEditGpuId">
-         <property name="maximumSize">
-          <size>
-           <width>30</width>
-           <height>16777215</height>
-          </size>
-         </property>
-         <property name="text">
-          <string>0</string>
-         </property>
-         <property name="maxLength">
-          <number>30</number>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="horizontalSpacer_15">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <widget class="Line" name="line">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer name="verticalSpacer">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_11">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <layout class="QHBoxLayout" name="horizontalLayout_2">
-       <item>
-        <widget class="QLabel" name="labelImage1">
-         <property name="minimumSize">
-          <size>
-           <width>380</width>
-           <height>380</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>380</width>
-           <height>380</height>
-          </size>
-         </property>
-         <property name="autoFillBackground">
-          <bool>true</bool>
-         </property>
-         <property name="text">
-          <string>ImageLabel</string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="horizontalSpacer">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="labelImage2">
-         <property name="minimumSize">
-          <size>
-           <width>380</width>
-           <height>380</height>
-          </size>
-         </property>
-         <property name="maximumSize">
-          <size>
-           <width>380</width>
-           <height>380</height>
-          </size>
-         </property>
-         <property name="autoFillBackground">
-          <bool>true</bool>
-         </property>
-         <property name="text">
-          <string>ImageLabel</string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignCenter</set>
-         </property>
-        </widget>
-       </item>
-      </layout>
-     </item>
-     <item>
-      <spacer name="horizontalSpacer_13">
-       <property name="orientation">
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>40</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <spacer name="verticalSpacer_2">
-       <property name="orientation">
-        <enum>Qt::Vertical</enum>
-       </property>
-       <property name="sizeHint" stdset="0">
-        <size>
-         <width>20</width>
-         <height>40</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </widget>
-  </widget>
-  <widget class="QStatusBar" name="statusBar"/>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections/>
-</ui>

+ 0 - 473
deploy/cpp/docs/jetson-deploy/README.md

@@ -1,473 +0,0 @@
-# 基于QT的Jetson Xavier部署Demo
-
-> 该项目中的QT设计代码,也支持其它平台下QT的运行——但需要保证各平台下拥有opencv的编译库(动态链接库与头文件(include)库),以及正常编译得到的动态链接库(*.a 或 *.so).
-
-项目文档目录:
-
-- <a href="### 1 环境准备">1 环境准备</a>
-- <a href="### 2 配置编译脚本">2 配置编译脚本</a>
-  - <a href="#### 2.1 修改`jetson_build.sh`编译参数">2.1 修改`jetson_build.sh`编译参数</a>
-  - <a href="#### 2.2 修改`CMakeList.txt`参数">2.2 修改`CMakeList.txt`参数</a>
-  - <a href="#### 2.3 修改`yaml.cmake`参数">2.3 修改`yaml.cmake`参数</a>
-- <a href="### 3 代码编译(生成模型预测的动态链接库)">3 代码编译(生成模型预测的动态链接库)</a>
-  - <a href="#### 3.1 修改`model_infer.cpp`文件">3.1 修改`model_infer.cpp`文件</a>
-  - <a href="#### 3.2 修改`CMakeList.txt`文件">3.2 修改`CMakeList.txt`文件</a>
-  - <a href="#### 3.3 执行`jetson_build.sh`编译">3.3 执行`jetson_build.sh`编译</a>
-- <a href="### 4 启动并配置QT工程(移植流程)">4 启动并配置QT工程(移植流程)</a>
-  - <a href="#### 4.1 启动QT工程项目">4.1 启动QT工程项目</a>
-  - <a href="#### 4.2 载入动态链接库">4.2 载入动态链接库</a>
-  - <a href="#### 4.3 配置QT的Opencv路径">4.3 配置QT的Opencv路径</a>
-- <a href="### 5 启动QT可视化界面">5 启动QT可视化界面</a>
-  - <a href="#### 5.1 功能介绍">5.1 功能介绍</a>
-  - <a href="#### 5.2 使用说明">5.2 使用说明</a>
-  - <a href="#### 5.3 使用效果展示">5.3 使用效果展示</a>
-- <a href="### 6 QT开发注解">6 QT开发注解</a>
-  - <a href="#### 6.1 利用`QDebug`实现运行日志输出">6.1 利用`QDebug`实现运行日志输出</a>
-  - <a href="#### 6.2 本项目的组织结构">6.2 本项目的组织结构</a>
-  - <a href="#### 6.3 控制读取图片的推理大小">6.3 控制读取图片的推理大小</a>
-  - <a href="#### 6.4 子线程控制主线程控件的建议">6.4 子线程控制主线程控件的建议</a>
-  - <a href="#### 6.5 修改model_infer.cpp函数后的动态链接库导入指导">6.5 修改model_infer.cpp函数后的动态链接库导入指导</a>
-  - <a href="#### 6.6 QT动态链接库的导入说明">6.6 QT动态链接库的导入说明</a>
-  - <a href="#### 6.7 移植小贴士">6.7 移植小贴士</a>
-- <a href="### 本项目的Demo的GUI也同时支持Linux、Windows上进行使用,但请自行编译好opencv,安装QT,移植流程区别如下。">本项目的Demo的GUI也同时支持Linux、Windows上进行使用,但请自行编译好opencv,安装QT,移植流程区别如下。</a>
-
-
-在新版本的PaddleX中,对于CPP的部署代码方式做了非常大的变化:
-* 支持用户将PaddleDetection PaddleSeg PaddleClas训练出来的模型通过一套部署代码实现快速部署,实现了多个模型的打通。
-* 对于一个视觉任务里面既有检测,又有分割来说,极大的简化了使用的流程。
-
-下面我们具体以**Jetson Xavier**系统为例,基于PaddleX的这套CPP(deploy/),说明一下如何实现QT的部署
-
-项目使用基本环境说明:
-
-* CUDA10.2  Cudnn 8
-* Jetson原生opencv4.1.1 / opencv3.4.6等(原生应该都支持,自己编译的opencv则建议为3.4.6)
-* Jetpack4.4: nv-jetson-cuda10.2-cudnn8-trt7(xavier)——PaddleInference 10.2的预测库(2.1.1版本)
-* Cmake 3.10.2
-* QT5.9.5
-* QMake3.1
-
-> 查看Jetpack版本: `cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2`
-> (4.3可以使用4.4版本的预测库)
->
-> 查看QT版本: `qmake -v`
->
-> 查看CUDA版本: `cat /usr/local/cuda/version.txt`
->
-> 查看Cudnn版本: `cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2`
-
-## 1 环境准备<a id="## 1 环境准备"/>
-
-* 下载好PaddleX代码和PaddleInference预测库
-* 下载QT以及QT-Creater
-
-1. 下载QT:
-`sudo apt-get install qt5-default qtcreator -y`
-
-2. 下载PaddleX+PaddleInference预测库:
-> 可查看文档:
-
-- [基于PaddleInference的推理-Jetson环境编译](../../deploy/cpp/docs/compile/paddle/jetson.md)
-
-3. 查看cmake版本: `cmake -version`
-
-> 保证版本大于3.5即可,如小于,可尝试安装`cmake3.10.2`。
-
-**QT-Creater的启动,可以通过`应用搜索`,输入`QT`,在出现的应用图标中选中QTCreater,点击即可启动!**
-
---------
-
-## 2 配置编译脚本<a id="## 2 配置编译脚本"/>
-
-> 如果已经查看`Jetson环境编译`文档后,并已经成功编译出可执行程序后,可跳过该部分的`deploy/cpp/scripts/jetson_build.sh`、`deploy/cpp/CMakeList.txt`以及`deploy/cpp/cmake/yaml.cmake`的修改说明.
-
-> 以下3部分的修改完全同[基于PaddleInference的推理-Jetson环境编译](../../deploy/cpp/docs/compile/paddle/jetson.md)一样,可前往参阅。
-
-### 2.1 修改`jetson_build.sh`编译参数<a id="### 2.1 修改`jetson_build.sh`编译参数"/>
-
-根据自己的系统环境,修改`PaddleX/deploy/cpp/script/jetson_build.sh`脚本中的参数,主要修改的参数为以下几个
-| 参数          | 说明                                                                                 |
-| :------------ | :----------------------------------------------------------------------------------- |
-| WITH_GPU      | ON或OFF,表示是否使用GPU,当下载的为CPU预测库时,设为OFF                             |
-| PADDLE_DIR    | 预测库所在路径,默认为`PaddleX/deploy/cpp/paddle_inference`目录下                    |
-| CUDA_LIB      | cuda相关lib文件所在的目录路径 -- 请注意jetson预装的cuda所在路径(如:/usr/local/cuda/lib64) |
-| CUDNN_LIB     | cudnn相关lib文件所在的目录路径 -- 请注意jetson预装的cuda所在路径(如:/usr/lib/aarch64-linux-gnu)    |
-| WITH_TENSORRT | ON或OFF,表示是否使用开启TensorRT                                                    |
-| TENSORRT_DIR  | TensorRT 的路径,如果开启TensorRT开关WITH_TENSORRT,需修改为您实际安装的TensorRT路径     |
-| WITH_ENCRYPTION      | ON或OFF,表示是否开启加密模块                             |
-| OPENSSL_DIR    | OPENSSL所在路径,解密所需。默认为`PaddleX/deploy/cpp/deps/penssl-1.1.0k`目录下        |
-
-> **要注意相关参数路径不要有误——特别是CUDA_LIB以及CUDNN_LIB,如果需要启动TensorRt,也需指定当前的路径。**
-
-<div>
-  <img src="./images/deploy_build_sh.png">
-  </div>
-
-> 不需要添加oepncv路径,在jetson中编译可直接使用环境本身预装的opencv进行deploy编译——具体配置在Step4中。
-
-### 2.2 修改`CMakeList.txt`参数<a id="### 2.2 修改`CMakeList.txt`参数"/>
-
-> 该修改仅适合Jetson系统的部署编译。
-
-根据自己的系统环境,修改`PaddleX/deploy/cpp/CMakeLists.txt`脚本中的参数,主要修改的参数为以下几个:位于其中注释`#OPENCV`之后的部分
-| 参数          | 说明                                                                                 |
-| :------------ | :----------------------------------------------------------------------------------- |
-| set(OpenCV_INCLUDE_DIRS "/usr/include/opencv")      | 配置Jetson预置opencv的include路径    |
-| file(GLOB OpenCV_LIBS /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX})    | 配置opencv动态链接库*.so    |
-
-替换具体如下:(xavier为例)
-
-1. /usr/include/opencv --> /usr/include/opencv4
-  > 具体路径,以部署环境中opencv的include路径为准。
-  > opencv4 中包含: opencv, opencv2
-
-2. /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX} --> /usr/lib/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX}
-  > 具体路径,以部署环境中opencv的*.so路径为准, 主要修改libopencv_前的路径。
-
-<div>
-  <img src="./images/cmakelist_set.png">
-  </div>
-
-### 2.3 修改`yaml.cmake`参数<a id="### 2.3 修改`yaml.cmake`参数"/>
-
-由于Jetson环境下编译还需要yaml,所以这里需要手动下载yaml包,保证编译的正常运行。
-
-> 1. 点击[下载yaml依赖包](https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip),无需解压
-> 2. 修改`PaddleX/deploy/cpp/cmake/yaml.cmake`文件,将`URL https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip`中网址替换为第3步中下载的路径,如改为`URL /Users/Download/yaml-cpp.zip`
-
-**这里yaml存放路径为了确保使用最好保证全英文路径**
-eg:
-
-<div>
-  <img src="./images/yaml_cmakelist.png">
-  </div>
-
-> 其它支持的加密操作以及TensorRT,可参考[Linux环境编译指南](./linux.md).
-
--------
-
-## 3 代码编译(生成模型预测的动态链接库)<a id="## 3 代码编译(生成模型预测的动态链接库)"/>
-
-该部分需要修改两个地方,以保证动态链接库的正常生成。
-
-> 接下来的操作,请在执行以下命令正常生成可执行程序后再往下继续配置,以确保修改前的工作是正确可执行的。
->
-```
-sh script/jetson_build.sh
-```
-
-> 编译时,如果存在cmake多线程问题——请前往`jetson_build.sh`末尾,将`make -j8`改为`make`或者小于8.
->
-> 编译后会在`PaddleX/deploy/cpp/build/demo`目录下生成`model_infer`、`multi_gpu_model_infer`和`batch_infer`等几个可执行二进制文件.
-
-### 3.1 修改`model_infer.cpp`文件<a id="### 3.1 修改`model_infer.cpp`文件"/>
-
-接下来我们需要在QT中去调用动态链接库,所以原有的`deploy/cpp/demo/model_infer.cpp`文件生成的可执行文件不能支持QT去进行调用,所以需要对其进行一定的修改。
-
-现已将修改后满足需求的文件放于本文档处,即——**将当前文件的`model_infer.cpp`用于替换`deploy/cpp/demo/model_infer.cpp`即可.**
-
-- 其中主要开辟了多个共享接口函数,分别对应:模型初始化,模型推理(用于推理PaddleDetection、PaddleSeg、PaddleClas、PaddleX产出的部署模型),模型销毁。
-
-> 该model_infer.cpp仅支持使用一个模型——用于单线程调用
->
-> 如需多线程推理,同时创建多个模型用于预测推理,可以参考该项目下cpp的实现: [PaddleDeploy在C#端的多线程推理demo](https://github.com/cjh3020889729/PaddleDeploy-CSharp-ManyThreadInfer-Demo)
-
-- 模型初始化接口: `InitModel(const char* model_type, const char* model_filename, const char* params_filename, const char* cfg_file, bool use_gpu, int gpu_id, char* paddlex_model_type)`
-
-- 目标检测推理接口: `Det_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* output, int* nBoxesNum, char* LabelList)`
-
-- 语义分割推理接口: `Seg_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, unsigned char* output)`
-
-- 图像识别推理接口: `Cls_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* score, char* category, int* category_id)`
-
-- 实例分割推理接口: `Mask_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* box_output, unsigned char* mask_output, int* nBoxesNum, char* LabelList)`
-
-- 模型销毁接口: `DestructModel()`
-
-> 详细说明,请查看[`model_infer.cpp`](./model_infer.cpp)的实现.
-
-
-### 3.2 修改`CMakeList.txt`文件<a id="### 3.2 修改`CMakeList.txt`文件"/>
-
-以上完成了`model_infer.cpp`的修改后,需要修改当前目录下的`CMakeList.txt`文件,位于: `deploy/cpp/demo/CMakeList.txt`.
-
-需要修改的内容,如图所示:
-
-<div>
-  <img src="./images/infer_demo_cmakelist.png">
-  </div>
-
-用`ADD_library`那句脚本替换下划线那句脚本即可,也可直接使用本项目提供的`CMakeList.txt`进行替换`deploy/cpp/demo/CMakeList.txt`.
-
-### 3.3 执行`jetson_build.sh`编译<a id="### 3.3 执行`jetson_build.sh`编译"/>
-
-运行以下命令行, 编译完成即可获得所需推理接口的动态链接库(libmodel_infer.so)
-
-```
-sh script/jetson_build.sh
-```
-
-运行完成,会在`PaddleX/deploy/cpp/build/lib`中生成`libmodel_infer.so`动态链接库。
-
-## 4 启动并配置QT工程(移植流程)<a id="## 4 启动并配置QT工程(移植流程)"/>
-
-以下步骤请确保QT安装完成,且可以正常启动QT桌面项目。
-
-### 4.1 启动QT工程项目<a id="### 4.1 启动QT工程项目"/>
-
-1. 首先打开`Qtcreator`,新建项目,取名为`Deploy_infer`,选择项目路径为自己所熟悉的路径即可,然后一直顺着往下不必多设置或者勾选什么,直到`finished`。<div>
-  <img src="./images/qt_start_new_pro.png">
-  </div><div>
-  <img src="./images/qt_create_guipro.png">
-  </div><div>
-  <img src="./images/qt_set_proname.png">
-  </div>
-
-> 如果存在多个编译环境供QT使用,请确保QT使用的编译环境与前边生成动态链接库的编译环境一致——或者至少保证生成的所有库都允许相互调用,即避免出现32位与64位不兼容等情况。
-
-2. 进入QT崭新的工程项目后,工程项目中会存在`*.pro`,`Headers`,`Sources`,`Forms`四个主要组件,其中后三个为项目分支(目录)<div>
-  <img src="./images/project_list.png">
-  </div>
-
-3. 右键点击项目,选择`Add New`, 进入子界面选择`c++`,选中`Class`, 点击`choise`.<div>
-  <img src="./images/qt_add_newfile.png">
-  </div>
-
-4. 在新出来的子界面中,输入`InferThread`作为**Class name**, 然后一直往下生成即可.<div>
-  <img src="./images/qt_create_class.png">
-  </div>
-
-5. 将本项目`Deploy_infer`中的`inferthread.cpp`与`inferthread.h`中的内容分别复制过去即可.
-6. 然后,再将本项目`Deploy_infer`中的`mainwindow.cpp`与`mainwindow.h`中的内容也复制过去.
-7. 最后,将本项目的`mainwindow.ui`替换新建的QT-GUI项目的ui文件.
-
-> 此时,QT项目的移植就完成了——之所以新建项目,看起来比较复杂,是为了避免直接移植导致的QT版本不匹配,发生一些意料之外的问题。
->
-> 此时QT项目中,会出现标红的错误,原因可能如下:
-- 1. 还未导入动态链接库
-- 2. 还未导入opencv的编译好的库
-- 因此,现在暂时不用担心标红的问题
-
-### 4.2 载入动态链接库<a id="### 4.2 载入动态链接库"/>
-
-在创建的QT项目文件夹下新建`infer_lib`文件夹,将生成的`libmodel_infer.so`文件移入其中即可。
-<div>
-  <img src="./images/qt_project_inferlib.png">
-  </div>
-
-**然后打开`Qtcreator`, 打开项目选择本QT项目启动**,可观察到QT工程目录结构如图所示:
-<div>
-  <img src="./images/project_list.png">
-  </div>
-
-双击`mainwindow.cpp`进入,**确保第一个函数中,导入的动态链接库绝对路径无误!**
-<div>
-  <img src="./images/dong_tai_lianjieku.png">
-  </div>
-
-> 此时QT项目中,会出现标红的错误,原因可能如下:
-- 1. 还未导入opencv的编译好的库
-- 因此,现在暂时不用担心标红的问题
-
-### 4.3 配置QT的Opencv路径<a id="### 4.3 配置QT的Opencv路径"/>
-
-> 请保证编译opencv的编译环境与当前QT使用的编译环境一致,否则可能无法导入opencv中的函数.
-
-该部分主要配置两个部分: `Include Path` 和 `Lib Path`.
-
-双击`Deploy_infer.pro`进入,按照如图所示写入当前环境下系统原装预编译的`Opencv路径`:
-
-<div>
-  <img src="./images/pro_set_libpath.png">
-  </div>
-
-- `INCLUDEPATH` : 表示`opencv`的头文件所在路径,包含头文件根目录,`opencv`子目录以及`opencv2`子目录
-- `LIBS` : 表示`opencv`的动态链接库`so文件`所在路径,这里使用`正则匹配`,自动匹配路径下的所有`opencv.so`文件
-
-> 在本测试Jetson环境上,**预编译opencv由于没有同ffmpeg一同编译**,因此不支持视频流的处理与预测(无法打开视频文件,如mp4,avi等)
->
-> 如有需要可在此时另外编译opencv,不覆盖原预编译的opencv版本,仅用于QT程序进行图像/视频的读取和简单处理。
->
-> 此时编译的新opencv,在编译时要选择编译参数使其支持QT、GL以及ffmpeg.(ffmpeg可能需要自行编译)
->
-> 该方案的编译指导,可参考网上的`linux下opencv与ffmpeg联合编译`资料。
->
-> 因此,本QT的Demo在`Jetson Xavier`上,使用`原生opencv`,仅支持图片以及连续图片的预测,视频预测需要自行编译新的opencv,以支持视频读取——只要opencv编译成功,以上编译动态链接库的`opencv路径`仅需相应修改即可(**记得更改后重新编译生成**),同时修改QT导入的`opencv库路径`就可以正常使用该可视化Demo了。
-
-> 此时QT项目中,标红的错误应该会消失——可以稍微等一下QT项目更新项目缓存,记得保存修改!
-
-**PS:**
-
-在运行项目时,请注意,如果报`cv::xxx`未定义,可能为以下情况:
-- 1. opencv头文件引入有误,当前采用导入的形式,而非使用系统路径,因此,应该保证引入符号为`""`,而非`<>`.
-
-<div>
-  <img src="./images/import_opencv.png">
-  </div>
-
-- 2. 如果出现导入pro中的`LIBS`有误,显示没有该文件(No Such File or Path)等报错,请查看opencv动态链接库是否配置正确.
-- 3. 当前测试中,所有路径均为`英文路径`,因此在使用`中文路径`时如遇报错,请换成`英文路径`重新导入.
-- 4. 以上情况外,还可能时QT编译环境与opencv编译的环境不同所导致,QT无法引用opencv1的动态链接库中的内容.
-
-> `Jetson`下仅测试了英文路径,`Windows`上中英文路径均无误。
-
-
-## 5 启动QT可视化界面<a id="## 5 启动QT可视化界面"/>
-
-启动后界面如下:
-<div>
-  <img src="./images/show_menu.png">
-  </div>
-
-### 5.1 功能介绍<a id="### 5.1 功能介绍"/>
-
-- 1.可加载PaddleSeg, PaddleClas, PaddleDetection以及PaddleX导出的部署模型, 分别对应模型选择中的: seg, clas, det, paddlex
-- 2.目前也支持`GPU`下加载MaskRCNN进行实例分割可视化推理,需选择模型: mask
-- 3.支持CPU与GPU推理,同时支持指定GPU运行 —— 当前在单卡上测试默认为0运行正常,非法指定不存在的id无法初始化模型;且可能引发异常导致程序崩溃
-- 4.支持单张图片(png, jpg)、图片文件夹、**视频流(mp4)推理(Jetson原装opencv下不支持,Windows测试无误)**
-- 5.支持目标检测时,设定检测结果显示阈值
-- 6.支持图片文件夹推理(即连续图片推理)时,设定连续推理间隔,方便观察预测效果
-- 7.支持推理中断:图片文件夹推理过程+视频流推理过程
-
-### 5.2 使用说明<a id="### 5.2 使用说明"/>
-
-- 1.选择模型类型:det、seg、clas、mask、paddlex
-- 2.选择运行环境:CPU、GPU
-- 3.点击初始化模型,选择模型文件夹即可 —— 文件夹格式如下
-   - inference_model
-       - *.yml
-       - *.pdmodel
-       - *.pdiparams
-       - paddlex的模型含有两个yml,其余套件导出只有一个yml/yaml
-- 4.加载图片/图片文件夹/视频流
-- 5.模型推理
-- 6.(非单张推理时支持)执行提前推理中断
-- 7.加载新模型,需要先点击销毁模型,然后再设置模型类型以及运行环境,最后重新初始化新模型
-- 8.在目标检测过程中,可设置检测阈值
-- 9.在文件夹推理过程中,可设置连续推理间隔时间
-- 10.可通过查看左上角实时推理耗时来查看模型预处理+推理-后处理的时间**(Jetson上,CPU推理过慢,建议直接使用GPU推理)**
-- 11.可编辑GPU_id,设置初始化时模型运行在指定GPU上——请根据实际硬件设置,默认为0
-
-### 5.3 使用效果展示<a id="### 5.3 使用效果展示"/>
-
-**CPU推理**
-<div>
-  <img src="./images/cpu_infer.png">
-  </div>
-
-**GPU推理**
-<div>
-  <img src="./images/gpu_infer.png">
-  </div>
-
------
-
-## 6 QT开发注解<a id="## 6 QT开发注解"/>
-
-> 一些方便大家修改Demo界面源码,以实现一些适配工作。
-
-### 6.1 利用`QDebug`实现运行日志输出<a id="### 6.1 利用`QDebug`实现运行日志输出"/>
-
-首先在mainwindow.cpp中导入`#include <QDebug>`,以支持QT程序运行过程中输出一些人为添加的日志输出。
-
-实例代码:
-<div>
-  <img src="./images/debug_incode.png">
-  </div>
-
-输出如下:
-<div>
-  <img src="./images/output_info.png">
-  </div>
-
-### 6.2 本项目的组织结构<a id="### 6.2 本项目的组织结构"/>
-
-工程目录:
-<div>
-  <img src="./images/project_list.png">
-  </div>
-
-- inferthread.cpp/inferthread.h :`推理子线程` —— 包含具体的推理执行函数的实现,以及运行控件状态信号的发出(比如,更新图片显示,与控件的使能与关闭)
-- mainwindow.cpp/mainwindow.h :`主线程` —— 包含界面布局控制的实现,推理文件加载(也包含动态链接库)的实现,以及推理线程的启动与中止信号的发出(比如,启动推离线程)
-
-### 6.3 控制读取图片的推理大小<a id="### 6.3 控制读取图片的推理大小"/>
-
-由于QT可视化界面可能用于不同的系统,因此对于可分配运行内存而言是有一定的考量的,因此对于读取的图片在进行推理以及显示前进行一定的缩放,能够减少内存的消耗。
-
-> 不过,显示时要保证图像宽高均可被4整除,否则控件图片显示可能有误。
-
-每一个具体推理的函数里,都有以下操作,对推理前的图片进行缩放:
-<div>
-  <img src="./images/tupian_suofang.png">
-  </div>
-
-### 6.4 子线程控制主线程控件的建议<a id="### 6.4 子线程控制主线程控件的建议"/>
-
-不要直接使用子线程对主线程控件进行控制,避免导致线程报错,线程问题不易debug——因此,多用信号与槽来实现交互。
-
-实现思路:
-1. 在子线程需要对主线程中控件进行控制时,发送一个信号
-2. 主线程在消息循环机制中持续运行时,接收信号,执行对应的槽,实现控件的控制
-
-具体实现流程:
-1. 在子线程的.h文件中,编写函数声明即可——不用具体实现。
-2. 在主线程的.h文件中,先编写槽函数的声明,然后在.cpp中去实现它,完成信号的传递。
-3. 在编写好槽函数定义后,进行connect完成槽函数与信号的链接。
-
-**PS:**
-子线程信号声明如下:
-<div>
-  <img src="./images/thread_signal.png">
-  </div>
-
-主线程槽声明如下:
-<div>
-  <img src="./images/main_slot.png">
-  </div>
-
-### 6.5 修改model_infer.cpp函数后的动态链接库导入指导<a id="### 6.5 修改model_infer.cpp函数后的动态链接库导入指导"/>
-
-1.进入`inferthread.h`与`mainwindow.h`中,使用`typdef定义函数指针`,按照`函数参数格式`进行定义。
-
-即:model_infer.cpp中函数怎么定义的,这边就构建一个相同定义支持的函数指针。
-
-2.`inferthread.h`中的定义展示:
-<div>
-  <img src="./images/qt_inferthreadcpp_set.png">
-  </div>
-
-3.`mainwindow.h`中的定义展示:
-<div>
-  <img src="./images/qt_mainwindowset.png">
-  </div>
-
-### 6.6 QT动态链接库的导入说明<a id="### 6.6 QT动态链接库的导入说明"/>
-
-本项目只需要导入一个自己定义的动态链接库,因此使用QLibrary进行导入,该方法不适用于多动态库的导入,容易代码量多导致混淆。
-
-该项目的导入如下:
-<div>
-  <img src="./images/qt_importppipeline.png">
-  </div>
-
-### 6.7 移植小贴士<a id="### 6.7 移植小贴士"/>
-
-1. 运行环境改变时,注意运行环境对编译的库的影响,配置正确的opencv路径以及编译器版本
-
-  2. 对于linux,QT默认使用系统gcc进行编译,不用选择编译器
-  3. 对于windows,QT使用MinGW或者MSVC等,此时需要注意QT使用的编译器与opencv、model_infer动态链接库等的编译器是否一致,或者是否可以兼容.
-
-2. 避免QT版本移植问题,先创建一个新的项目,然后拷贝已有的旧项目中的ui、cpp与h文件到新项目,同时修改pro文件中的配置一致即可完成跨版本跨平台的移植。
-
-
-## 本项目的Demo的GUI也同时支持Linux、Windows上进行使用,但请自行编译好opencv,安装QT,移植流程区别如下。<a id="## 本项目的Demo的GUI也同时支持Linux、Windows上进行使用,但请自行编译好opencv,安装QT,移植流程区别如下。"/>
-
-> 注意deploy编译所需的流程,可参考PaddleX模型推理部署deploy在Linux以及Windows上的[编译指南](https://github.com/cjh3020889729/PaddleX/tree/develop/deploy/cpp).
-
-> 注意区分不同平台上,动态链接库的命名区别: windows-*.a , linux/jetson-*.so
-
-- Windows平台移植测试完成 -- 自行编译opencv3.4.6/4.1.1,需保证支持QT,GL
-  - windows上编译opencv可参考: [为qt编译opencv](http://159.138.37.243/article/z634863434/89950961)
-  - 如cmake的configure中出现红字,说找不到ffmpeg相关包,属于网络问题,无法下载该相关dll,需要自行下载后进行相关处理,可参考: [ffmpeg下载失败处理方法](https://www.cxyzjd.com/article/pyt1234567890/106525475)
-- Jetson Xavier平台移植测试完成 -- 预编译opencv4.1.1,已支持QT和GL
-- Linux平台移植界面测试完成 -- opencv以及模型推理所需的动态链接库(可按照该项目的`CMakeList.txt`与`model_infer.cpp`替换原文件,然后按照[linux编译方法](../../deploy/cpp/docs/compile/paddle/linux.md)进行编译)去自行生成。

BIN
deploy/cpp/docs/jetson-deploy/images/cmakelist_set.png


BIN
deploy/cpp/docs/jetson-deploy/images/cpu_infer.png


BIN
deploy/cpp/docs/jetson-deploy/images/debug_incode.png


BIN
deploy/cpp/docs/jetson-deploy/images/deploy_build_sh.png


BIN
deploy/cpp/docs/jetson-deploy/images/dong_tai_lianjieku.png


BIN
deploy/cpp/docs/jetson-deploy/images/gpu_infer.png


BIN
deploy/cpp/docs/jetson-deploy/images/import_opencv.png


BIN
deploy/cpp/docs/jetson-deploy/images/infer_demo_cmakelist.png


BIN
deploy/cpp/docs/jetson-deploy/images/main_slot.png


BIN
deploy/cpp/docs/jetson-deploy/images/output_info.png


BIN
deploy/cpp/docs/jetson-deploy/images/pro_set_libpath.png


BIN
deploy/cpp/docs/jetson-deploy/images/project_list.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_add_newfile.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_create_class.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_create_guipro.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_importppipeline.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_inferthreadcpp_set.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_mainwindowset.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_project_inferlib.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_set_proname.png


BIN
deploy/cpp/docs/jetson-deploy/images/qt_start_new_pro.png


BIN
deploy/cpp/docs/jetson-deploy/images/show_menu.png


BIN
deploy/cpp/docs/jetson-deploy/images/thread_import_opencv.png


BIN
deploy/cpp/docs/jetson-deploy/images/thread_signal.png


BIN
deploy/cpp/docs/jetson-deploy/images/tupian_suofang.png


BIN
deploy/cpp/docs/jetson-deploy/images/yaml_cmakelist.png


+ 0 - 312
deploy/cpp/docs/jetson-deploy/model_infer.cpp

@@ -1,312 +0,0 @@
-#include <string>
-#include <vector>
-
-#include "model_deploy/common/include/paddle_deploy.h"
-
-// Global model pointer
-PaddleDeploy::Model* model;
-
-/*
-* Model initialization / registration API
-*
-* model_type: det,seg,clas,paddlex
-*
-* model_filename: Model file path
-*
-* params_filename: Parameter file path
-*
-* cfg_file: Configuration file path
-*
-* use_gpu: Whether to use GPU
-*
-* gpu_id: Specify GPU x
-*
-* paddlex_model_type: When Model_Type is paddlx, the type of actual Paddlex model returned - det, seg, clas
-*
-*/
-extern "C" void InitModel(const char* model_type, const char* model_filename, const char* params_filename, const char* cfg_file, bool use_gpu, int gpu_id, char* paddlex_model_type)
-{
-	// create model
-	model = PaddleDeploy::CreateModel(model_type);  //FLAGS_model_type
-
-	// model init
-	model->Init(cfg_file);
-
-	// inference engine init
-	PaddleDeploy::PaddleEngineConfig engine_config;
-	engine_config.model_filename = model_filename;
-	engine_config.params_filename = params_filename;
-	engine_config.use_gpu = use_gpu;
-	engine_config.gpu_id = gpu_id;
-	bool init = model->PaddleEngineInit(engine_config);
-	if (init)
-	{
-		std::cout << "init model success" << std::endl;
-	}
-
-	// det, seg, clas, paddlex
-	if (strcmp(model_type, "paddlex") == 0) // If it is a PADDLEX model, return the specifically supported model type: det, seg, clas
-	{
-		// detector
-		if (model->yaml_config_["model_type"].as<std::string>() == std::string("detector"))
-		{
-			strcpy(paddlex_model_type, "det");
-		}
-		else if (model->yaml_config_["model_type"].as<std::string>() == std::string("segmenter"))
-		{
-			strcpy(paddlex_model_type, "seg");
-		}
-		else if (model->yaml_config_["model_type"].as<std::string>() == std::string("classifier"))
-		{
-			strcpy(paddlex_model_type, "clas");
-		}
-	}
-}
-
-
-/*
-* Detection inference API
-*
-* img: input for predicting.
-*
-* nWidth: width of img.
-*
-* nHeight: height of img.
-*
-* nChannel: channel of img.
-*
-* output: result of pridict ,include category_id£¬score£¬coordinate¡£
-*
-* nBoxesNum£º number of box
-*
-* LabelList: label list of result
-*
-* extern "C"
-*/
-extern "C" void Det_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* output, int* nBoxesNum, char* LabelList)
-{
-	// prepare data
-	std::vector<cv::Mat> imgs;
-
-	int nType = 0;
-	if (nChannel == 3)
-	{
-		nType = CV_8UC3;
-	}
-	else
-	{
-		std::cout << "Only support 3 channel image." << std::endl;
-		return;
-	}
-
-	cv::Mat input = cv::Mat::zeros(cv::Size(nWidth, nHeight), nType);
-	memcpy(input.data, img, nHeight * nWidth * nChannel * sizeof(uchar));
-	imgs.push_back(std::move(input));
-
-	// predict
-	std::vector<PaddleDeploy::Result> results;
-	model->Predict(imgs, &results, 1);
-
-	// nBoxesNum[0] = results.size();  // results.size() is returning batch_size
-	nBoxesNum[0] = results[0].det_result->boxes.size();  // Get the predicted Bounding Box number of a single image
-	std::string label = "";
-	//std::cout << "res: " << results[num] << std::endl;
-	for (int i = 0; i < results[0].det_result->boxes.size(); i++)  // Get the data for all the boxes
-	{
-		label = label + results[0].det_result->boxes[i].category + " ";
-		// labelindex
-		output[i * 6 + 0] = results[0].det_result->boxes[i].category_id; // Category ID
-		// score
-		output[i * 6 + 1] = results[0].det_result->boxes[i].score;  // Score
-		//// box
-		output[i * 6 + 2] = results[0].det_result->boxes[i].coordinate[0]; // x1, y1, x2, y2
-		output[i * 6 + 3] = results[0].det_result->boxes[i].coordinate[1]; // Upper left and lower right vertices
-		output[i * 6 + 4] = results[0].det_result->boxes[i].coordinate[2];
-		output[i * 6 + 5] = results[0].det_result->boxes[i].coordinate[3];
-	}
-	memcpy(LabelList, label.c_str(), strlen(label.c_str()));
-}
-
-
-/*
-* Segmented inference
-*
-* img: input for predicting.
-*
-* nWidth: width of img.
-*
-* nHeight: height of img.
-*
-* nChannel: channel of img.
-*
-* output: result of pridict ,include label_map
-*
-* extern "C"
-*/
-extern "C" void Seg_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, unsigned char* output)
-{
-	// prepare data
-	std::vector<cv::Mat> imgs;
-
-	int nType = 0;
-	if (nChannel == 3)
-	{
-		nType = CV_8UC3;
-	}
-	else
-	{
-		std::cout << "Only support 3 channel image." << std::endl;
-		return;
-	}
-
-	cv::Mat input = cv::Mat::zeros(cv::Size(nWidth, nHeight), nType);
-	memcpy(input.data, img, nHeight * nWidth * nChannel * sizeof(uchar));
-	imgs.push_back(std::move(input));
-
-	// predict
-	std::vector<PaddleDeploy::Result> results;
-	model->Predict(imgs, &results, 1);
-
-	std::vector<uint8_t> result_map = results[0].seg_result->label_map.data; // vector<uint8_t> -- Result Map
-	// Copy output result to the output back -- from vector<uint8_t> to unsigned char *
-	memcpy(output, &result_map[0], result_map.size() * sizeof(uchar));
-}
-
-
-/*
-* Recognition inference API
-*
-* img: input for predicting.
-*
-* nWidth: width of img.
-*
-* nHeight: height of img.
-*
-* nChannel: channel of img.
-*
-* score: result of pridict ,include score
-*
-* category: result of pridict ,include category_string
-*
-* category_id: result of pridict ,include category_id
-*
-* extern "C"
-*/
-extern "C" void Cls_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* score, char* category, int* category_id)
-{
-	// prepare data
-	std::vector<cv::Mat> imgs;
-
-	int nType = 0;
-	if (nChannel == 3)
-	{
-		nType = CV_8UC3;
-	}
-	else
-	{
-		std::cout << "Only support 3 channel image." << std::endl;
-		return;
-	}
-
-	cv::Mat input = cv::Mat::zeros(cv::Size(nWidth, nHeight), nType);
-	memcpy(input.data, img, nHeight * nWidth * nChannel * sizeof(uchar));
-	imgs.push_back(std::move(input));
-
-	// predict
-	std::vector<PaddleDeploy::Result> results;
-	model->Predict(imgs, &results, 1);
-
-	*category_id = results[0].clas_result->category_id;
-	// Copy output category result to output -- string --> char*
-	memcpy(category, results[0].clas_result->category.c_str(), strlen(results[0].clas_result->category.c_str()));
-	// Copy output probability value
-	*score = results[0].clas_result->score;
-}
-
-
-/*
-* MaskRCNN Reasoning
-*
-* img: input for predicting.
-*
-* nWidth: width of img.
-*
-* nHeight: height of img.
-*
-* nChannel: channel of img.
-*
-* box_output: result of pridict ,include label+score+bbox
-*
-* mask_output: result of pridict ,include label_map
-*
-* nBoxesNum: result of pridict ,include BoxesNum
-*
-* LabelList: result of pridict ,include LabelList
-*
-* extern "C"
-*/
-extern "C" void Mask_ModelPredict(const unsigned char* img, int nWidth, int nHeight, int nChannel, float* box_output, unsigned char* mask_output, int* nBoxesNum, char* LabelList)
-{
-	// prepare data
-	std::vector<cv::Mat> imgs;
-
-	int nType = 0;
-	if (nChannel == 3)
-	{
-		nType = CV_8UC3;
-	}
-	else
-	{
-		std::cout << "Only support 3 channel image." << std::endl;
-		return;
-	}
-
-	cv::Mat input = cv::Mat::zeros(cv::Size(nWidth, nHeight), nType);
-	memcpy(input.data, img, nHeight * nWidth * nChannel * sizeof(uchar));
-	imgs.push_back(std::move(input));
-
-	// predict
-	std::vector<PaddleDeploy::Result> results;
-	model->Predict(imgs, &results, 1);
-
-	nBoxesNum[0] = results[0].det_result->boxes.size();  // Get the predicted Bounding Box number of a single image
-	std::string label = "";
-
-	for (int i = 0; i < results[0].det_result->boxes.size(); i++)  // Get the data for all the boxes
-	{
-		// prediction results
-		label = label + results[0].det_result->boxes[i].category + " ";
-		// labelindex
-		box_output[i * 6 + 0] = results[0].det_result->boxes[i].category_id; // Category ID
-		// score
-		box_output[i * 6 + 1] = results[0].det_result->boxes[i].score;  // Score
-		//// box
-		box_output[i * 6 + 2] = results[0].det_result->boxes[i].coordinate[0]; // x1, y1, x2, y2
-		box_output[i * 6 + 3] = results[0].det_result->boxes[i].coordinate[1]; // Upper left and lower right vertices
-		box_output[i * 6 + 4] = results[0].det_result->boxes[i].coordinate[2];
-		box_output[i * 6 + 5] = results[0].det_result->boxes[i].coordinate[3];
-
-		// Mask prediction results
-		for (int j = 0; j < results[0].det_result->boxes[i].mask.data.size(); j++)
-		{
-			if (mask_output[j] == 0)
-			{
-				mask_output[j] = results[0].det_result->boxes[i].mask.data[j];
-			}
-		}
-
-	}
-	memcpy(LabelList, label.c_str(), strlen(label.c_str()));
-}
-
-
-/*
-* Model destruction API
-*
-* extern "C"
-*/
-extern "C" void DestructModel()
-{
-	delete model;
-	std::cout << "destruct model success" << std::endl;
-}

+ 1 - 1
deploy/cpp/docs/models/paddleclas.md

@@ -1,6 +1,6 @@
 # PaddleClas模型部署
 
-当前支持PaddleClas release/2.2分支导出的模型进行部署。本文档以ResNet50模型为例,讲述从release/2.2分支导出模型并用PaddleX 进行cpp部署整个流程。 PaddleClas相关详细文档可以查看[官网文档](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.2/README_cn.md)
+当前支持PaddleClas release/2.1分支导出的模型进行部署。本文档以ResNet50模型为例,讲述从release/2.1分支导出模型并用PaddleX 进行cpp部署整个流程。 PaddleClas相关详细文档可以查看[官网文档](https://github.com/PaddlePaddle/PaddleClas/blob/release/2.1/README_cn.md)
 
 
 

+ 1 - 1
deploy/cpp/docs/models/paddledetection.md

@@ -1,6 +1,6 @@
 # PaddleDetection模型部署
 
-当前支持PaddleDetection release/0.5和release/2.2分支导出的模型进行部署(仅支持FasterRCNN/MaskRCNN/PPYOLO/PPYOLOv2/YOLOv3)。PaddleDetection相关详细文档可以查看[官网文档](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.2)。
+当前支持PaddleDetection release/0.5和release/2.1分支导出的模型进行部署(仅支持FasterRCNN/MaskRCNN/PPYOLO/PPYOLOv2/YOLOv3)。PaddleDetection相关详细文档可以查看[官网文档](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.1)。
 
 下面主要以YoloV3为例,讲解从模型导出到部署的整个流程。
 

+ 1 - 1
deploy/cpp/docs/models/paddleseg.md

@@ -1,6 +1,6 @@
 # PaddleSeg模型部署
 
-当前支持PaddleSeg release/2.2分支训练的模型进行导出及部署。本文档以[Deeplabv3P](https://github.com/PaddlePaddle/PaddleSeg/blob/release/v2.2/configs/deeplabv3p)模型为例,讲述从release/2.2版本导出模型并进行cpp部署整个流程。 PaddleSeg相关详细文档查看[官网文档](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.2/README_CN.md)
+当前支持PaddleSeg release/2.1分支训练的模型进行导出及部署。本文档以[Deeplabv3P](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/configs/deeplabv3p)模型为例,讲述从release/2.1版本导出模型并进行cpp部署整个流程。 PaddleSeg相关详细文档查看[官网文档](https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/README_CN.md)
 
 ## 步骤一 部署模型导出
 

+ 0 - 84
docs/install.md

@@ -1,84 +0,0 @@
-# 快速安装PaddleX
-
-## 目录
-
-* [1. PaddleX API开发模式安装](#1)
-* [2. PadldeX GUI开发模式安装](#2)
-* [3. PaddleX Restful开发模式安装](#3)
-
-
-**PaddleX提供三种开发模式,满足用户的不同需求:**
-
-## <h2 id="1">1. PaddleX API开发模式安装</h2>
-
-通过简洁易懂的Python API,在兼顾功能全面性、开发灵活性、集成方便性的基础上,给开发者最流畅的深度学习开发体验。<br>
-
-以下安装过程默认用户已安装好**paddlepaddle-gpu或paddlepaddle(版本大于或等于2.1.0)**,paddlepaddle安装方式参照[飞桨官网](https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/windows-pip.html)
-
-
-### PaddleX 2.0.0安装
-
-#### * Linux / macOS 操作系统
-
-使用pip安装方式安装2.0.0版本:
-
-```commandline
-pip install paddlex==2.0.0 -i https://mirror.baidu.com/pypi/simple
-```
-
-因PaddleX依赖pycocotools包,如遇到pycocotools安装失败,可参照如下方式安装pycocotools:
-
-```commandline
-pip install cython  
-pip install pycocotools
-```
-
-**我们推荐大家先安装Anacaonda,而后在新建的conoda环境中使用上述pip安装方式**。Anaconda是一个开源的Python发行版本,其包含了conda、Python等180多个科学包及其依赖项。使用Anaconda可以通过创建多个独立的Python环境,避免用户的Python环境安装太多不同版本依赖导致冲突。参考[Anaconda安装PaddleX文档](./appendix/anaconda_install.md)
-
-#### * Windows 操作系统
-
-
-使用pip安装方式安装2.0.0版本:
-
-```commandline
-pip install paddlex==2.0.0 -i https://mirror.baidu.com/pypi/simple
-```
-
-因PaddleX依赖pycocotools包,Windows安装时可能会提示`Microsoft Visual C++ 14.0 is required`,从而导致安装出错,[点击下载VC build tools](https://go.microsoft.com/fwlink/?LinkId=691126)安装再执行如下pip命令
-> 注意:安装完后,需要重新打开新的终端命令窗口
-
-```commandline
-pip install cython
-pip install git+https://gitee.com/jiangjiajun/philferriere-cocoapi.git#subdirectory=PythonAPI
-```
-
-### PaddleX develop安装
-
-github代码会跟随开发进度不断更新,可以安装develop分支的代码使用最新的功能,安装方式如下:
-
-```commandline
-git clone https://github.com/PaddlePaddle/PaddleX.git
-cd PaddleX
-git checkout develop
-pip install -r requirements.txt
-python setup.py install
-```
-
-如遇到pycocotools安装失败,参考[PaddleX 2.0.0安装](./install.md#paddlex-200安装)中介绍的解决方法。
-
-## <h2 id="2">2. PadldeX GUI开发模式安装</h2>
-
-
-   无代码开发的可视化客户端,应用PaddleX API实现,使开发者快速进行产业项目验证,并为用户开发自有深度学习软件/应用提供参照。
-
-- 前往[PaddleX官网](https://www.paddlepaddle.org.cn/paddle/paddlex),申请下载PaddleX GUI一键绿色安装包。
-
-- 前往[PaddleX GUI使用教程](./gui/how_to_use.md)了解PaddleX GUI使用详情。
-
-- [PaddleX GUI安装环境说明](./gui/download.md)
-
-
-## <h2 id="3">3. PaddleX Restful开发模式安装</h2>
-
-使用基于RESTful API开发的GUI与Web Demo实现远程的深度学习全流程开发;同时开发者也可以基于RESTful API开发个性化的可视化界面
-- 前往[PaddleX RESTful API使用教程](./Resful_API/docs/readme.md)  

+ 1 - 1
docs/quick_start_GUI.md

@@ -19,7 +19,7 @@
 ### 下载安装
 下载地址:https://www.paddlepaddle.org.cn/paddlex
 目前最新版本的GUI(Version 2.0.0)仅提供WIN和Linux版,暂未提供Mac版,若需在Mac上使用GUI,推荐安装Mac版历史版本Version 1.1.7
-- 特别说明:GUI 2.0要求CUDA >=11.0, cuDNN >= 8.0,这个需要加上说明
+- 特别说明:GUI 2.0要求CUDA >=11.0, cuDNN >= 8.0
 - WIN版下载后双击选择安装路径即可
 - Mac/Linux版下载后解压即可
 

+ 2 - 2
examples/helmet_detection/README.md

@@ -1,6 +1,6 @@
 # 安全帽检测
 
-> 基于Paddlex2.0 API开发
+> 基于PaddleX API 2.0 开发
 
 ## 1.项目说明
 
@@ -194,7 +194,7 @@ paddlex --export_inference --model_dir=output/yolov3_darknet53/best_model --save
 
 
 
-模型部署采用了PaddleX提供的C++ inference部署方案,在该方案中提供了C#部署[Demo](../../deploy/cpp/docs/C#_deploy),用户可根据实际情况自行参考。
+模型部署采用了PaddleX提供的C++ inference部署方案,在该方案中提供了C#部署[Demo](../../deploy/cpp/docs/CSharp_deploy),用户可根据实际情况自行参考。
 
 <div align="center">
 <img src="images/14.png"  width = "1024" /></div>

+ 1 - 1
examples/helmet_detection/accuracy_improvement.md

@@ -65,7 +65,7 @@
 
 - 通过选用适当更优的骨干网络可以改善漏检的情况,因此漏检方面的优化可以考虑先从骨干网络替换上开始——当然必要的数据清洗也是不可缺少的,要是数据集本身漏标,则会从根本上影响模型的学习。
 - 通过放大图像,可以对一些中小目标的物体检测起到一定的优化作用。
-- 通过聚类anchor以及iou_aware等操作可以提高模型的定位能力,直接体现是在高Iou上也能有更好的表现。【因此,定位不准可以从模型的anchor以及模型的结构上入手进行优化】
+- 通过聚类anchor以及iou_aware等操作可以提高模型的定位能力,直接体现是在高IoU上也能有更好的表现。【因此,定位不准可以从模型的anchor以及模型的结构上入手进行优化】
 
 # (3) 数据增强选择
 

+ 1 - 1
examples/meter_reader/README.md

@@ -484,4 +484,4 @@ Meter 2: 6.21739101
 在分割模型可视化的预测结果保存在`PaddleX\examples\meter_reader\deploy\cpp\meter_reader\out\build\x64-Release\output_seg`,可以点击进行查看:
 | 表1可视化分割结果 | 表2可视化分割结果|
 | -- | -- |
-| ![](./images/20190822_168_06-30-17-09-33-217.jpg) | ![](20190822_168_06-30-17-09-33-213.jpg) |
+| ![](./images/20190822_168_06-30-17-09-33-217.jpg) | ![](./images/20190822_168_06-30-17-09-33-213.jpg) |