diff --git a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_picodet.cc b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_picodet.cc index 61e6aeb26..f4e14a5d9 100644 --- a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_picodet.cc +++ b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_picodet.cc @@ -58,7 +58,7 @@ void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) { model.GetPreprocessor().DisablePermute(); model.GetPreprocessor().DisableNormalize(); - model.GetPostprocessor().ApplyDecodeAndNMS(); + model.GetPostprocessor().ApplyNMS(); auto im = cv::imread(image_file); diff --git a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_ppyoloe_demo.cc b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_ppyoloe_demo.cc index 098c6a44e..7d13fda5f 100644 --- a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_ppyoloe_demo.cc +++ b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_ppyoloe_demo.cc @@ -43,7 +43,8 @@ void ONNXInfer(const std::string& model_dir, const std::string& image_file) { } void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) { - auto model_file = model_dir + "/ppyoloe_plus_crn_s_80e_coco_rk3588_quantized.rknn"; + auto model_file = + model_dir + "/ppyoloe_plus_crn_s_80e_coco_rk3588_quantized.rknn"; auto params_file = ""; auto config_file = model_dir + "/infer_cfg.yml"; @@ -57,7 +58,7 @@ void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) { model.GetPreprocessor().DisablePermute(); model.GetPreprocessor().DisableNormalize(); - model.GetPostprocessor().ApplyDecodeAndNMS(); + model.GetPostprocessor().ApplyNMS(); auto im = cv::imread(image_file); diff --git a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_yolov8.cc b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_yolov8.cc index cf8dcd3b6..87a8dc663 100644 --- a/examples/vision/detection/paddledetection/rknpu2/cpp/infer_yolov8.cc +++ b/examples/vision/detection/paddledetection/rknpu2/cpp/infer_yolov8.cc @@ -57,7 +57,7 @@ void RKNPU2Infer(const std::string& model_dir, const std::string& image_file) { model.GetPreprocessor().DisablePermute(); model.GetPreprocessor().DisableNormalize(); - model.GetPostprocessor().ApplyDecodeAndNMS(); + model.GetPostprocessor().ApplyNMS(); auto im = cv::imread(image_file); diff --git a/examples/vision/detection/paddledetection/rknpu2/python/README.md b/examples/vision/detection/paddledetection/rknpu2/python/README.md index 6ba45c398..cd7a04ab5 100644 --- a/examples/vision/detection/paddledetection/rknpu2/python/README.md +++ b/examples/vision/detection/paddledetection/rknpu2/python/README.md @@ -12,11 +12,10 @@ This directory provides `infer.py` for a quick example of Picodet deployment on git clone https://github.com/PaddlePaddle/FastDeploy.git cd FastDeploy/examples/vision/detection/paddledetection/rknpu2/python -# Download images. +# Download images and model wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg - -# copy model -cp -r ./picodet_s_416_coco_lcnet /path/to/FastDeploy/examples/vision/detection/rknpu2detection/paddledetection/python +wget https://bj.bcebos.com/paddlehub/fastdeploy/rknpu2/picodet_s_416_coco_lcnet.zip +unzip picodet_s_416_coco_lcnet.zip # Inference. python3 infer.py --model_file ./picodet_s_416_coco_lcnet/picodet_s_416_coco_lcnet_rk3568.rknn \ diff --git a/examples/vision/detection/paddledetection/rknpu2/python/README_CN.md b/examples/vision/detection/paddledetection/rknpu2/python/README_CN.md index e80a29fc4..ff60c7a88 100644 --- a/examples/vision/detection/paddledetection/rknpu2/python/README_CN.md +++ b/examples/vision/detection/paddledetection/rknpu2/python/README_CN.md @@ -15,8 +15,10 @@ cd FastDeploy/examples/vision/detection/paddledetection/rknpu2/python # 下载图片 wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg -# copy model -cp -r ./picodet_s_416_coco_lcnet /path/to/FastDeploy/examples/vision/detection/rknpu2detection/paddledetection/python +# 下载PPYOLOE模型文件和测试图片 +wget https://bj.bcebos.com/paddlehub/fastdeploy/rknpu2/picodet_s_416_coco_lcnet.zip +unzip picodet_s_416_coco_lcnet.zip +wget https://gitee.com/paddlepaddle/PaddleDetection/raw/release/2.4/demo/000000014439.jpg # 推理 python3 infer.py --model_file ./picodet_s_416_coco_lcnet/picodet_s_416_coco_lcnet_rk3568.rknn \ diff --git a/examples/vision/detection/paddledetection/rknpu2/python/infer.py b/examples/vision/detection/paddledetection/rknpu2/python/infer.py index 2617acd95..1833fd1ef 100644 --- a/examples/vision/detection/paddledetection/rknpu2/python/infer.py +++ b/examples/vision/detection/paddledetection/rknpu2/python/infer.py @@ -55,7 +55,7 @@ if __name__ == "__main__": model_format=fd.ModelFormat.RKNN) model.preprocessor.disable_normalize() model.preprocessor.disable_permute() - model.postprocessor.apply_decode_and_nms() + model.postprocessor.apply_nms() # 预测图片分割结果 im = cv2.imread(args.image) diff --git a/python/fastdeploy/vision/detection/ppdet/__init__.py b/python/fastdeploy/vision/detection/ppdet/__init__.py index b5a23d1d7..0f15f031a 100644 --- a/python/fastdeploy/vision/detection/ppdet/__init__.py +++ b/python/fastdeploy/vision/detection/ppdet/__init__.py @@ -74,14 +74,14 @@ class PaddleDetPostprocessor: return self._postprocessor.run(runtime_results) def apply_nms(self): - self.apply_nms() + self._postprocessor.apply_nms() def set_nms_option(self, nms_option=None): """This function will enable decode and nms in postprocess step. """ if nms_option is None: nms_option = NMSOption() - self._postprocessor.ApplyDecodeAndNMS(self, nms_option.nms_option) + self._postprocessor.set_nms_option(self, nms_option.nms_option) class PPYOLOE(FastDeployModel):