From bc437a49d39f85cea58b37863341bd11e3bef368 Mon Sep 17 00:00:00 2001 From: zhiboniu <31800336+zhiboniu@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:48:54 +0800 Subject: [PATCH] infer deploy:fix trt keypointbatchsize; lite deploy: update total pipeline time from per person to per image (#4339) --- deploy/cpp/src/main_keypoint.cc | 2 +- deploy/lite/src/main.cc | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/deploy/cpp/src/main_keypoint.cc b/deploy/cpp/src/main_keypoint.cc index 7c7112117..facd787dd 100644 --- a/deploy/cpp/src/main_keypoint.cc +++ b/deploy/cpp/src/main_keypoint.cc @@ -445,7 +445,7 @@ int main(int argc, char** argv) { if (!FLAGS_model_dir_keypoint.empty()) { keypoint = new PaddleDetection::KeyPointDetector(FLAGS_model_dir_keypoint, FLAGS_device, FLAGS_use_mkldnn, - FLAGS_cpu_threads, FLAGS_run_mode, FLAGS_batch_size,FLAGS_gpu_id, + FLAGS_cpu_threads, FLAGS_run_mode, FLAGS_batch_size_keypoint, FLAGS_gpu_id, FLAGS_trt_min_shape, FLAGS_trt_max_shape, FLAGS_trt_opt_shape, FLAGS_trt_calib_mode, FLAGS_use_dark); } diff --git a/deploy/lite/src/main.cc b/deploy/lite/src/main.cc index cf0651091..0e67b78cc 100644 --- a/deploy/lite/src/main.cc +++ b/deploy/lite/src/main.cc @@ -76,11 +76,11 @@ void PrintTotalIimeLog(double det_time, double crop_time) { std::cout << "----------------------- Time info ------------------------" << std::endl; - std::cout << "Total Pipeline time(ms): " + std::cout << "Total Pipeline time(ms) per image: " << det_time + keypoint_time + crop_time << std::endl; - std::cout << "average det time(ms): " << det_time - << ", average keypoint time(ms): " << keypoint_time - << ", average crop time(ms): " << crop_time << std::endl; + std::cout << "Average det time(ms) per image: " << det_time + << ", average keypoint time(ms) per image: " << keypoint_time + << ", average crop time(ms) per image: " << crop_time << std::endl; } static std::string DirName(const std::string& filepath) { @@ -287,10 +287,11 @@ void PredictImage(const std::vector all_img_paths, PrintBenchmarkLog(det_t, all_img_paths.size()); if (keypoint) { PrintBenchmarkLog(keypoint_t, kpts_imgs); - } - PrintTotalIimeLog((det_t[0] + det_t[1] + det_t[2]) / all_img_paths.size(), - (keypoint_t[0] + keypoint_t[1] + keypoint_t[2]) / kpts_imgs, + PrintTotalIimeLog((det_t[0] + det_t[1] + det_t[2]) / all_img_paths.size(), + (keypoint_t[0] + keypoint_t[1] + keypoint_t[2]) / all_img_paths.size(), midtimecost / all_img_paths.size()); + } + } int main(int argc, char** argv) { -- GitLab