提交 bdb7b1de 编写于 作者: G gineshidalgo99

COCO saver compatible with 18 & 19 parts

上级 ff30d4f5
......@@ -3,7 +3,8 @@
2. **No duplicated** posts.
3. **No** posts about **questions already answered / clearly explained in** the **documentation** (e.g. **no more low-speed nor out-of-memory questions**).
4. Set a **proper issue title**: add the Ubuntu/Windows word and be specific (e.g. do not simple call it: `Compile error`).
5. Only English comments.
5. **No** questions about **training**. OpenPose only implements testing.
6. Only English comments.
Issues/comments that do not follow this will be **ignored or removed** with no further clarification.
......
......@@ -62,7 +62,13 @@ namespace op
// keypoints - i.e. poseKeypoints
mJsonOfstream.key("keypoints");
mJsonOfstream.arrayOpen();
const std::vector<int> indexesInCocoOrder{0, 15, 14, 17, 16, 5, 2, 6, 3, 7, 4, 11, 8, 12, 9, 13, 10};
std::vector<int> indexesInCocoOrder;
if (numberBodyParts == 18)
indexesInCocoOrder = std::vector<int>{0, 15, 14, 17, 16, 5, 2, 6, 3, 7, 4, 11, 8, 12, 9, 13, 10};
else if (numberBodyParts == 19)
indexesInCocoOrder = std::vector<int>{0, 16, 15, 18, 17, 5, 2, 6, 3, 7, 4, 12, 9, 13, 10, 14, 11};
else
error("Unvalid number of body parts (" + std::to_string(numberBodyParts) + ").", __LINE__, __FUNCTION__, __FILE__);
for (auto bodyPart = 0u ; bodyPart < indexesInCocoOrder.size() ; bodyPart++)
{
const auto finalIndex = 3*(person*numberBodyParts + indexesInCocoOrder.at(bodyPart));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册