Skip to content

Commit da611ae

Browse files
authored
Merge pull request #190 from Unity-Technologies/key_point_labeler_state_fix
Update KeyPointLabeler.cs
2 parents 135b53d + e85d370 commit da611ae

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,10 @@ public class KeyPoint
165165
/// </summary>
166166
public float y;
167167
/// <summary>
168-
/// The state of the point, 0 = not present, 1 = keypoint is present
168+
/// The state of the point,
169+
/// 0 = not present,
170+
/// 1 = keypoint is present but not visible,
171+
/// 2 = keypoint is present and visible
169172
/// </summary>
170173
public int state;
171174
}
@@ -309,7 +312,7 @@ void ProcessEntity(Labeling labeledEntity)
309312
keyPoints[idx].index = idx;
310313
keyPoints[idx].x = loc.x;
311314
keyPoints[idx].y = loc.y;
312-
keyPoints[idx].state = 1;
315+
keyPoints[idx].state = 2;
313316
}
314317

315318
cachedData.keyPoints.pose = "unset";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public IEnumerator Keypoint_TestStaticLabeledCube()
298298
Assert.AreEqual(t.keypoints[5].y, t.keypoints[6].y);
299299

300300
for (var i = 0; i < 9; i++) Assert.AreEqual(i, t.keypoints[i].index);
301-
for (var i = 0; i < 8; i++) Assert.AreEqual(1, t.keypoints[i].state);
301+
for (var i = 0; i < 8; i++) Assert.AreEqual(2, t.keypoints[i].state);
302302
Assert.Zero(t.keypoints[8].state);
303303
Assert.Zero(t.keypoints[8].x);
304304
Assert.Zero(t.keypoints[8].y);

0 commit comments

Comments
 (0)