From 02d29aa0c33835d900c0e706cc78906222f75d38 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Tue, 12 Jul 2022 02:51:41 +0000 Subject: [PATCH 1/8] update .gitignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitignore b/.gitignore index b2602607a9..b268868c02 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,12 @@ fastdeploy/libs/lib* +build +cmake-build-debug +cmake-build-release +.vscode +FastDeploy.cmake +fastdeploy/core/config.h +build-debug.sh +*dist +fastdeploy.egg-info +.setuptools-cmake-build +fastdeploy/version.py \ No newline at end of file From afa81147a6df3a7072912231cdd9cbd1c02282e4 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Tue, 12 Jul 2022 06:41:55 +0000 Subject: [PATCH 2/8] Added checking for cmake include dir --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bbc8139b9..2ff2b85f01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,13 +172,15 @@ install( TARGETS fastdeploy LIBRARY DESTINATION lib ) -install( - DIRECTORY ${PROJECT_SOURCE_DIR}/fastdeploy - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING - PATTERN "*.h" - PATTERN "${PROJECT_SOURCE_DIR}/fastdeploy/backends/*/*.h" -) +if (DEFINED CMAKE_INSTALL_INCLUDEDIR) + install( + DIRECTORY ${PROJECT_SOURCE_DIR}/fastdeploy + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILES_MATCHING + PATTERN "*.h" + PATTERN "${PROJECT_SOURCE_DIR}/fastdeploy/backends/*/*.h" + ) +endif() install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third_libs/install DESTINATION ${CMAKE_INSTALL_PREFIX}/third_libs From 659c14c5b90028fba4440af02ef942796f03a5a3 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Tue, 12 Jul 2022 06:44:21 +0000 Subject: [PATCH 3/8] fixed missing trt_backend option bug when init from trt --- fastdeploy/backends/tensorrt/trt_backend.cc | 3 ++- fastdeploy/backends/tensorrt/trt_backend.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fastdeploy/backends/tensorrt/trt_backend.cc b/fastdeploy/backends/tensorrt/trt_backend.cc index dfc2840c2b..5dbb61ffe8 100644 --- a/fastdeploy/backends/tensorrt/trt_backend.cc +++ b/fastdeploy/backends/tensorrt/trt_backend.cc @@ -52,7 +52,8 @@ std::vector toVec(const nvinfer1::Dims& dim) { return out; } -bool TrtBackend::InitFromTrt(const std::string& trt_engine_file) { +bool TrtBackend::InitFromTrt(const std::string& trt_engine_file, + const TrtBackendOption& option) { if (initialized_) { FDERROR << "TrtBackend is already initlized, cannot initialize again." << std::endl; diff --git a/fastdeploy/backends/tensorrt/trt_backend.h b/fastdeploy/backends/tensorrt/trt_backend.h index 3b77c8bc24..e3f848a012 100644 --- a/fastdeploy/backends/tensorrt/trt_backend.h +++ b/fastdeploy/backends/tensorrt/trt_backend.h @@ -69,7 +69,8 @@ class TrtBackend : public BaseBackend { bool InitFromOnnx(const std::string& model_file, const TrtBackendOption& option = TrtBackendOption(), bool from_memory_buffer = false); - bool InitFromTrt(const std::string& trt_engine_file); + bool InitFromTrt(const std::string& trt_engine_file, + const TrtBackendOption& option = TrtBackendOption()); bool Infer(std::vector& inputs, std::vector* outputs); From 17a43cebd0507ee02ee3234958ce49cc52ad8c16 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Tue, 12 Jul 2022 06:46:38 +0000 Subject: [PATCH 4/8] remove un-need data layout and add pre-check for dtype --- fastdeploy/vision/common/processors/cast.cc | 34 +++++++++++++-------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/fastdeploy/vision/common/processors/cast.cc b/fastdeploy/vision/common/processors/cast.cc index 2f8a0993ec..77a1b249ae 100644 --- a/fastdeploy/vision/common/processors/cast.cc +++ b/fastdeploy/vision/common/processors/cast.cc @@ -18,30 +18,40 @@ namespace fastdeploy { namespace vision { bool Cast::CpuRun(Mat* mat) { - if (mat->layout != Layout::CHW) { - FDERROR << "Cast: The input data must be Layout::HWC format!" << std::endl; - return false; - } cv::Mat* im = mat->GetCpuMat(); + int c = im->channels(); if (dtype_ == "float") { - im->convertTo(*im, CV_32FC(im->channels())); + if (im->type() != CV_32FC(c)) { + im->convertTo(*im, CV_32FC(c)); + } } else if (dtype_ == "double") { - im->convertTo(*im, CV_64FC(im->channels())); + if (im->type() != CV_64FC(c)) { + im->convertTo(*im, CV_64FC(c)); + } + } else { + FDLogger() << "[WARN] Cast not support for " << dtype_ + << " now! will skip this operation." + << std::endl; } return true; } #ifdef ENABLE_OPENCV_CUDA bool Cast::GpuRun(Mat* mat) { - if (mat->layout != Layout::CHW) { - FDERROR << "Cast: The input data must be Layout::HWC format!" << std::endl; - return false; - } cv::cuda::GpuMat* im = mat->GetGpuMat(); + int c = im->channels(); if (dtype_ == "float") { - im->convertTo(*im, CV_32FC(im->channels())); + if (im->type() != CV_32FC(c)) { + im->convertTo(*im, CV_32FC(c)); + } } else if (dtype_ == "double") { - im->convertTo(*im, CV_64FC(im->channels())); + if (im->type() != CV_64FC(c)) { + im->convertTo(*im, CV_64FC(c)); + } + } else { + FDLogger() << "[WARN] Cast not support for " << dtype_ + << " now! will skip this operation." + << std::endl; } return true; } From 75948f831317bacfb77bc70a8be7289f55f093eb Mon Sep 17 00:00:00 2001 From: DefTruth Date: Tue, 12 Jul 2022 06:48:36 +0000 Subject: [PATCH 5/8] changed RGB2BRG to BGR2RGB in ppcls model --- fastdeploy/vision/ppcls/model.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastdeploy/vision/ppcls/model.cc b/fastdeploy/vision/ppcls/model.cc index ad894f3daf..915cb97512 100644 --- a/fastdeploy/vision/ppcls/model.cc +++ b/fastdeploy/vision/ppcls/model.cc @@ -44,7 +44,7 @@ bool Model::BuildPreprocessPipelineFromConfig() { return false; } auto preprocess_cfg = cfg["PreProcess"]["transform_ops"]; - processors_.push_back(std::make_shared()); + processors_.push_back(std::make_shared()); for (const auto& op : preprocess_cfg) { FDASSERT(op.IsMap(), "Require the transform information in yaml be Map type."); From f847490b978ff6b60d31c7825e2671ad8e97d7a9 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Thu, 14 Jul 2022 05:58:15 +0000 Subject: [PATCH 6/8] add model_zoo yolov6 c++/python demo --- fastdeploy/download.py | 1 + fastdeploy/fastdeploy_runtime.py | 2 +- fastdeploy/vision/__init__.py | 1 + fastdeploy/vision/vision_pybind.cc | 4 ++ model_zoo/.gitignore | 12 ++++ model_zoo/vision/yolov5/api.md | 8 +-- model_zoo/vision/yolov6/README.md | 45 ++++++++++++++ model_zoo/vision/yolov6/api.md | 71 ++++++++++++++++++++++ model_zoo/vision/yolov6/cpp/CMakeLists.txt | 17 ++++++ model_zoo/vision/yolov6/cpp/README.md | 0 model_zoo/vision/yolov6/cpp/yolov6.cc | 40 ++++++++++++ model_zoo/vision/yolov6/yolov6.py | 24 ++++++++ 12 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 model_zoo/.gitignore create mode 100644 model_zoo/vision/yolov6/README.md create mode 100644 model_zoo/vision/yolov6/api.md create mode 100644 model_zoo/vision/yolov6/cpp/CMakeLists.txt create mode 100644 model_zoo/vision/yolov6/cpp/README.md create mode 100644 model_zoo/vision/yolov6/cpp/yolov6.cc create mode 100644 model_zoo/vision/yolov6/yolov6.py diff --git a/fastdeploy/download.py b/fastdeploy/download.py index 805f63636e..e00af098df 100644 --- a/fastdeploy/download.py +++ b/fastdeploy/download.py @@ -18,6 +18,7 @@ import requests import time import zipfile +import tarfile import hashlib import tqdm import logging diff --git a/fastdeploy/fastdeploy_runtime.py b/fastdeploy/fastdeploy_runtime.py index 3eef861f2f..4b7acb25ed 100644 --- a/fastdeploy/fastdeploy_runtime.py +++ b/fastdeploy/fastdeploy_runtime.py @@ -51,5 +51,5 @@ def runtime_option(self): @property def initialized(self): if self._model is None: - return false + return False return self._model.initialized() diff --git a/fastdeploy/vision/__init__.py b/fastdeploy/vision/__init__.py index 810b23cd3d..81a1424727 100644 --- a/fastdeploy/vision/__init__.py +++ b/fastdeploy/vision/__init__.py @@ -16,4 +16,5 @@ from . import evaluation from . import ppcls from . import ultralytics +from . import meituan from . import visualize diff --git a/fastdeploy/vision/vision_pybind.cc b/fastdeploy/vision/vision_pybind.cc index f3c3f0052d..604d808e07 100644 --- a/fastdeploy/vision/vision_pybind.cc +++ b/fastdeploy/vision/vision_pybind.cc @@ -18,6 +18,7 @@ namespace fastdeploy { void BindPpClsModel(pybind11::module& m); void BindUltralytics(pybind11::module& m); +void BindMeituan(pybind11::module& m); #ifdef ENABLE_VISION_VISUALIZE void BindVisualize(pybind11::module& m); #endif @@ -40,6 +41,9 @@ void BindVision(pybind11::module& m) { BindPpClsModel(m); BindUltralytics(m); + BindMeituan(m); +#ifdef ENABLE_VISION_VISUALIZE BindVisualize(m); +#endif } } // namespace fastdeploy diff --git a/model_zoo/.gitignore b/model_zoo/.gitignore new file mode 100644 index 0000000000..e3919c57f9 --- /dev/null +++ b/model_zoo/.gitignore @@ -0,0 +1,12 @@ +*.png +*.jpg +*.jpeg +*.onnx +*.zip +*.tar +*.pd* +*.engine +*.trt +*.nb +*.tgz +*.gz diff --git a/model_zoo/vision/yolov5/api.md b/model_zoo/vision/yolov5/api.md index 8c9d5675d0..66d6acdc77 100644 --- a/model_zoo/vision/yolov5/api.md +++ b/model_zoo/vision/yolov5/api.md @@ -23,7 +23,7 @@ YOLOv5模型加载和初始化,当model_format为`fd.Frontend.ONNX`时,只 > > **参数** > -> > * **image_data**(np.ndarray): 输入数据,注意需为HWC,RGB格式 +> > * **image_data**(np.ndarray): 输入数据,注意需为HWC,BGR格式 > > * **conf_threshold**(float): 检测框置信度过滤阈值 > > * **nms_iou_threshold**(float): NMS处理过程中iou阈值 @@ -49,9 +49,9 @@ YOLOv5模型加载和初始化,当model_format为`Frontend::ONNX`时,只需 > * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置 > * **model_format**(Frontend): 模型格式 -#### predict函数 +#### Predict函数 > ``` -> YOLOv5::predict(cv::Mat* im, DetectionResult* result, +> YOLOv5::Predict(cv::Mat* im, DetectionResult* result, > float conf_threshold = 0.25, > float nms_iou_threshold = 0.5) > ``` @@ -59,7 +59,7 @@ YOLOv5模型加载和初始化,当model_format为`Frontend::ONNX`时,只需 > > **参数** > -> > * **im**: 输入图像,注意需为HWC,RGB格式 +> > * **im**: 输入图像,注意需为HWC,BGR格式 > > * **result**: 检测结果,包括检测框,各个框的置信度 > > * **conf_threshold**: 检测框置信度过滤阈值 > > * **nms_iou_threshold**: NMS处理过程中iou阈值 diff --git a/model_zoo/vision/yolov6/README.md b/model_zoo/vision/yolov6/README.md new file mode 100644 index 0000000000..5fa3578bfc --- /dev/null +++ b/model_zoo/vision/yolov6/README.md @@ -0,0 +1,45 @@ +# YOLOv6部署示例 + +本文档说明如何进行[YOLOv6](https://github.com/meituan/YOLOv6)的快速部署推理。本目录结构如下 +``` +. +├── cpp # C++ 代码目录 +│   ├── CMakeLists.txt # C++ 代码编译CMakeLists文件 +│   ├── README.md # C++ 代码编译部署文档 +│   └── yolov6.cc # C++ 示例代码 +├── README.md # YOLOv6 部署文档 +└── yolov6.py # Python示例代码 +``` + +## 安装FastDeploy + +使用如下命令安装FastDeploy,注意到此处安装的是`vision-cpu`,也可根据需求安装`vision-gpu` +``` +# 安装fastdeploy-python工具 +pip install fastdeploy-python + +# 安装vision-cpu模块 +fastdeploy install vision-cpu +``` + +## Python部署 + +执行如下代码即会自动下载YOLOv6模型和测试图片 +``` +python yolov6.py +``` + +执行完成后会将可视化结果保存在本地`vis_result.jpg`,同时输出检测结果如下 +``` +DetectionResult: [xmin, ymin, xmax, ymax, score, label_id] +11.772949,229.269287, 792.933838, 748.294189, 0.954794, 5 +667.140381,396.185455, 807.701721, 881.810120, 0.900997, 0 +223.271011,405.105743, 345.740723, 859.328552, 0.898938, 0 +50.135777,405.863129, 245.485519, 904.153809, 0.888936, 0 +0.000000,549.002869, 77.864723, 869.455017, 0.614145, 0 +``` + +## 其它文档 + +- [C++部署](./cpp/README.md) +- [YOLOv6 API文档](./api.md) diff --git a/model_zoo/vision/yolov6/api.md b/model_zoo/vision/yolov6/api.md new file mode 100644 index 0000000000..eca89f06aa --- /dev/null +++ b/model_zoo/vision/yolov6/api.md @@ -0,0 +1,71 @@ +# YOLOv6 API说明 + +## Python API + +### YOLOv6类 +``` +fastdeploy.vision.meituan.YOLOv6(model_file, params_file=None, runtime_option=None, model_format=fd.Frontend.ONNX) +``` +YOLOv6模型加载和初始化,当model_format为`fd.Frontend.ONNX`时,只需提供model_file,如`yolov6s.onnx`;当model_format为`fd.Frontend.PADDLE`时,则需同时提供model_file和params_file。 + +**参数** + +> * **model_file**(str): 模型文件路径 +> * **params_file**(str): 参数文件路径 +> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置 +> * **model_format**(Frontend): 模型格式 + +#### predict函数 +> ``` +> YOLOv6.predict(image_data, conf_threshold=0.25, nms_iou_threshold=0.5) +> ``` +> 模型预测结口,输入图像直接输出检测结果。 +> +> **参数** +> +> > * **image_data**(np.ndarray): 输入数据,注意需为HWC,BGR格式 +> > * **conf_threshold**(float): 检测框置信度过滤阈值 +> > * **nms_iou_threshold**(float): NMS处理过程中iou阈值 + +示例代码参考[yolov6.py](./yolov6.py) + + +## C++ API + +### YOLOv6类 +``` +fastdeploy::vision::meituan::YOLOv6( + const string& model_file, + const string& params_file = "", + const RuntimeOption& runtime_option = RuntimeOption(), + const Frontend& model_format = Frontend::ONNX) +``` +YOLOv6模型加载和初始化,当model_format为`Frontend::ONNX`时,只需提供model_file,如`yolov6s.onnx`;当model_format为`Frontend::PADDLE`时,则需同时提供model_file和params_file。 + +**参数** + +> * **model_file**(str): 模型文件路径 +> * **params_file**(str): 参数文件路径 +> * **runtime_option**(RuntimeOption): 后端推理配置,默认为None,即采用默认配置 +> * **model_format**(Frontend): 模型格式 + +#### Predict函数 +> ``` +> YOLOv6::Predict(cv::Mat* im, DetectionResult* result, +> float conf_threshold = 0.25, +> float nms_iou_threshold = 0.5) +> ``` +> 模型预测接口,输入图像直接输出检测结果。 +> +> **参数** +> +> > * **im**: 输入图像,注意需为HWC,BGR格式 +> > * **result**: 检测结果,包括检测框,各个框的置信度 +> > * **conf_threshold**: 检测框置信度过滤阈值 +> > * **nms_iou_threshold**: NMS处理过程中iou阈值 + +示例代码参考[cpp/yolov6.cc](cpp/yolov6.cc) + +## 其它API使用 + +- [模型部署RuntimeOption配置](../../../docs/api/runtime_option.md) diff --git a/model_zoo/vision/yolov6/cpp/CMakeLists.txt b/model_zoo/vision/yolov6/cpp/CMakeLists.txt new file mode 100644 index 0000000000..28987f7f75 --- /dev/null +++ b/model_zoo/vision/yolov6/cpp/CMakeLists.txt @@ -0,0 +1,17 @@ +PROJECT(yolov6_demo C CXX) +CMAKE_MINIMUM_REQUIRED (VERSION 3.16) + +# 在低版本ABI环境中,通过如下代码进行兼容性编译 +# add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) + +# 指定下载解压后的fastdeploy库路径 +set(FASTDEPLOY_INSTALL_DIR ${PROJECT_SOURCE_DIR}/fastdeploy-linux-x64-0.0.3/) + +include(${FASTDEPLOY_INSTALL_DIR}/FastDeploy.cmake) + +# 添加FastDeploy依赖头文件 +include_directories(${FASTDEPLOY_INCS}) + +add_executable(yolov6_demo ${PROJECT_SOURCE_DIR}/yolov6.cc) +# 添加FastDeploy库依赖 +target_link_libraries(yolov6_demo ${FASTDEPLOY_LIBS}) diff --git a/model_zoo/vision/yolov6/cpp/README.md b/model_zoo/vision/yolov6/cpp/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/model_zoo/vision/yolov6/cpp/yolov6.cc b/model_zoo/vision/yolov6/cpp/yolov6.cc new file mode 100644 index 0000000000..62d2fa0be3 --- /dev/null +++ b/model_zoo/vision/yolov6/cpp/yolov6.cc @@ -0,0 +1,40 @@ +// Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "fastdeploy/vision.h" + +int main() { + namespace vis = fastdeploy::vision; + auto model = vis::meituan::YOLOv6("yolov6s.onnx"); + if (!model.Initialized()) { + std::cerr << "Init Failed." << std::endl; + return -1; + } + cv::Mat im = cv::imread("bus.jpg"); + cv::Mat vis_im = im.clone(); + + vis::DetectionResult res; + if (!model.Predict(&im, &res)) { + std::cerr << "Prediction Failed." << std::endl; + return -1; + } + + // 输出预测框结果 + std::cout << res.Str() << std::endl; + + // 可视化预测结果 + vis::Visualize::VisDetection(&vis_im, res); + cv::imwrite("vis_result.jpg", vis_im); + return 0; +} diff --git a/model_zoo/vision/yolov6/yolov6.py b/model_zoo/vision/yolov6/yolov6.py new file mode 100644 index 0000000000..5172679c97 --- /dev/null +++ b/model_zoo/vision/yolov6/yolov6.py @@ -0,0 +1,24 @@ +import fastdeploy as fd +import cv2 + +# 下载模型和测试图片 +model_url = "https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6s.onnx" +test_jpg_url = "https://raw.githubusercontent.com/ultralytics/yolov5/master/data/images/bus.jpg" +fd.download(model_url, ".", show_progress=True) +fd.download(test_jpg_url, ".", show_progress=True) + +# 加载模型 +model = fd.vision.meituan.YOLOv6("yolov6s.onnx") +print(model.is_dynamic_shape()) + +# 预测图片 +im = cv2.imread("bus.jpg") +result = model.predict(im, conf_threshold=0.25, nms_iou_threshold=0.5) + +# 可视化结果 +fd.vision.visualize.vis_detection(im, result) +cv2.imwrite("vis_result.jpg", im) + +# 输出预测结果 +print(result) +print(model.runtime_option) From c56fdc37d0b9019ccd53c7c8db406a36b9566909 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Thu, 14 Jul 2022 06:04:37 +0000 Subject: [PATCH 7/8] fixed CMakeLists.txt typos --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 654d28624c..6bb2638b2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,8 @@ option(ENABLE_VISION_VISUALIZE "if to enable visualize vision model result toolb option(ENABLE_OPENCV_CUDA "if to enable opencv with cuda, this will allow process image with GPU." OFF) option(ENABLE_DEBUG "if to enable print debug information, this may reduce performance." OFF) -# Wheter to build fastdeply with vision/text/... examples, only for testings. -option(WTIH_VISION_EXAMPLES "wheter to build fastdeply with vision examples" ON) +# Whether to build fastdeply with vision/text/... examples, only for testings. +option(WTIH_VISION_EXAMPLES "Whether to build fastdeply with vision examples" ON) if(ENABLE_DEBUG) add_definitions(-DFASTDEPLOY_DEBUG) From 2300f57969f33579e6e78e985a7585a216077627 Mon Sep 17 00:00:00 2001 From: DefTruth Date: Thu, 14 Jul 2022 06:25:57 +0000 Subject: [PATCH 8/8] update yolov6 cpp/README.md --- model_zoo/vision/yolov6/cpp/README.md | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/model_zoo/vision/yolov6/cpp/README.md b/model_zoo/vision/yolov6/cpp/README.md index e69de29bb2..c7b4d4d7ab 100644 --- a/model_zoo/vision/yolov6/cpp/README.md +++ b/model_zoo/vision/yolov6/cpp/README.md @@ -0,0 +1,30 @@ +# 编译YOLOv6示例 + + +``` +# 下载和解压预测库 +wget https://bj.bcebos.com/paddle2onnx/fastdeploy/fastdeploy-linux-x64-0.0.3.tgz +tar xvf fastdeploy-linux-x64-0.0.3.tgz + +# 编译示例代码 +mkdir build & cd build +cmake .. +make -j + +# 下载模型和图片 +wget https://github.com/meituan/YOLOv6/releases/download/0.1.0/yolov6s.onnx +wget https://raw.githubusercontent.com/ultralytics/yolov5/master/data/images/bus.jpg + +# 执行 +./yolov6_demo +``` + +执行完后可视化的结果保存在本地`vis_result.jpg`,同时会将检测框输出在终端,如下所示 +``` +DetectionResult: [xmin, ymin, xmax, ymax, score, label_id] +11.772949,229.269287, 792.933838, 748.294189, 0.954794, 5 +667.140381,396.185455, 807.701721, 881.810120, 0.900997, 0 +223.271011,405.105743, 345.740723, 859.328552, 0.898938, 0 +50.135777,405.863129, 245.485519, 904.153809, 0.888936, 0 +0.000000,549.002869, 77.864723, 869.455017, 0.614145, 0 +```