diff --git a/ros/rpt2D_wrapper_cpp/src/utils_2d_pose.hpp b/ros/rpt2D_wrapper_cpp/src/utils_2d_pose.hpp index bb7864d..fa97ecb 100644 --- a/ros/rpt2D_wrapper_cpp/src/utils_2d_pose.hpp +++ b/ros/rpt2D_wrapper_cpp/src/utils_2d_pose.hpp @@ -103,10 +103,24 @@ namespace utils_2d_pose OrtTensorRTProviderOptionsV2 *tensorrt_options = nullptr; Ort::ThrowOnError(Ort::GetApi().CreateTensorRTProviderOptions(&tensorrt_options)); - // 2) Configure your desired fields - tensorrt_options->trt_fp16_enable = 1; + // 2) Configure runtime options + tensorrt_options->trt_max_workspace_size = 2147483647; tensorrt_options->trt_engine_cache_enable = 1; tensorrt_options->trt_engine_cache_path = "/RapidPoseTriangulation/data/trt_cache/"; + if (model_path.find("_fp16") != std::string::npos) + { + tensorrt_options->trt_fp16_enable = 1; + } + else + { + tensorrt_options->trt_fp16_enable = 0; + } + if (model_path.find("_Bx") != std::string::npos) + { + tensorrt_options->trt_profile_min_shapes = "image_input:1x384x288x3"; + tensorrt_options->trt_profile_max_shapes = "image_input:10x384x288x3"; + tensorrt_options->trt_profile_opt_shapes = "image_input:3x384x288x3"; + } // 3) Append to session options Ort::ThrowOnError( @@ -980,8 +994,8 @@ namespace utils_2d_pose std::string path_pose_m1 = base_path + "rtmpose-m_1x384x288x3_fp16_extra-steps.onnx"; std::string path_pose_mb = base_path + "rtmpose-m_Bx384x288x3_fp16_extra-steps.onnx"; - std::string path_pose_w1 = base_path + "rtmpose-l_wb_1x384x288x3_fp16_extra-steps.onnx"; - std::string path_pose_wb = base_path + "rtmpose-l_wb_Bx384x288x3_fp16_extra-steps.onnx"; + std::string path_pose_w1 = base_path + "rtmpose-l_wb_1x384x288x3_extra-steps.onnx"; + std::string path_pose_wb = base_path + "rtmpose-l_wb_Bx384x288x3_extra-steps.onnx"; this->num_joints = whole_body ? 133 : 17; std::string path_pose;