浏览代码

Mock up #1 of labeler

/labeler_mock
Jon Hogins 5 年前
当前提交
0974e8fd
共有 14 个文件被更改,包括 157 次插入9 次删除
  1. 18
      com.unity.perception/Editor/GroundTruth/LabelingConfigurationEditor.cs
  2. 3
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  3. 51
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  4. 3
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs.meta
  5. 3
      com.unity.perception/Runtime/GroundTruth/Labelers.meta
  6. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  7. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs.meta
  8. 10
      com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs
  9. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs.meta
  10. 12
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  11. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs.meta
  12. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  13. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs.meta

18
com.unity.perception/Editor/GroundTruth/LabelingConfigurationEditor.cs


public void OnEnable()
{
m_LabelsList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(LabelingConfiguration.LabelEntries)), true, false, true, true);
m_LabelsList.elementHeight = EditorGUIUtility.singleLineHeight * 3 + k_Margin;
m_LabelsList.elementHeight = EditorGUIUtility.singleLineHeight * 2 + k_Margin;
m_LabelsList.drawElementCallback = DrawElement;
m_LabelsList.onAddCallback += OnAdd;
m_LabelsList.onRemoveCallback += OnRemove;

labelProperty.stringValue = newLabel;
}
}
using (var change = new EditorGUI.ChangeCheckScope())
{
var contentRect = new Rect(rect.position + new Vector2(0, EditorGUIUtility.singleLineHeight * 2), new Vector2(rect.width, EditorGUIUtility.singleLineHeight));
var newValue = EditorGUI.IntField(contentRect, nameof(LabelEntry.value), valueProperty.intValue);
if (change.changed)
valueProperty.intValue = newValue;
}
//
// using (var change = new EditorGUI.ChangeCheckScope())
// {
// var contentRect = new Rect(rect.position + new Vector2(0, EditorGUIUtility.singleLineHeight * 2), new Vector2(rect.width, EditorGUIUtility.singleLineHeight));
// var newValue = EditorGUI.IntField(contentRect, nameof(LabelEntry.value), valueProperty.intValue);
// if (change.changed)
// valueProperty.intValue = newValue;
// }
}
bool autoAssign => serializedObject.FindProperty(nameof(LabelingConfiguration.AutoAssignIds)).boolValue;

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


/// </summary>
public LabelingConfiguration LabelingConfiguration;
// [SerializeReference]
// public List<Labeler> labelers = new List<Labeler>();
/// <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.
/// </summary>

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


using System;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Perception.GroundTruth;
namespace UnityEditor.Perception.GroundTruth
{
[CustomEditor(typeof(PerceptionCamera))]
public class PerceptionCameraEditor : Editor
{
ReorderableList m_LabelersList;
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;
}
float GetElementHeight(int index)
{
throw new System.NotImplementedException();
}
void DrawElement(Rect rect, int index, bool isactive, bool isfocused)
{
throw new NotImplementedException();
}
void OnRemove(ReorderableList list)
{
throw new System.NotImplementedException();
}
void OnAdd(ReorderableList list)
{
throw new System.NotImplementedException();
}
public override void OnInspectorGUI()
{
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.description)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.period)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.startTime)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.captureRgbImages)));
//m_LabelersList.DoLayoutList();
}
}
}

3
com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs.meta


fileFormatVersion: 2
guid: d6936a1fe4b946a8b72f33ac7c4906e4
timeCreated: 1589372488

3
com.unity.perception/Runtime/GroundTruth/Labelers.meta


fileFormatVersion: 2
guid: 021a5e99d6664a188c5c78599587a08c
timeCreated: 1589374593

11
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
{
public string annotationId = "F9F22E05-443F-4602-A422-EBE4EA9B55CB";
public LabelingConfiguration labelingConfiguration;
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs.meta


fileFormatVersion: 2
guid: d0127208de324c00a881af84cdd63da3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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


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

11
com.unity.perception/Runtime/GroundTruth/Labelers/InstanceSegmentationLabeler.cs.meta


fileFormatVersion: 2
guid: 43085b9d882c415b90fb9ebe4d765f26
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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


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

11
com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs.meta


fileFormatVersion: 2
guid: c2fcc6ce8ec34a44ae0f1679f25b6fb4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
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
{
public string annotationId = "12F94D8D-5425-4DEB-9B21-5E53AD957D66";
public LabelingConfiguration labelingConfiguration;
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs.meta


fileFormatVersion: 2
guid: 6c08fb5eff78425db5567cf66f9cb3fc
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存