plugin  0.1.0
openpose_decoder.h
1 /*
2 // Copyright (C) 2020-2024 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 
17 #pragma once
18 #include <stddef.h>
19 
20 #include <vector>
21 
22 #include <opencv2/core.hpp>
23 
24 struct HumanPose;
25 
26 struct Peak {
27  Peak(const int id = -1, const cv::Point2f& pos = cv::Point2f(), const float score = 0.0f);
28 
29  int id;
30  cv::Point2f pos;
31  float score;
32 };
33 
35  explicit HumanPoseByPeaksIndices(const int keypointsNumber);
36 
37  std::vector<int> peaksIndices;
38  int nJoints;
39  float score;
40 };
41 
43  TwoJointsConnection(const int firstJointIdx, const int secondJointIdx, const float score);
44 
45  int firstJointIdx;
46  int secondJointIdx;
47  float score;
48 };
49 
50 void findPeaks(const std::vector<cv::Mat>& heatMaps,
51  const float minPeaksDistance,
52  std::vector<std::vector<Peak>>& allPeaks,
53  int heatMapId,
54  float confidenceThreshold);
55 
56 std::vector<HumanPose> groupPeaksToPoses(const std::vector<std::vector<Peak>>& allPeaks,
57  const std::vector<cv::Mat>& pafs,
58  const size_t keypointsNumber,
59  const float midPointsScoreThreshold,
60  const float foundMidPointsRatioThreshold,
61  const int minJointsNumber,
62  const float minSubsetScore);
Definition: openpose_decoder.h:34
Definition: results.h:113
Definition: associative_embedding_decoder.h:25
Definition: openpose_decoder.h:42