summaryrefslogtreecommitdiff
path: root/mv_inference/inference/src/Inference.cpp
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2020-06-26 10:25:49 +0900
committerInki Dae <inki.dae@samsung.com>2020-06-26 10:28:26 +0900
commit2b903e7eef466ecf7dc3edee94db00a57a0bdffa (patch)
tree40a91925e85d98d9715b22c8911ca4ff0eca4f80 /mv_inference/inference/src/Inference.cpp
parent47716a817daa89920b3154c64a65dbd154f9535f (diff)
downloadmediavision-2b903e7eef466ecf7dc3edee94db00a57a0bdffa.tar.gz
mediavision-2b903e7eef466ecf7dc3edee94db00a57a0bdffa.tar.bz2
mediavision-2b903e7eef466ecf7dc3edee94db00a57a0bdffa.zip
Pose Estimation API may be changed so this patch reverts this API support. Pose Estimation API support will be posted later. Change-Id: I1aa2bf4bd3cb46a1cf70943e53be47326c79a8e0 Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'mv_inference/inference/src/Inference.cpp')
-rw-r--r--mv_inference/inference/src/Inference.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/mv_inference/inference/src/Inference.cpp b/mv_inference/inference/src/Inference.cpp
index 03714a3e..d7e13f99 100644
--- a/mv_inference/inference/src/Inference.cpp
+++ b/mv_inference/inference/src/Inference.cpp
@@ -1360,67 +1360,5 @@ namespace inference
return MEDIA_VISION_ERROR_NONE;
}
- int Inference::GetPoseEstimationDetectionResults(
- PoseEstimationResults *detectionResults)
- {
- tensor_t outputData;
-
- // Get inference result and contain it to outputData.
- int ret = FillOutputResult(outputData);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get output result.");
- return ret;
- }
-
- std::vector<std::vector<int> > inferDimInfo(outputData.dimInfo);
- std::vector<void *> inferResults(outputData.data.begin(),
- outputData.data.end());
-
- long number_of_pose = inferDimInfo[0][3];
- float *tmp = static_cast<float *>(inferResults[0]);
- cv::Size heatMapSize(inferDimInfo[0][1], inferDimInfo[0][2]);
-
- cv::Point loc;
- double score;
- cv::Mat blurredHeatMap;
-
- cv::Mat reShapeTest(cv::Size(inferDimInfo[0][2], inferDimInfo[0][1]),
- CV_32FC(inferDimInfo[0][3]), (void *) tmp);
-
- cv::Mat multiChannels[inferDimInfo[0][3]];
- split(reShapeTest, multiChannels);
-
- float ratioX = static_cast<float>(mSourceSize.width) /
- static_cast<float>(inferDimInfo[0][2]);
- float ratioY = static_cast<float>(mSourceSize.height) /
- static_cast<float>(inferDimInfo[0][1]);
-
- PoseEstimationResults results;
- results.number_of_pose_estimation = 0;
- for (int poseIdx = 0; poseIdx < number_of_pose; poseIdx++) {
- cv::Mat heatMap = multiChannels[poseIdx];
-
- cv::GaussianBlur(heatMap, blurredHeatMap, cv::Size(), 5.0, 5.0);
- cv::minMaxLoc(heatMap, NULL, &score, NULL, &loc);
-
- LOGI("PoseIdx[%2d]: x[%2d], y[%2d], score[%.3f]", poseIdx, loc.x,
- loc.y, score);
- LOGI("PoseIdx[%2d]: x[%2d], y[%2d], score[%.3f]", poseIdx,
- static_cast<int>(static_cast<float>(loc.x + 1) * ratioX),
- static_cast<int>(static_cast<float>(loc.y + 1) * ratioY),
- score);
-
- loc.x = static_cast<int>(static_cast<float>(loc.x + 1) * ratioX);
- loc.y = static_cast<int>(static_cast<float>(loc.y + 1) * ratioY);
- results.locations.push_back(loc);
- results.number_of_pose_estimation++;
- }
-
- *detectionResults = results;
- LOGE("Inference: PoseEstimationResults: %d\n",
- results.number_of_pose_estimation);
- return MEDIA_VISION_ERROR_NONE;
- }
-
} /* Inference */
} /* MediaVision */