Skip to content

Commit

Permalink
Merge pull request openvinotoolkit#652 from IRDonch/pose-extractor-ar…
Browse files Browse the repository at this point in the history
…rays

pose_extractor: replace unnecessary vectors with arrays
  • Loading branch information
Roman Donchenko authored Dec 17, 2019
2 parents 81480da + 9d573cc commit 71cca53
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ std::vector<HumanPose> groupPeaksToPoses(const std::vector<std::vector<Peak> >&
const float foundMidPointsRatioThreshold,
const int minJointsNumber,
const float minSubsetScore) {
const std::vector<std::pair<int, int> > limbIdsHeatmap = {
static const std::pair<int, int> limbIdsHeatmap[] = {
{2, 3}, {2, 6}, {3, 4}, {4, 5}, {6, 7}, {7, 8}, {2, 9}, {9, 10}, {10, 11}, {2, 12}, {12, 13}, {13, 14},
{2, 1}, {1, 15}, {15, 17}, {1, 16}, {16, 18}, {3, 17}, {6, 18}
};
const std::vector<std::pair<int, int> > limbIdsPaf = {
static const std::pair<int, int> limbIdsPaf[] = {
{31, 32}, {39, 40}, {33, 34}, {35, 36}, {41, 42}, {43, 44}, {19, 20}, {21, 22}, {23, 24}, {25, 26},
{27, 28}, {29, 30}, {47, 48}, {49, 50}, {53, 54}, {51, 52}, {55, 56}, {37, 38}, {45, 46}
};
Expand All @@ -126,7 +126,7 @@ std::vector<HumanPose> groupPeaksToPoses(const std::vector<std::vector<Peak> >&
candidates.insert(candidates.end(), peaks.begin(), peaks.end());
}
std::vector<HumanPoseByPeaksIndices> subset(0, HumanPoseByPeaksIndices(static_cast<int>(keypointsNumber)));
for (size_t k = 0; k < limbIdsPaf.size(); k++) {
for (size_t k = 0; k < sizeof(limbIdsPaf) / sizeof(*limbIdsPaf); k++) {
std::vector<TwoJointsConnection> connections;
const int mapIdxOffset = static_cast<int>(keypointsNumber) + 1;
std::pair<cv::Mat, cv::Mat> scoreMid = { pafs[limbIdsPaf[k].first - mapIdxOffset],
Expand Down

0 comments on commit 71cca53

Please sign in to comment.