浏览代码

Merge pull request #190 from Unity-Technologies/key_point_labeler_state_fix

Update KeyPointLabeler.cs
/main
GitHub 4 年前
当前提交
330c5831
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/KeyPointLabeler.cs
  2. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/KeyPointGroundTruthTests.cs

7
com.unity.perception/Runtime/GroundTruth/Labelers/KeyPointLabeler.cs


/// </summary>
public float y;
/// <summary>
/// The state of the point, 0 = not present, 1 = keypoint is present
/// The state of the point,
/// 0 = not present,
/// 1 = keypoint is present but not visible,
/// 2 = keypoint is present and visible
/// </summary>
public int state;
}

keyPoints[idx].index = idx;
keyPoints[idx].x = loc.x;
keyPoints[idx].y = loc.y;
keyPoints[idx].state = 1;
keyPoints[idx].state = 2;
}
cachedData.keyPoints.pose = "unset";

2
com.unity.perception/Tests/Runtime/GroundTruthTests/KeyPointGroundTruthTests.cs


Assert.AreEqual(t.keypoints[5].y, t.keypoints[6].y);
for (var i = 0; i < 9; i++) Assert.AreEqual(i, t.keypoints[i].index);
for (var i = 0; i < 8; i++) Assert.AreEqual(1, t.keypoints[i].state);
for (var i = 0; i < 8; i++) Assert.AreEqual(2, t.keypoints[i].state);
Assert.Zero(t.keypoints[8].state);
Assert.Zero(t.keypoints[8].x);
Assert.Zero(t.keypoints[8].y);

正在加载...
取消
保存