浏览代码

Fixed keypoint coco export to include correct image id if bounding box labeler is not present

/coco_export
Steve Borkman 3 年前
当前提交
91e62848
共有 2 个文件被更改,包括 12 次插入3 次删除
  1. 6
      com.unity.perception/Runtime/GroundTruth/Exporters/Coco/CocoTypes.cs
  2. 9
      com.unity.perception/Runtime/GroundTruth/Labelers/KeypointLabeler.cs

6
com.unity.perception/Runtime/GroundTruth/Exporters/Coco/CocoTypes.cs


var outKeypoint = new KeypointAnnotation()
{
id = (int)keypoint.instance_id,
image_id = -1,
image_id = keypoint.frame,
category_id = keypoint.label_id,
segmentation = new float[]{},
area = 0,

public int[][] skeleton;
}
[Serializable]
public class KeypointCategories
{

}

9
com.unity.perception/Runtime/GroundTruth/Labelers/KeypointLabeler.cs


m_AsyncAnnotations[m_CurrentFrame] = (annotation, keypoints);
foreach (var label in LabelManager.singleton.registeredLabels)
ProcessLabel(label);
ProcessLabel(m_CurrentFrame, label);
}
// ReSharper disable InconsistentNaming

/// The label id of the entity
/// </summary>
public int label_id;
public int frame;
/// <summary>
/// The instance id of the entity
/// </summary>

return false;
}
void ProcessLabel(Labeling labeledEntity)
void ProcessLabel(int frame, Labeling labeledEntity)
{
if (!idLabelConfig.TryGetLabelEntryFromInstanceId(labeledEntity.instanceId, out var labelEntry))
return;

cached.keypoints.instance_id = labeledEntity.instanceId;
cached.keypoints.label_id = labelEntry.id;
cached.keypoints.frame = -1;
cached.keypoints.template_guid = activeTemplate.templateID;
cached.keypoints.keypoints = new Keypoint[activeTemplate.keypoints.Length];

}
var cachedData = m_KnownStatus[labeledEntity.instanceId];
cachedData.keypoints.frame = frame;
if (cachedData.status)
{

正在加载...
取消
保存