From f9699671794ff79e055f705e655ea6cb9938f950 Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Sat, 14 Jan 2023 20:44:10 +0800 Subject: [PATCH] [Lite] Support PaddleYOLOv8 with Lite Backend (#1145) * [Model] Support PaddleYOLOv8 model * [YOLOv8] Add PaddleYOLOv8 pybind * [Other] update from latest develop (#30) * [Backend] Remove all lite options in RuntimeOption (#1109) * Remove all lite options in RuntimeOption * Fix code error * move pybind * Fix build error * [Backend] Add TensorRT FP16 support for AdaptivePool2d (#1116) * add fp16 cuda kernel * fix code bug * update code * [Doc] Fix KunlunXin doc (#1139) fix kunlunxin doc * [Model] Support PaddleYOLOv8 model (#1136) Co-authored-by: Jason Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> * [YOLOv8] add PaddleYOLOv8 pybind11 (#1144) (#31) * [Model] Support PaddleYOLOv8 model * [YOLOv8] Add PaddleYOLOv8 pybind * [Other] update from latest develop (#30) * [Backend] Remove all lite options in RuntimeOption (#1109) * Remove all lite options in RuntimeOption * Fix code error * move pybind * Fix build error * [Backend] Add TensorRT FP16 support for AdaptivePool2d (#1116) * add fp16 cuda kernel * fix code bug * update code * [Doc] Fix KunlunXin doc (#1139) fix kunlunxin doc * [Model] Support PaddleYOLOv8 model (#1136) Co-authored-by: Jason Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> Co-authored-by: Jason Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> Co-authored-by: Jason Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> * [benchmark] add PaddleYOLOv8 -> benchmark * [benchmark] add PaddleYOLOv8 -> benchmark * [Lite] Support PaddleYOLOv8 with Lite Backend Co-authored-by: Jason Co-authored-by: yeliang2258 <30516196+yeliang2258@users.noreply.github.com> --- benchmark/benchmark_ppdet.py | 7 +++++-- fastdeploy/vision/detection/ppdet/model.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/benchmark/benchmark_ppdet.py b/benchmark/benchmark_ppdet.py index 8f7033db4f..6544c7e601 100755 --- a/benchmark/benchmark_ppdet.py +++ b/benchmark/benchmark_ppdet.py @@ -17,7 +17,7 @@ import os import numpy as np import time - +from tqdm import tqdm def parse_arguments(): import argparse @@ -263,6 +263,9 @@ def cpu_stat_func(self, q, pid, interval=0.0): elif "yolov3" in args.model: model = fd.vision.detection.YOLOv3( model_file, params_file, config_file, runtime_option=option) + elif "yolov8" in args.model: + model = fd.vision.detection.PaddleYOLOv8( + model_file, params_file, config_file, runtime_option=option) elif "ppyolo_r50vd_dcn_1x_coco" in args.model or "ppyolov2_r101vd_dcn_365e_coco" in args.model: model = fd.vision.detection.PPYOLO( model_file, params_file, config_file, runtime_option=option) @@ -284,7 +287,7 @@ def cpu_stat_func(self, q, pid, interval=0.0): model.enable_record_time_of_runtime() im_ori = cv2.imread(args.image) - for i in range(args.iter_num): + for i in tqdm(range(args.iter_num)): im = im_ori start = time.time() result = model.predict(im) diff --git a/fastdeploy/vision/detection/ppdet/model.h b/fastdeploy/vision/detection/ppdet/model.h index a3797bdb8b..1a33c47713 100755 --- a/fastdeploy/vision/detection/ppdet/model.h +++ b/fastdeploy/vision/detection/ppdet/model.h @@ -253,7 +253,7 @@ class FASTDEPLOY_DECL PaddleYOLOv8 : public PPDetBase { const ModelFormat& model_format = ModelFormat::PADDLE) : PPDetBase(model_file, params_file, config_file, custom_option, model_format) { - valid_cpu_backends = {Backend::OPENVINO, Backend::ORT, Backend::PDINFER}; + valid_cpu_backends = {Backend::OPENVINO, Backend::ORT, Backend::PDINFER, Backend::LITE}; valid_gpu_backends = {Backend::ORT, Backend::PDINFER, Backend::TRT}; valid_kunlunxin_backends = {Backend::LITE}; initialized = Initialize();