浏览代码

WIP mock of labelers list under PerceptionCamera

/labeler_mock
Jon Hogins 5 年前
当前提交
6d7d74e7
共有 6 个文件被更改,包括 34 次插入22 次删除
  1. 28
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  2. 5
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  3. 3
      com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs
  4. 5
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  5. 5
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  6. 10
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs

28
com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs


public void OnEnable()
{
// m_LabelersList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)), true, false, true, true);
// m_LabelersList.elementHeightCallback = GetElementHeight;
// m_LabelersList.drawElementCallback = DrawElement;
// m_LabelersList.onAddCallback += OnAdd;
// m_LabelersList.onRemoveCallback += OnRemove;
m_LabelersList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)), true, false, true, true);
m_LabelersList.elementHeightCallback = GetElementHeight;
m_LabelersList.drawElementCallback = DrawElement;
m_LabelersList.onAddCallback += OnAdd;
m_LabelersList.onRemoveCallback += OnRemove;
throw new System.NotImplementedException();
var serializedProperty = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers));
var element = serializedProperty.GetArrayElementAtIndex(index);
var editor = Editor.CreateEditor(element.managedReferenceValue);
return 10;
throw new NotImplementedException();
var element = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)).GetArrayElementAtIndex(index);
var editor = Editor.CreateEditor(element.managedReferenceValue);
editor.OnInspectorGUI();
}
void OnRemove(ReorderableList list)

void OnAdd(ReorderableList list)
{
throw new System.NotImplementedException();
var labelers = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers));
labelers.InsertArrayElementAtIndex(0);
var element = labelers.GetArrayElementAtIndex(0);
element.managedReferenceValue = new BoundingBoxLabeler();
serializedObject.ApplyModifiedProperties();
}
public override void OnInspectorGUI()

EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.startTime)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.captureRgbImages)));
//m_LabelersList.DoLayoutList();
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
m_LabelersList.DoLayoutList();
}
}
}

5
com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs


using System;
namespace UnityEngine.Perception.GroundTruth {
[AddComponentMenu("Perception/Labelers/BoundingBoxLabeler")]
[RequireComponent(typeof(InstanceSegmentationLabeler))]
public class BoundingBoxLabeler : MonoBehaviour
[Serializable]
public class BoundingBoxLabeler : CameraLabeler
{
public string annotationId = "F9F22E05-443F-4602-A422-EBE4EA9B55CB";
public LabelingConfiguration labelingConfiguration;

3
com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs


using System;
namespace UnityEngine.Perception.GroundTruth {
[AddComponentMenu("Perception/Labelers/InstanceSegmentationLabeler")]
public class InstanceSegmentationLabeler : MonoBehaviour
public class InstanceSegmentationLabeler : CameraLabeler
{
public bool saveImages = false;
public string annotationId = "E657461D-B950-42E1-8141-BEC9B4810241";

5
com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs


namespace UnityEngine.Perception.GroundTruth
{
[AddComponentMenu("Perception/Labelers/RenderedObjectInfoLabeler")]
[RequireComponent(typeof(InstanceSegmentationLabeler))]
public class RenderedObjectInfoLabeler : MonoBehaviour
[Serializable]
public class RenderedObjectInfoLabeler : CameraLabeler
{
public string annotationId = "F9F22E05-443F-4602-A422-EBE4EA9B55CB";
public LabelingConfiguration labelingConfiguration;

5
com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs


using System;
namespace UnityEngine.Perception.GroundTruth {
[AddComponentMenu("Perception/Labelers/SemanticSegmentationLabeler")]
[RequireComponent(typeof(InstanceSegmentationLabeler))]
public class SemanticSegmentationLabeler : MonoBehaviour
[Serializable]
public class SemanticSegmentationLabeler : CameraLabeler
{
public string annotationId = "12F94D8D-5425-4DEB-9B21-5E53AD957D66";
public SemanticSegmentationLabelConfig labelConfig;

10
com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs


/// </summary>
public LabelingConfiguration LabelingConfiguration;
// [SerializeReference]
// public List<Labeler> labelers = new List<Labeler>();
[SerializeReference]
public List<CameraLabeler> labelers = new List<CameraLabeler>();
/// <summary>
/// Invoked when RenderedObjectInfos are calculated. The first parameter is the Time.frameCount at which the objects were rendered. This may be called many frames after the frame in which the objects were rendered.

return AsyncRequest.Result.Completed;
});
}
}
[Serializable]
public abstract class CameraLabeler
{
}
}
正在加载...
取消
保存