diff --git a/examples/vision/keypointdetection/tiny_pose/rknpu2/cpp/pptinypose_infer.cc b/examples/vision/keypointdetection/tiny_pose/rknpu2/cpp/pptinypose_infer.cc index f0b0a263e..d3c7f7b8c 100755 --- a/examples/vision/keypointdetection/tiny_pose/rknpu2/cpp/pptinypose_infer.cc +++ b/examples/vision/keypointdetection/tiny_pose/rknpu2/cpp/pptinypose_infer.cc @@ -18,6 +18,7 @@ void RKNPU2Infer(const std::string& tinypose_model_dir, const std::string& image_file) { auto tinypose_model_file = tinypose_model_dir + "/PP_TinyPose_256x192_infer_rk3588_unquantized.rknn"; + std::cout << tinypose_model_file << std::endl; auto tinypose_params_file = ""; auto tinypose_config_file = tinypose_model_dir + "/infer_cfg.yml"; auto option = fastdeploy::RuntimeOption(); diff --git a/fastdeploy/vision/keypointdet/pptinypose/pptinypose.cc b/fastdeploy/vision/keypointdet/pptinypose/pptinypose.cc index 598d8ae2b..f4b3bfc6c 100644 --- a/fastdeploy/vision/keypointdet/pptinypose/pptinypose.cc +++ b/fastdeploy/vision/keypointdet/pptinypose/pptinypose.cc @@ -135,10 +135,12 @@ bool PPTinyPose::Postprocess(std::vector& infer_result, KeyPointDetectionResult* result, const std::vector& center, const std::vector& scale) { - FDASSERT(infer_result[1].shape[0] == 1, + FDASSERT(infer_result[0].shape[0] == 1, "Only support batch = 1 in FastDeploy now."); result->Clear(); + std::cout << "Postprocess" << std::endl; + std::cout << "infer_result.size() is " << infer_result.size() << std::endl; if (infer_result.size() == 1) { FDTensor result_copy = infer_result[0]; std::cout << "Reshape result_copy!" << std::endl; @@ -206,12 +208,14 @@ bool PPTinyPose::Predict(cv::Mat* im, KeyPointDetectionResult* result) { << ModelName() << "." << std::endl; return false; } + std::vector infer_result; if (!Infer(processed_data, &infer_result)) { FDERROR << "Failed to inference while using model:" << ModelName() << "." << std::endl; return false; } + if (!Postprocess(infer_result, result, center, scale)) { FDERROR << "Failed to postprocess while using model:" << ModelName() << "." << std::endl;