diff --git a/benchmark/paddlex/benchmark_gpu_trt.sh b/benchmark/paddlex/benchmark_gpu_trt.sh index a40921d06..76e982beb 100755 --- a/benchmark/paddlex/benchmark_gpu_trt.sh +++ b/benchmark/paddlex/benchmark_gpu_trt.sh @@ -21,13 +21,14 @@ fi ./benchmark_ppdet --model PP-YOLOE+_crn_l_80e --image ppdet_det_img.jpg --config_path $CONFIG_PATH ./benchmark_ppdet --model rt_detr_hgnetv2_l --image ppdet_det_img.jpg --config_path $CONFIG_PATH ./benchmark_ppdet --model PP-PicoDet_s_320_lcnet --image ppdet_det_img.jpg --config_path $CONFIG_PATH --trt_shape 1,3,320,320:1,3,320,320:1,3,320,320 -./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img.jpg --config_path $CONFIG_PATH +./benchmark_ppdet --model dino_r50_4scale --image ppdet_det_img.jpg --config_path $CONFIG_PATH --trt_shape 1,3,800,800:1,3,800,800:1,3,800,800 + # PaddleSeg -./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH -./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH -./benchmark_ppseg --model PP-MobileSeg-Base --image ppseg_ade_val_512x512.png --config_path $CONFIG_PATH -./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo.png --config_path $CONFIG_PATH +./benchmark_ppseg --model OCRNet_HRNetW48 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH --trt_shape 1,3,512,512:1,3,512,512:1,3,512,512 +./benchmark_ppseg --model PP-LiteSeg-STDC1 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH --trt_shape 1,3,512,512:1,3,512,512:1,3,512,512 +./benchmark_ppseg --model SegFormer-B0 --image ppseg_cityscapes_demo_512x512.png --config_path $CONFIG_PATH --trt_shape 1,3,512,512:1,3,512,512:1,3,512,512 +./benchmark_ppseg --model PP-MobileSeg-Base --image ppseg_ade_val_512x512.png --config_path $CONFIG_PATH --trt_shape 1,3,512,2048:1,3,512,2048:1,3,512,2048 # PaddleOCR ./benchmark_ppocr_rec --model PP-OCRv4-mobile-rec --image ppocrv4_word_1.jpg --rec_label_file ppocr_keys_v1.txt --config_path $CONFIG_PATH diff --git a/benchmark/paddlex/benchmark_ppseg.cc b/benchmark/paddlex/benchmark_ppseg.cc index a380dcc55..d1180d928 100755 --- a/benchmark/paddlex/benchmark_ppseg.cc +++ b/benchmark/paddlex/benchmark_ppseg.cc @@ -19,9 +19,9 @@ namespace vision = fastdeploy::vision; namespace benchmark = fastdeploy::benchmark; -DEFINE_string(trt_shape, "1,3,256,256:1,3,1024,1024:1,3,2048,2048", +DEFINE_string(trt_shape, "1,3,512,512:1,3,512,512:1,3,512,512", "Set min/opt/max shape for trt/paddle_trt backend." - "eg:--trt_shape 1,3,256,256:1,3,1024,1024:1,3,2048,2048"); + "eg:--trt_shape 1,3,512,512:1,3,512,512:1,3,512,512"); int main(int argc, char* argv[]) { #if defined(ENABLE_BENCHMARK) && defined(ENABLE_VISION) @@ -52,6 +52,12 @@ int main(int argc, char* argv[]) { benchmark::ResultManager::GetInputShapes(FLAGS_trt_shape); option.trt_option.SetShape("x", trt_shapes[0], trt_shapes[1], trt_shapes[2]); + // option.paddle_infer_option.delete_pass_names = { + // "add_support_int8_pass", + // "conv_elementwise_add_fuse_pass", + // "conv_bn_fuse_pass", + // // "tensorrt_subgraph_pass", + // }; } auto model_ppseg = vision::segmentation::PaddleSegModel( model_file, params_file, config_file, option, model_format); diff --git a/benchmark/paddlex/get_models.sh b/benchmark/paddlex/get_models.sh index 6fcefb771..49b307ec3 100755 --- a/benchmark/paddlex/get_models.sh +++ b/benchmark/paddlex/get_models.sh @@ -70,6 +70,7 @@ wget https://bj.bcebos.com/paddlehub/fastdeploy_paddlex_2_0/ppdet_det_img.jpg # PaddleSeg wget https://bj.bcebos.com/paddlehub/fastdeploy_paddlex_2_0/ppseg_cityscapes_demo.png +wget https://bj.bcebos.com/paddlehub/fastdeploy_paddlex_2_0/ppseg_cityscapes_demo_512x512.png wget https://bj.bcebos.com/paddlehub/fastdeploy_paddlex_2_0/ppseg_ade_val_512x512.png # PaddleOCR diff --git a/fastdeploy/runtime/backends/paddle/paddle_backend.cc b/fastdeploy/runtime/backends/paddle/paddle_backend.cc index dcbf44431..81d8a1f37 100644 --- a/fastdeploy/runtime/backends/paddle/paddle_backend.cc +++ b/fastdeploy/runtime/backends/paddle/paddle_backend.cc @@ -24,22 +24,22 @@ void PaddleBackend::BuildOption(const PaddleBackendOption& option) { option_ = option; if (option.device == Device::GPU) { - auto inference_precision = paddle_infer::PrecisionType::kFloat32; if (option_.inference_precision == "float32"){ - FDINFO<<"Will inference_precision float32"<GetInputNames();