比较提交

...
此合并请求有变更与目标分支冲突。
/.gitignore
/TestProjects/PerceptionURP/ProjectSettings/EditorBuildSettings.asset
/TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
/com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
/com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
/com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
/com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs
/com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs
/com.unity.perception/CHANGELOG.md
/com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
/com.unity.perception/Runtime/GroundTruth/RenderTextureReader.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs
/com.unity.perception/Runtime/GroundTruth/SemanticSegmentationPass.cs
/com.unity.perception/Runtime/GroundTruth/Labelers/Visualization
/com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs
/com.unity.perception/Documentation~/GettingStarted.md

3 次代码提交

作者 SHA1 备注 提交日期
Steven Borkman 31016ce0 Fix for merge issue 4 年前
GitHub 99fcb992 Merge branch 'master' into aisv647_visualizations 4 年前
Steven Borkman 7e27bca9 Fix for _MainTex test error 4 年前
共有 63 个文件被更改,包括 6852 次插入78 次删除
  1. 3
      .gitignore
  2. 18
      TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
  3. 5
      TestProjects/PerceptionURP/ProjectSettings/EditorBuildSettings.asset
  4. 17
      com.unity.perception/CHANGELOG.md
  5. 47
      com.unity.perception/Documentation~/GettingStarted.md
  6. 18
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  7. 89
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  8. 89
      com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs
  9. 38
      com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
  10. 40
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  11. 74
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  12. 149
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  13. 23
      com.unity.perception/Runtime/GroundTruth/RenderTextureReader.cs
  14. 2
      com.unity.perception/Runtime/GroundTruth/SemanticSegmentationPass.cs
  15. 12
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs
  16. 8
      com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs
  17. 27
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
  18. 4
      com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs
  19. 1001
      com.unity.perception/Documentation~/images/controls.gif
  20. 599
      com.unity.perception/Documentation~/images/visualized.png
  21. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization.meta
  22. 96
      com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs
  23. 11
      com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs.meta
  24. 125
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs
  25. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs.meta
  26. 131
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs
  27. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs.meta
  28. 41
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs
  29. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs.meta
  30. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials.meta
  31. 92
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/OutlineMaterial.mat
  32. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/OutlineMaterial.mat.meta
  33. 168
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat
  34. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat.meta
  35. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources.meta
  36. 171
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/BoundingBoxPrefab.prefab
  37. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/BoundingBoxPrefab.prefab.meta
  38. 598
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericSlider.prefab
  39. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericSlider.prefab.meta
  40. 335
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericToggle.prefab
  41. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericToggle.prefab.meta
  42. 1001
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/Inter-Light.otf
  43. 22
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/Inter-Light.otf.meta
  44. 287
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/KeyValuePanel.prefab
  45. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/KeyValuePanel.prefab.meta
  46. 74
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader
  47. 9
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader.meta
  48. 73
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegmentTexture.prefab
  49. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegmentTexture.prefab.meta
  50. 1001
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/VisualizationUI.prefab
  51. 7
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/VisualizationUI.prefab.meta
  52. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures.meta
  53. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/outline_box.png
  54. 104
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/outline_box.png.meta
  55. 3
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/sharp_done_white_18dp.png
  56. 104
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/sharp_done_white_18dp.png.meta
  57. 79
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs
  58. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs.meta
  59. 0
      .gitmodules

3
.gitignore


**/.bin
CodeCoverage
/.download
/TestProjects/PerceptionURP/Build
**/Build/**
**/Builds/**

18
TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity


m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 1e-45, z: 1.8643e-41, w: 5.9e-44}
m_BoundingSphereOverride: {x: 4.7e-43, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0

- component: {fileID: 963194229}
- component: {fileID: 963194227}
- component: {fileID: 963194231}
- component: {fileID: 963194232}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera

- id: 1
- id: 2
- id: 3
showVisualizations: 1
references:
version: 1
00000000:

m_Script: {fileID: 11500000, guid: 7c51d9f2c5784bb4aee3fdf021966e14, type: 3}
m_Name:
m_EditorClassIdentifier:
light: {fileID: 705507993}
targetLight: {fileID: 705507993}
--- !u!114 &963194232
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 53f4c974fdf704444959724a41de0cfe, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1640252278
GameObject:
m_ObjectHideFlags: 0

5
TestProjects/PerceptionURP/ProjectSettings/EditorBuildSettings.asset


EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 9fc0d4010bbf28b4594072e72b8655ab
m_configObjects: {}

17
com.unity.perception/CHANGELOG.md


# Changelog
All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)

Fixed compilation warnings with latest com.unity.simulation.core package.
### Security
## [0.3.0-preview.1] - 2020-07-31
### Added
Added realtime visualization capability to the perception package.
Added visualizers for built-in labelers: Semantic Segmentation, 2D Bounding Boxes, Object Count, and Render Object Info.
### This is the first release of the _Perception_ package

47
com.unity.perception/Documentation~/GettingStarted.md


# Getting Started with Perception
This step can be skipped for HDRP projects.
1. Select your project's `ScriptableRenderer` asset and open the inspector window. In most projects it is located at `Assets/Settings/ForwardRenderer.asset`.

## Step 3: Create a new scene and camera
3. Select the Main Camera and reset the Position transform to 0
3. Select the Main Camera and reset the Position transform to 0
1. In the inspector panel of the main camera select Add Component
2. Add a **Perception Camera** component
1. In the inspector panel of the main camera select Add Component
2. Add a **Perception Camera** component
1. Create a cube by right-clicking in the Hierarchy window, select 3D Object -> Cube
1. Create a cube by right-clicking in the Hierarchy window, select 3D Object -> Cube
2. Create 2 more cubes this way
3. Change the names of the cubes to Cube, Box, and Crate
4. Position the Cubes in front of the main Camera

<img src="images/MainCameraLabelConfig.PNG" align="middle"/>
## Step 5: Run simulation and generate dataset
>Example file path on a Windows PC : `C:/Users/<User Name>/AppData/LocalLow/DefaultCompany/UnityTestFramework\2e10ec21-9d97-4cee-b5a2-7e95e299afa4\RGB18f61842-ef8d-4b31-acb5-cb1da36fb7b1`
> Example file path on a Windows PC : `C:/Users/<User Name>/AppData/LocalLow/DefaultCompany/UnityTestFramework\2e10ec21-9d97-4cee-b5a2-7e95e299afa4\RGB18f61842-ef8d-4b31-acb5-cb1da36fb7b1`
- RGB captures
- Semantic segmentation images
- Logs
- JSON dataset
- RGB captures
- Semantic segmentation images
- Logs
- JSON dataset
<img src="images/rgb_2.png" align="middle"/>
_RGB image_

_Example semantic segmentation image_
_Example semantic segmentation image_
## Optional Step: Realtime visualization of labelers
The perception package now comes with the ability to show realtime results of the labeler in the scene. To enable this capability:
<img src="images/visualized.png" align="middle"/>
_Example of perception running with show visualizations on_
1. To use the visualizer, verify that *Show Visualizations* is checked on in the Inspector pane. This turns on the built in labelers which includes segmentation data, 2D bounding boxes, pixel and object counts.
2. Turning on the visualizer creates new UI controls in the editor's game view. These controls allow you to atomically control each of the individual visualizers. Each individual can be turned on/off on their own. Some visualizers also include controls to change their output.
<img src="images/controls.gif" align="middle"/>
_Visualization controls in action_
***Important Note:*** The perception package takes advantage of asynchronous processing to ensure reasonable frame rates of a scene. A side effect of realtime visualization is that the labelers have to be applied to the capture in its actual frame, which will potentially adversely affect the scene's framerate.

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


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)));
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
m_LabelersList.DoLayoutList();
using(new EditorGUI.DisabledScope(EditorApplication.isPlaying))
{
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.showVisualizations)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(perceptionCamera.captureRgbImages)));
serializedObject.ApplyModifiedProperties();
//EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.labelers)));
m_LabelersList.DoLayoutList();
}
if (EditorSettings.asyncShaderCompilation)
{
EditorGUILayout.HelpBox("Asynchronous shader compilation may result in invalid data in beginning frames. This can be disabled in Project Settings -> Edtior -> Asynchronous Shader Compilation", MessageType.Warning);

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


using System;
using System;
using Unity.Simulation;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{

AnnotationDefinition m_BoundingBoxAnnotationDefinition;
BoundingBoxValue[] m_BoundingBoxValues;
private GameObject visualizationHolder = null;
private Vector2 originalScreenSize = Vector2.zero;
/// <summary>
/// Creates a new BoundingBox2DLabeler. Be sure to assign <see cref="idLabelConfig"/> before adding to a <see cref="PerceptionCamera"/>.
/// </summary>

}
/// <inheritdoc/>
protected override bool supportsVisualization => true;
/// <inheritdoc/>
protected override void Setup()
{
if (idLabelConfig == null)

"Bounding box for each labeled object visible to the sensor", id: new Guid(annotationId));
perceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;
visualizationEnabled = supportsVisualization;
// Record the original screen size. The screen size can change during play, and the visual bounding
// boxes need to be scaled appropriately
originalScreenSize = new Vector2(Screen.width, Screen.height);
}
/// <inheritdoc/>

};
}
if (!CaptureOptions.useAsyncReadbackIfSupported && frameCount != Time.frameCount)
Debug.LogWarning("Not on current frame: " + frameCount + "(" + Time.frameCount + ")");
if (visualizationEnabled)
{
Visualize();
}
}
/// <inheritdoc/>
protected override void PopulateVisualizationPanel(ControlPanel panel)
{
panel.AddToggleControl("BoundingBoxes", enabled => {
visualizationEnabled = enabled;
});
objectPool = new List<GameObject>();
visualizationHolder = new GameObject("BoundsHolder" + Time.frameCount);
visualizationCanvas.AddComponent(visualizationHolder);
}
void ClearObjectPool(int count)
{
for (int i = count; i < objectPool.Count; i++)
{
objectPool[i].SetActive(false);
}
}
List<GameObject> objectPool = null;
void Visualize()
{
ClearObjectPool(m_BoundingBoxValues.Length);
// The player screen can be dynamically resized during play, need to
// scale the bounding boxes appropriately from the original screen size
float screenRatioWidth = Screen.width / originalScreenSize.x;
float screenRatioHeight = Screen.height / originalScreenSize.y;
for (int i = 0; i < m_BoundingBoxValues.Length; i++)
{
var boxVal = m_BoundingBoxValues[i];
if (i >= objectPool.Count)
{
var boundingBoxObject = GameObject.Instantiate(Resources.Load<GameObject>("BoundingBoxPrefab"));
objectPool.Add(boundingBoxObject);
var rectTransform = (RectTransform)boundingBoxObject.transform;
rectTransform.SetParent(visualizationHolder.transform, false);
}
if (!objectPool[i].activeSelf) objectPool[i].SetActive(true);
string label = boxVal.label_name + "_" + boxVal.instance_id;
objectPool[i].GetComponentInChildren<Text>().text = label;
var rectTrans = objectPool[i].transform as RectTransform;
rectTrans.anchoredPosition = new Vector2(boxVal.x * screenRatioWidth, -boxVal.y * screenRatioHeight);
rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, boxVal.width * screenRatioWidth);
rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, boxVal.height * screenRatioHeight);
}
}
/// <inheritdoc/>
override protected void OnVisualizerEnabledChanged(bool enabled)
{
if (visualizationHolder != null)
visualizationHolder.SetActive(enabled);
}
}
}

89
com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs


using System;
using System;
using Unity.Simulation;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{

internal bool isInitialized { get; private set; }
/// <summary>
/// Labelers should set this in their setup to define if they support realtime
/// visualization of their data.
/// </summary>
protected abstract bool supportsVisualization
{
get;
}
/// <summary>
/// Retrieve a handle to the visualization canvas <see cref="VisualizationCanvas"/>. This is the specific canvas that all visualization
/// labelers should be added to. The canvas has helper functions to create many common visualization components.
/// </summary>
public VisualizationCanvas visualizationCanvas { get; private set; }
/// <summary>
/// The control panel that is attached to the visualization canvas. The common location to add interactive controls.
/// </summary>
public ControlPanel controlPanel => visualizationCanvas != null ? visualizationCanvas.controlPanel : null;
/// <summary>
/// The heads up display (HUD) panel. Generally used to add stats to the display.
/// </summary>
public HUDPanel hudPanel => visualizationCanvas != null ? visualizationCanvas.hudPanel : null;
/// <summary>
/// The <see cref="PerceptionCamera"/> that contains this labeler.
/// </summary>
protected PerceptionCamera perceptionCamera { get; private set; }

/// </summary>
protected virtual void Setup() { }
/// <summary>
/// Called immediately after <see cref="setup"/>. Implement this to initialize labeler's visualization
/// capability if one exists <see cref="supportVisualization"/>.
/// </summary>
/// <param name="panel">The target control panel for the labeler's visualization component</param>
protected virtual void PopulateVisualizationPanel(ControlPanel panel) { }
/// <summary>
/// Called when the labeler's visualization capability is turned on or off.
/// </summary>
/// <param name="enabled">The current enabled state of the visualizer</param>
protected virtual void OnVisualizerEnabledChanged(bool enabled) {}
/// <summary>
/// Called during the Update each frame the the labeler is enabled and <see cref="SensorHandle.ShouldCaptureThisFrame"/> is true.
/// </summary>
protected virtual void OnUpdate() {}

protected virtual void Cleanup() {}
internal void InternalSetup() => Setup();
internal void InternalPopulateVisualizationPanel(GameObject panel) => PopulateVisualizationPanel(controlPanel);
internal bool InternalVisualizationEnabled
{
get => visualizationEnabled;
set => visualizationEnabled = value;
}
internal void Init(PerceptionCamera newPerceptionCamera)
private bool m_ShowVisualizations = false;
/// <summary>
/// Turns on/off the labeler's realtime visualization capability. If a labeler does not support realtime
/// visualization (<see cref="supportsVisualization"/>) or visualization is not enabled on the PerceptionCamera
/// this will not function.
/// </summary>
protected bool visualizationEnabled
{
get
{
return supportsVisualization && m_ShowVisualizations;
}
set
{
if (!supportsVisualization) return;
if (visualizationCanvas == null) return;
if (value != m_ShowVisualizations)
{
m_ShowVisualizations = value;
OnVisualizerEnabledChanged(m_ShowVisualizations);
}
}
}
internal void Init(PerceptionCamera newPerceptionCamera, VisualizationCanvas visualizationCanvas)
this.visualizationCanvas = visualizationCanvas;
if (supportsVisualization && visualizationCanvas != null)
{
m_ShowVisualizations = true;
InitVisualizationUI();
}
}
catch (Exception)
{

}
private void InitVisualizationUI()
{
PopulateVisualizationPanel(controlPanel);
}
}
}

38
com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs


using System.Diagnostics.CodeAnalysis;
using Unity.Collections;
using Unity.Profiling;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{

Dictionary<int, AsyncMetric> m_ObjectCountAsyncMetrics;
MetricDefinition m_ObjectCountMetricDefinition;
List<string> vizEntries = null;
/// <summary>
/// Creates a new ObjectCountLabeler. This constructor should only be used by serialization. For creation from

}
/// <inheritdoc/>
protected override bool supportsVisualization => true;
/// <inheritdoc/>
protected override void Setup()
{
if (labelConfig == null)

ObjectCountsComputed?.Invoke(frameCount, objectCounts, labelConfig.labelEntries);
ProduceObjectCountMetric(objectCounts, m_LabelConfig.labelEntries, frameCount);
};
visualizationEnabled = supportsVisualization;
}
/// <inheritdoc/>

if (m_ClassCountValues == null || m_ClassCountValues.Length != entries.Count)
m_ClassCountValues = new ClassCountValue[entries.Count];
bool visualize = visualizationEnabled;
if (visualize && vizEntries == null)
{
vizEntries = new List<string>();
}
for (var i = 0; i < entries.Count; i++)
{
m_ClassCountValues[i] = new ClassCountValue()

count = counts[i]
};
if (visualize)
{
var label = entries[i].label + " Counts";
hudPanel.UpdateEntry(label, counts[i].ToString());
vizEntries.Add(label);
}
}
}
/// <inheritdoc/>
protected override void PopulateVisualizationPanel(ControlPanel panel)
{
panel.AddToggleControl("Object Counts", enabled => { visualizationEnabled = enabled; });
}
/// <inheritdoc/>
override protected void OnVisualizerEnabledChanged(bool enabled)
{
if (!enabled)
{
hudPanel.RemoveEntries(vizEntries);
vizEntries.Clear();
}
}
}

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


using Unity.Collections;
using Unity.Profiling;
using UnityEngine.Serialization;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{

Dictionary<int, AsyncMetric> m_ObjectInfoAsyncMetrics;
MetricDefinition m_RenderedObjectInfoMetricDefinition;
List<string> vizEntries = null;
/// <summary>
/// Creates a new RenderedObjectInfoLabeler. Be sure to assign <see cref="idLabelConfig"/> before adding to a <see cref="PerceptionCamera"/>.
/// </summary>

}
/// <inheritdoc/>
protected override bool supportsVisualization => true;
/// <inheritdoc/>
protected override void Setup()
{
if (idLabelConfig == null)

{
ProduceRenderedObjectInfoMetric(objectInfo, frameCount);
};
visualizationEnabled = supportsVisualization;
}
/// <inheritdoc/>

if (m_VisiblePixelsValues == null || m_VisiblePixelsValues.Length != renderedObjectInfos.Length)
m_VisiblePixelsValues = new RenderedObjectInfoValue[renderedObjectInfos.Length];
bool visualize = visualizationEnabled;
if (visualize && vizEntries == null)
{
vizEntries = new List<string>();
}
for (var i = 0; i < renderedObjectInfos.Length; i++)
{
var objectInfo = renderedObjectInfos[i];

instance_id = objectInfo.instanceId,
visible_pixels = objectInfo.pixelCount
};
if (visualize)
{
var label = labelEntry.label + "_" + objectInfo.instanceId;
hudPanel.UpdateEntry(label, objectInfo.pixelCount.ToString());
vizEntries.Add(label);
}
}
metric.ReportValues(m_VisiblePixelsValues);

}
/// <inheritdoc/>
protected override void PopulateVisualizationPanel(ControlPanel panel)
{
panel.AddToggleControl("Pixel Counts", enabled => { visualizationEnabled = enabled; });
}
/// <inheritdoc/>
override protected void OnVisualizerEnabledChanged(bool enabled)
{
if (!enabled)
{
hudPanel.RemoveEntries(vizEntries);
vizEntries.Clear();
}
}
}
}

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


using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;

using Unity.Simulation;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Profiling;
using UnityEngine.UI;
#if HDRP_PRESENT
using UnityEngine.Rendering.HighDefinition;

/// the camera resolution.
/// </summary>
public RenderTexture targetTexture => m_TargetTextureOverride;
[Tooltip("(Optional) The RenderTexture on which semantic segmentation images will be drawn. Will be reformatted on startup.")]
[SerializeField]
RenderTexture m_TargetTextureOverride;

Dictionary<int, AsyncAnnotation> m_AsyncAnnotations;
private float defaultSegmentTransparency = 0.8f;
private float defaultBackgroundTransparency = 0.0f;
/// <summary>
/// Creates a new SemanticSegmentationLabeler. Be sure to assign <see cref="labelConfig"/> before adding to a <see cref="PerceptionCamera"/>.
/// </summary>

public string path;
}
int camWidth = 0;
int camHeight = 0;
private GameObject segVisual = null;
private RawImage segImage = null;
/// <inheritdoc/>
protected override bool supportsVisualization => true;
var width = myCamera.pixelWidth;
var height = myCamera.pixelHeight;
camWidth = myCamera.pixelWidth;
camHeight = myCamera.pixelHeight;
if (labelConfig == null)
{

Debug.LogError("targetTexture supplied to SemanticSegmentationLabeler must be in Linear mode. Disabling labeler.");
this.enabled = false;
}
var renderTextureDescriptor = new RenderTextureDescriptor(width, height, GraphicsFormat.R8G8B8A8_UNorm, 8);
var renderTextureDescriptor = new RenderTextureDescriptor(camWidth, camHeight, GraphicsFormat.R8G8B8A8_UNorm, 8);
m_TargetTextureOverride = new RenderTexture(width, height, 8, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
m_TargetTextureOverride = new RenderTexture(camWidth, camHeight, 8, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Linear);
targetTexture.Create();
targetTexture.name = "Labeling";

m_SemanticSegmentationTextureReader = new RenderTextureReader<Color32>(targetTexture, myCamera,
(frameCount, data, tex) => OnSemanticSegmentationImageRead(frameCount, data));
visualizationEnabled = supportsVisualization;
}
void OnSemanticSegmentationImageRead(int frameCount, NativeArray<Color32> data)

annotation.ReportFile(datasetRelativePath);
var asyncRequest = Manager.Instance.CreateRequest<AsyncRequest<AsyncSemanticSegmentationWrite>>();
if (visualizationEnabled)
VisualizeSegmentationTexture(data, targetTexture);
imageReadback?.Invoke(new ImageReadbackEventArgs
{
data = data,

m_TargetTextureOverride.Release();
m_TargetTextureOverride = null;
}
/// <inheritdoc/>
protected override void PopulateVisualizationPanel(ControlPanel panel)
{
panel.AddToggleControl("Segmentation Information", enabled => { visualizationEnabled = enabled; });
defaultSegmentTransparency = 0.8f;
defaultBackgroundTransparency = 0.0f;
panel.AddSliderControl("Object Alpha", defaultSegmentTransparency, val => {
if (segImage != null) segImage.material.SetFloat("_SegmentTransparency", val);
});
panel.AddSliderControl("Background Alpha", defaultBackgroundTransparency, val => {
if (segImage != null) segImage.material.SetFloat("_BackTransparency", val);
});
segVisual = GameObject.Instantiate(Resources.Load<GameObject>("SegmentTexture"));
segImage = segVisual.GetComponent<RawImage>();
segImage.material.SetFloat("_SegmentTransparency", defaultSegmentTransparency);
segImage.material.SetFloat("_BackTransparency", defaultBackgroundTransparency);
RectTransform rt = segVisual.transform as RectTransform;
rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, camWidth);
rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, camHeight);
visualizationCanvas.AddComponent(segVisual, setAsLowestElement: true);
}
void VisualizeSegmentationTexture(NativeArray<Color32> data, RenderTexture texture)
{
var cpuTexture = new Texture2D(texture.width, texture.height, GraphicsFormat.R8G8B8A8_UNorm, TextureCreationFlags.None);
cpuTexture.LoadRawTextureData(data);
cpuTexture.Apply();
segImage.texture = cpuTexture;
}
/// <inheritdoc/>
override protected void OnVisualizerEnabledChanged(bool enabled)
{
if (segVisual != null)
segVisual.SetActive(enabled);
}
}
}

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


using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

using UnityEngine.Experimental.Rendering;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
using UnityEngine.UI;
#if HDRP_PRESENT
using UnityEngine.Rendering.HighDefinition;
#endif

List<CameraLabeler> m_Labelers = new List<CameraLabeler>();
Dictionary<string, object> m_PersistentSensorData = new Dictionary<string, object>();
#if URP_PRESENT
internal List<ScriptableRenderPass> passes = new List<ScriptableRenderPass>();
public void AddScriptableRenderPass(ScriptableRenderPass pass)
{
passes.Add(pass);
}
#endif
bool m_CapturedLastFrame;
Ego m_EgoMarker;

#pragma warning restore 414
static PerceptionCamera s_VisualizedPerceptionCamera;
static GameObject s_VisualizationCamera;
static GameObject s_VisualizationCanvas;
/// <summary>
/// Turns on/off the realtime visualization capability.
/// </summary>
[SerializeField]
public bool showVisualizations = true;
bool m_ShowingVisualizations;
/// <summary>
/// The <see cref="SensorHandle"/> associated with this camera. Use this to report additional annotations and metrics at runtime.
/// </summary>

static ProfilerMarker s_FlipY = new ProfilerMarker("Flip Y (PerceptionCamera)");
#if URP_PRESENT
internal List<ScriptableRenderPass> passes = new List<ScriptableRenderPass>();
public void AddScriptableRenderPass(ScriptableRenderPass pass)
{
passes.Add(pass);
}
#endif
VisualizationCanvas visualizationCanvas => m_ShowingVisualizations ? s_VisualizationCanvas.GetComponent<VisualizationCanvas>() : null;
/// <summary>
/// Add a data object which will be added to the dataset with each capture. Overrides existing sensor data associated with the given key.

SensorHandle = DatasetCapture.RegisterSensor(ego, "camera", description, period, startTime);
SetupInstanceSegmentation();
var cam = GetComponent<Camera>();
#if UNITY_EDITOR || DEVELOPMENT_BUILD
SetupVisualizationCamera(cam);
#endif
DatasetCapture.SimulationEnding += OnSimulationEnding;
}
void OnEnable()
{
DatasetCapture.SimulationEnding += OnSimulationEnding;
}
void Start()
{
var cam = GetComponent<Camera>();
cam.enabled = false;
void SetupVisualizationCamera(Camera cam)
{
var visualizationAllowed = s_VisualizedPerceptionCamera == null;
if (!visualizationAllowed && showVisualizations)
{
Debug.LogWarning($"Currently only one PerceptionCamera may be visualized at a time. Disabling visualization on {gameObject.name}.");
showVisualizations = false;
return;
}
if (!showVisualizations)
return;
m_ShowingVisualizations = true;
s_VisualizedPerceptionCamera = this;
// set up to render to a render texture instead of the screen
var visualizationRenderTexture = new RenderTexture(new RenderTextureDescriptor(cam.pixelWidth, cam.pixelHeight, UnityEngine.Experimental.Rendering.GraphicsFormat.R8G8B8A8_UNorm, 8));
visualizationRenderTexture.name = cam.name + "_visualization_texture";
cam.targetTexture = visualizationRenderTexture;
s_VisualizationCamera = new GameObject(cam.name + "_VisualizationCamera");
var visualizationCameraComponent = s_VisualizationCamera.AddComponent<Camera>();
int layerMask = 1 << LayerMask.NameToLayer("UI");
visualizationCameraComponent.orthographic = true;
visualizationCameraComponent.cullingMask = layerMask;
s_VisualizationCanvas = GameObject.Instantiate(Resources.Load<GameObject>("VisualizationUI"));
s_VisualizationCanvas.name = cam.name + "_VisualizationCanvas";
var canvas = s_VisualizationCanvas.GetComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceCamera;
canvas.worldCamera = visualizationCameraComponent;
var imgObj = new GameObject(cam.name + "_Image");
var img = imgObj.AddComponent<RawImage>();
img.texture = visualizationRenderTexture;
var rect = imgObj.transform as RectTransform;
rect.SetParent(s_VisualizationCanvas.transform, false);
//ensure the rgb image is rendered in the back
rect.SetAsFirstSibling();
rect.anchorMin = new Vector2(0, 0);
rect.anchorMax = new Vector2(1, 1);
rect.pivot = new Vector2(0.5f, 0.5f);
rect.offsetMax = Vector2.zero;
rect.offsetMin = Vector2.zero;
}
void CheckForRendererFeature(ScriptableRenderContext context, Camera camera)
{

if (!SensorHandle.IsValid)
return;
var cam = GetComponent<Camera>();
cam.enabled = SensorHandle.ShouldCaptureThisFrame;
bool anyVisualizing = false;
foreach (var labeler in m_Labelers)
{
if (!labeler.enabled)

labeler.Init(this);
{
labeler.Init(this, visualizationCanvas);
}
anyVisualizing |= labeler.InternalVisualizationEnabled;
if (m_ShowingVisualizations)
CaptureOptions.useAsyncReadbackIfSupported = !anyVisualizing;
}
void LateUpdate()
{
var cam = GetComponent<Camera>();
if (showVisualizations)
{
cam.enabled = false;
if (SensorHandle.ShouldCaptureThisFrame) cam.Render();
}
else
cam.enabled = SensorHandle.ShouldCaptureThisFrame;
}
void OnValidate()

return camera.targetTexture != null || hdAdditionalCameraData.flipYMode == HDAdditionalCameraData.FlipYMode.ForceFlipY || camera.cameraType == CameraType.Game;
#elif URP_PRESENT
return (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Metal) &&
(camera.targetTexture != null || camera.cameraType == CameraType.Game);
(camera.targetTexture == null && camera.cameraType == CameraType.Game);
#else
return false;
#endif

continue;
if (!labeler.isInitialized)
labeler.Init(this);
labeler.Init(this, visualizationCanvas);
labeler.InternalOnBeginRendering();
}

{
RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering;
RenderPipelineManager.endCameraRendering -= CheckForRendererFeature;
}
void OnDestroy()
{
RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering;
CleanupVisualization();
}
void CleanupVisualization()
{
if (s_VisualizedPerceptionCamera == this)
{
Destroy(s_VisualizationCamera);
Destroy(s_VisualizationCanvas);
s_VisualizedPerceptionCamera = null;
s_VisualizationCamera = null;
s_VisualizationCanvas = null;
}
}
/// <summary>

23
com.unity.perception/Runtime/GroundTruth/RenderTextureReader.cs


this.m_CameraRenderingToSource = cameraRenderingToSource;
m_NextFrameToCapture = Time.frameCount;
if (!GraphicsUtilities.SupportsAsyncReadback())
m_CpuTexture = new Texture2D(m_Source.width, m_Source.height, m_Source.graphicsFormat, TextureCreationFlags.None);
RenderPipelineManager.endFrameRendering += OnEndFrameRendering;
}

if (!GraphicsUtilities.SupportsAsyncReadback())
{
RenderTexture.active = m_Source;
if (m_CpuTexture == null)
m_CpuTexture = new Texture2D(m_Source.width, m_Source.height, m_Source.graphicsFormat, TextureCreationFlags.None);
m_CpuTexture.ReadPixels(new Rect(
Vector2.zero,
new Vector2(m_Source.width, m_Source.height)),

m_ImageReadCallback(Time.frameCount, data, m_Source);
return;
}
var commandBuffer = CommandBufferPool.Get("RenderTextureReader");
var frameCount = Time.frameCount;
commandBuffer.RequestAsyncReadback(m_Source, r => OnGpuReadback(r, frameCount));
context.ExecuteCommandBuffer(commandBuffer);
context.Submit();
CommandBufferPool.Release(commandBuffer);
else
{
var commandBuffer = CommandBufferPool.Get("RenderTextureReader");
var frameCount = Time.frameCount;
commandBuffer.RequestAsyncReadback(m_Source, r => OnGpuReadback(r, frameCount));
context.ExecuteCommandBuffer(commandBuffer);
context.Submit();
CommandBufferPool.Release(commandBuffer);
}
}
void OnGpuReadback(AsyncGPUReadbackRequest request, int frameCount)

2
com.unity.perception/Runtime/GroundTruth/SemanticSegmentationPass.cs


protected override void Execute(ScriptableRenderContext renderContext, CommandBuffer cmd, HDCamera hdCamera, CullingResults cullingResult)
{
CoreUtils.SetRenderTarget(cmd, targetTexture, ClearFlag.All);
CoreUtils.SetRenderTarget(cmd, targetTexture);
m_SemanticSegmentationCrossPipelinePass.Execute(renderContext, cmd, hdCamera.camera, cullingResult);
}
}

12
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetCaptureTests.cs


AssertJsonFileEquals(annotationDefinitionsJsonExpected, annotationDefinitionsPath);
FileAssert.Exists(capturesPath);
StringAssert.Contains(annotationsJsonExpected, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(annotationsJsonExpected), EscapeGuids(File.ReadAllText(capturesPath)));
}
[Test]

var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
FileAssert.Exists(capturesPath);
StringAssert.Contains(expectedAnnotation, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(expectedAnnotation), EscapeGuids(File.ReadAllText(capturesPath)));
}
[Test]

var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
FileAssert.Exists(capturesPath);
StringAssert.Contains(expectedAnnotation, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(expectedAnnotation), EscapeGuids(File.ReadAllText(capturesPath)));
}
public struct TestValues

var capturesPath = Path.Combine(DatasetCapture.OutputDirectory, "captures_000.json");
FileAssert.Exists(capturesPath);
StringAssert.Contains(expectedAnnotation, EscapeGuids(File.ReadAllText(capturesPath)));
StringAssert.Contains(TestHelper.NormalizeJson(expectedAnnotation), EscapeGuids(File.ReadAllText(capturesPath)));
}
[Test]

jsonExpected = Regex.Replace(jsonExpected, "^\\s*", "", RegexOptions.Multiline);
}
jsonActual = TestHelper.NormalizeJson(jsonActual);
jsonExpected = TestHelper.NormalizeJson(jsonExpected);
Assert.AreEqual(jsonExpected, jsonActual, $"Expected:\n{jsonExpected}\nActual:\n{jsonActual}");
}

result = TestHelper.NormalizeJson(result);
return result;
}
}

8
com.unity.perception/Tests/Runtime/GroundTruthTests/DatasetJsonUtilityTests.cs


public void Vector3ToJToken_ReturnsArrayFormat(float x, float y, float z, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new Vector3(x, y, z));
Assert.AreEqual(jsonExpected, jsonActual.ToString());
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual.ToString()));
}
[Test]

public void QuaternionToJToken_ReturnsArrayFormat(float x, float y, float z, float w, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new Quaternion(x, y, z, w)).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
[Test]

public void Float3x3ToJToken_ReturnsArrayFormat(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(new float3x3(m00, m01, m02, m10, m11, m12, m20, m21, m22)).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
[TestCase(1, "1")]

public void Primitive_ReturnsValue(object o, string jsonExpected)
{
var jsonActual = DatasetJsonUtility.ToJToken(o).ToString();
Assert.AreEqual(jsonExpected, jsonActual);
Assert.AreEqual(TestHelper.NormalizeJson(jsonExpected), TestHelper.NormalizeJson(jsonActual));
}
}
}

27
com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs


break;
case SegmentationKind.Semantic:
expectedPixelValue = k_SemanticPixelValue;
cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.frameCount, a.data, a.sourceTexture));
cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.frameCount, a.data, a.sourceTexture), false);
break;
}

CollectionAssert.AreEqual(Enumerable.Repeat(expectedPixelValue, data.Length), data);
}
var cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.data));
var cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.data), false);
AddTestObjectForCleanup(TestHelper.CreateLabeledPlane(label: "non-matching"));
yield return null;

}
[UnityTest]
public IEnumerator SemanticSegmentationPass_WithEmptyFrame_ProducesBlack()
public IEnumerator SemanticSegmentationPass_WithEmptyFrame_ProducesBlack([Values(false, true)] bool showVisualizations)
{
int timesSegmentationImageReceived = 0;
var expectedPixelValue = new Color32(0, 0, 0, 255);

CollectionAssert.AreEqual(Enumerable.Repeat(expectedPixelValue, data.Length), data);
}
var cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.data));
var cameraObject = SetupCameraSemanticSegmentation(a => OnSegmentationImageReceived(a.data), showVisualizations);
//TestHelper.LoadAndStartRenderDocCapture(out var gameView);
yield return null;
var segLabeler = (SemanticSegmentationLabeler)cameraObject.GetComponent<PerceptionCamera>().labelers[0];
var request = AsyncGPUReadback.Request(segLabeler.targetTexture, callback: r =>

AsyncGPUReadback.WaitAllRequests();
//RenderDoc.EndCaptureRenderDoc(gameView);
//request.WaitForCompletion();
Assert.IsTrue(request.done);
Assert.IsFalse(request.hasError);

}
[UnityTest]
public IEnumerator SemanticSegmentationPass_WithTextureOverride_RendersToOverride()
public IEnumerator SemanticSegmentationPass_WithTextureOverride_RendersToOverride([Values(true, false)] bool showVisualizations)
var cameraObject = SetupCamera(out var perceptionCamera);
var cameraObject = SetupCamera(out var perceptionCamera, showVisualizations);
var labelConfig = ScriptableObject.CreateInstance<SemanticSegmentationLabelConfig>();
labelConfig.Init(new List<SemanticSegmentationLabelEntry>()
{

var cameraObject = segmentationKind == SegmentationKind.Instance ?
SetupCameraInstanceSegmentation(OnSegmentationImageReceived<uint>) :
SetupCameraSemanticSegmentation((a) => OnSegmentationImageReceived<Color32>(a.frameCount, a.data, a.sourceTexture));
SetupCameraSemanticSegmentation((a) => OnSegmentationImageReceived<Color32>(a.frameCount, a.data, a.sourceTexture), false);
object expectedPixelValue = segmentationKind == SegmentationKind.Instance ? (object) 1 : k_SemanticPixelValue;
expectedLabelAtFrame = new Dictionary<int, object>

GameObject SetupCameraInstanceSegmentation(Action<int, NativeArray<uint>, RenderTexture> onSegmentationImageReceived)
{
var cameraObject = SetupCamera(out var perceptionCamera);
var cameraObject = SetupCamera(out var perceptionCamera, false);
GameObject SetupCameraSemanticSegmentation(Action<SemanticSegmentationLabeler.ImageReadbackEventArgs> onSegmentationImageReceived)
GameObject SetupCameraSemanticSegmentation(Action<SemanticSegmentationLabeler.ImageReadbackEventArgs> onSegmentationImageReceived, bool showVisualizations)
var cameraObject = SetupCamera(out var perceptionCamera);
var cameraObject = SetupCamera(out var perceptionCamera, showVisualizations);
var labelConfig = ScriptableObject.CreateInstance<SemanticSegmentationLabelConfig>();
labelConfig.Init(new List<SemanticSegmentationLabelEntry>()
{

return cameraObject;
}
GameObject SetupCamera(out PerceptionCamera perceptionCamera)
GameObject SetupCamera(out PerceptionCamera perceptionCamera, bool showVisualizations)
{
var cameraObject = new GameObject();
cameraObject.SetActive(false);

perceptionCamera = cameraObject.AddComponent<PerceptionCamera>();
perceptionCamera.captureRgbImages = false;
perceptionCamera.showVisualizations = showVisualizations;
AddTestObjectForCleanup(cameraObject);
return cameraObject;

4
com.unity.perception/Tests/Runtime/GroundTruthTests/TestHelper.cs


}
#endif
public static string NormalizeJson(string json)
{
return json.Replace("\r\n", "\n");
}
}
}

1001
com.unity.perception/Documentation~/images/controls.gif
文件差异内容过多而无法显示
查看文件

599
com.unity.perception/Documentation~/images/visualized.png
文件差异内容过多而无法显示
查看文件

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization.meta


fileFormatVersion: 2
guid: 881ad38fbb74b406f944b05f3a341b1f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

96
com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs


using System.Collections;
using System.Text.RegularExpressions;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Perception.GroundTruth;
using UnityEngine.TestTools;
namespace GroundTruthTests
{
[TestFixture]
public class VisualizationTests : GroundTruthTestBase
{
[Test]
public void VisualizedCamera_SetsUpCanvasAndSecondCamera()
{
var object1 = new GameObject();
object1.name = nameof(VisualizedCamera_SetsUpCanvasAndSecondCamera);
object1.SetActive(false);
var camera = object1.AddComponent<Camera>();
var perceptionCamera1 = object1.AddComponent<PerceptionCamera>();
perceptionCamera1.showVisualizations = true;
object1.SetActive(true);
AddTestObjectForCleanup(object1);
Assert.IsNotNull(camera.targetTexture);
Assert.IsNotNull(GameObject.Find(nameof(VisualizedCamera_SetsUpCanvasAndSecondCamera) + "_VisualizationCamera"));
Assert.IsNotNull(GameObject.Find(nameof(VisualizedCamera_SetsUpCanvasAndSecondCamera) + "_VisualizationCanvas"));
}
[Test]
public void TwoCamerasVisualizing_CausesWarningAndDisablesVisualization()
{
var object1 = new GameObject();
object1.name = nameof(TwoCamerasVisualizing_CausesWarningAndDisablesVisualization);
object1.SetActive(false);
object1.AddComponent<Camera>();
var perceptionCamera1 = object1.AddComponent<PerceptionCamera>();
perceptionCamera1.showVisualizations = true;
AddTestObjectForCleanup(object1);
var object2 = new GameObject();
object2.SetActive(false);
object2.name = nameof(TwoCamerasVisualizing_CausesWarningAndDisablesVisualization) + "2";
object2.AddComponent<Camera>();
var perceptionCamera2 = object2.AddComponent<PerceptionCamera>();
perceptionCamera2.showVisualizations = true;
AddTestObjectForCleanup(object2);
object1.SetActive(true);
LogAssert.Expect(LogType.Warning, $"Currently only one PerceptionCamera may be visualized at a time. Disabling visualization on {nameof(TwoCamerasVisualizing_CausesWarningAndDisablesVisualization)}2.");
object2.SetActive(true);
}
[UnityTest]
public IEnumerator DestroyCamera_RemovesVisualization()
{
var object1 = new GameObject();
object1.name = nameof(DestroyCamera_RemovesVisualization);
object1.SetActive(false);
object1.AddComponent<Camera>();
var perceptionCamera1 = object1.AddComponent<PerceptionCamera>();
perceptionCamera1.showVisualizations = true;
object1.SetActive(true);
AddTestObjectForCleanup(object1);
Assert.IsNotNull(GameObject.Find(nameof(DestroyCamera_RemovesVisualization) + "_VisualizationCamera"));
Object.DestroyImmediate(object1);
//wait a frame to allow objects destroyed via Destroy() to be cleaned up
yield return null;
Assert.IsNull(GameObject.Find(nameof(DestroyCamera_RemovesVisualization) + "_VisualizationCamera"));
}
[Test]
public void DestroyAndRecreateCamera_ProperlyVisualizes()
{
var object1 = new GameObject();
object1.name = nameof(DestroyAndRecreateCamera_ProperlyVisualizes);
object1.SetActive(false);
object1.AddComponent<Camera>();
var perceptionCamera1 = object1.AddComponent<PerceptionCamera>();
perceptionCamera1.showVisualizations = true;
object1.SetActive(true);
AddTestObjectForCleanup(object1);
Object.DestroyImmediate(object1);
var object2 = new GameObject();
object2.name = nameof(DestroyAndRecreateCamera_ProperlyVisualizes) + "2";
object2.SetActive(false);
var camera2 = object2.AddComponent<Camera>();
var perceptionCamera2 = object2.AddComponent<PerceptionCamera>();
perceptionCamera2.showVisualizations = true;
object2.SetActive(true);
AddTestObjectForCleanup(object2);
Assert.IsNotNull(camera2.targetTexture);
Assert.IsNotNull(GameObject.Find(nameof(DestroyAndRecreateCamera_ProperlyVisualizes) + "2_VisualizationCamera"));
}
}
}

11
com.unity.perception/Tests/Runtime/GroundTruthTests/VisualizationTests.cs.meta


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

125
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs


using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{
/// <summary>
/// The control panel for labeler visualizers. This panel resides in the upper right hand corner of
/// the display. Any UI element can be added to the panel, but it contains helper methods to quickly
/// create some of the most common control panel display elements: toggles and sliders.
/// </summary>
public class ControlPanel : MonoBehaviour
{
HashSet<GameObject> m_Controls = new HashSet<GameObject>();
/// <summary>
/// Retrieves a list of the current controls in the control panel.
/// </summary>
public IEnumerable<GameObject> controls => m_Controls;
/// <summary>
/// Adds a new UI control to the control panel. If the control cannot be added and the method will
/// return false. Also, all UI elements must have a LayoutElement component and if they do not,
/// this method will reject the new element, and return false.
/// </summary>
/// <param name="uiControl">The control that is to be added to the control panel</param>
/// <returns>True if the control could be added, false if it there was a problem adding it</returns>
public bool AddNewControl(GameObject uiControl)
{
if (uiControl.GetComponent<RectTransform>() == null)
{
Debug.LogError("Control panel UI control must have a rect transform component.");
return false;
}
if (uiControl.GetComponent<LayoutElement>() == null)
{
Debug.LogError("Control panel UI control must contain a layout element component.");
return false;
}
if (m_Controls.Add(uiControl))
{
uiControl.transform.SetParent(this.transform, false);
return true;
}
return false;
}
/// <summary>
/// Removes the passed in component from the control panel. Returns
/// false if the element does not exist. Returns true on a successful removal.
/// The caller is responsible for destroying the control.
/// </summary>
/// <param name="uiControl">The control that needs to be removed from the panel</param>
/// <returns>True if the control could be removed, false if there was an issue removing the control</returns>
public bool RemoveControl(GameObject uiControl)
{
if (m_Controls.Remove(uiControl))
{
uiControl.transform.SetParent(null);
return true;
}
return false;
}
/// <summary>
/// Creates a new toggle control with passed in name. The passed in listener will be
/// called on toggle clicks. If anything goes wrong this method will return null.
/// Returns the control panel element upon a successful add.
/// </summary>
/// <param name="name">The name of the toggle</param>
/// <param name="listener">The callback action that will be triggered when the toggle's state changes</param>
/// <returns>The created toggle</returns>
public GameObject AddToggleControl(string name, UnityAction<bool> listener)
{
if (listener == null)
{
Debug.LogWarning("Adding toggle to control panel without a listener, nothing will respond to user's clicks");
}
var toggle = GameObject.Instantiate(Resources.Load<GameObject>("GenericToggle"));
toggle.transform.SetParent(this.transform, false);
toggle.GetComponentInChildren<Text>().text = name;
toggle.GetComponent<Toggle>().onValueChanged.AddListener(listener);
m_Controls.Add(toggle);
return toggle;
}
/// <summary>
/// Creates a new slider control with the passed in name and default value. The slider's value runs from 0 to 1.
/// The passed in listener will be called on slider changes. If anything goes wrong this method will return null.
/// Returns the control panel element upon a successful add.
/// </summary>
/// <param name="name">The name of the slider control</param>
/// <param name="defaultValue">The default value of the slider, between 0 and 1</param>
/// <param name="listener">The callback action that will be triggered when the slider's value changes</param>
/// <returns>The created slider</returns>
public GameObject AddSliderControl(string name, float defaultValue, UnityAction<float> listener)
{
if (listener == null)
{
Debug.LogWarning("Adding slider to control panel without a listener, nothing will respond to user's interactions");
}
var gameObject = GameObject.Instantiate(Resources.Load<GameObject>("GenericSlider"));
gameObject.transform.SetParent(this.transform, false);
gameObject.GetComponentInChildren<Text>().text = name;
var slider = gameObject.GetComponentInChildren<Slider>();
slider.value = defaultValue;
slider.onValueChanged.AddListener(listener);
m_Controls.Add(gameObject);
return gameObject;
}
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/ControlPanel.cs.meta


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

131
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs


using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{
/// <summary>
/// Heads up display panel used to publish a key value pair on the screen. Items added to this need
/// to have their values updated every frame, or else, they will be determined to be stale and removed
/// from the view and re-used for a new entry.
/// </summary>
public class HUDPanel : MonoBehaviour
{
Dictionary<string, (bool, KeyValuePanel)> entries = new Dictionary<string, (bool, KeyValuePanel)>();
Stack<KeyValuePanel> orphans = new Stack<KeyValuePanel>();
/// <summary>
/// The panel that will hold all of the key value panel elements, this reference is needed to be able to hide the panel
/// </summary>
public GameObject contentPanel = null;
/// <summary>
/// The scroll rect of the HUD panel, this reference is needed to be able to hide the panel
/// </summary>
public ScrollRect scrollRect = null;
/// <summary>
/// The background image of the HUD panel, this reference is needed to be able to hide the panel
/// </summary>
public Image img = null;
void Update()
{
if (entries.Any() != scrollRect.enabled)
{
scrollRect.enabled = !scrollRect.enabled;
img.enabled = scrollRect.enabled;
foreach (var i in GetComponentsInChildren<Image>())
{
i.enabled = scrollRect.enabled;
}
}
// Go through everyone that has not been updated and remove them and
// if they have been updated mark them dirty for next round
var keys = new List<string>(entries.Keys);
foreach (var key in keys)
{
var entry = entries[key];
if (!entry.Item1)
{
entry.Item2.gameObject.SetActive(false);
orphans.Push(entry.Item2);
}
else
{
entry.Item1 = false;
entries[key] = entry;
}
}
}
/// <summary>
/// Updates (or creates) an entry with the passed in key value pair
/// </summary>
/// <param name="key">The key of the HUD entry</param>
/// <param name="value">The value of the entry</param>
public void UpdateEntry(string key, string value)
{
(bool, KeyValuePanel) val;
if (!entries.ContainsKey(key))
{
if (orphans.Any())
{
val = (true, orphans.Pop());
val.Item2.gameObject.SetActive(true);
}
else
{
val = (true, GameObject.Instantiate(Resources.Load<GameObject>("KeyValuePanel")).GetComponent<KeyValuePanel>());
val.Item2.transform.SetParent(contentPanel.transform, false);
}
val.Item2.SetKey(key);
}
else
{
val = entries[key];
val.Item1 = true;
}
val.Item2.SetValue(value);
entries[key] = val;
}
/// <summary>
/// Removes the key value pair from the HUD
/// </summary>
/// <param name="key">The key of the entry to remove</param>
public void RemoveEntry(string key)
{
if (entries.ContainsKey(key))
{
var entry = entries[key];
entry.Item2.gameObject.SetActive(false);
entries.Remove(key);
orphans.Push(entry.Item2);
}
}
/// <summary>
/// Removes all of the passed in entries from the HUD
/// </summary>
/// <param name="keys">List of keys to remove from the panel</param>
public void RemoveEntries(List<string> keys)
{
foreach (var k in keys) RemoveEntry(k);
}
/// <summary>
/// Removes all of the passed in entries from the HUD
/// </summary>
/// <param name="keys">List of keys t remove from the panel</param>
public void RemoveEntries(string[] keys)
{
foreach (var k in keys) RemoveEntry(k);
}
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/HUDPanel.cs.meta


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

41
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace UnityEngine.Perception.GroundTruth
{
/// <summary>
/// Key value pair panel UI object
/// </summary>
public class KeyValuePanel : MonoBehaviour
{
/// <summary>
/// Key UI text element of the panel
/// </summary>
public Text key = null;
/// <summary>
/// Value UI text element of the panel
/// </summary>
public Text value = null;
/// <summary>
/// Sets the key of this key value pair
/// </summary>
/// <param name="k">The key of the key/value pair</param>
public void SetKey(string k)
{
if (k == null || k == string.Empty) return;
key.text = k;
}
/// <summary>
/// Sets the value of this key value pair
/// </summary>
/// <param name="v">The value of the key/value pair</param>
public void SetValue(string v)
{
value.text = v;
}
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/KeyValuePanel.cs.meta


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

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials.meta


fileFormatVersion: 2
guid: 0047f4aab94b34de280b855f85e27bfb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

92
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/OutlineMaterial.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6196874654385650420
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: OutlineMaterial
m_Shader: {fileID: 4800000, guid: 650dd9526735d5b46b79224bc6e94025, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3050
stringTagMap:
RenderType: Transparent
disabledShaderPasses:
- SHADOWCASTER
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 2800000, guid: 44b5bee1ec2ca43c092ad21cd29748a8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 44b5bee1ec2ca43c092ad21cd29748a8, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 0
- _Blend: 0
- _BumpScale: 1
- _Cull: 2
- _Cutoff: 0.5
- _DstBlend: 10
- _EnvironmentReflections: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 0
- _SrcBlend: 5
- _Surface: 1
- _WorkflowMode: 0
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 0, g: 0.6256573, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/OutlineMaterial.mat.meta


fileFormatVersion: 2
guid: f36a73e2b367840afa68b31b712a0986
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

168
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SegmentationMaterial
m_Shader: {fileID: 4800000, guid: 2466ee374918c4aaea96fd1134177d71, type: 3}
m_ShaderKeywords: _ALPHATEST_ON
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses:
- SHADOWCASTER
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _AlphaTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BaseTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailTex:
m_Texture: {fileID: 2800000, guid: cadd6a00019fd4eeab962e3a12fabed6, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MaskTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _NormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaClip: 1
- _BackTransparency: 0
- _Blend: 2
- _BlendOp: 0
- _BumpScale: 1
- _CameraFadingEnabled: 0
- _CameraFarFadeDistance: 2
- _CameraNearFadeDistance: 1
- _ColorMask: 15
- _ColorMode: 0
- _Cull: 2
- _Cutoff: 0.47
- _DetailNormalMapScale: 1
- _DistortionBlend: 0.5
- _DistortionEnabled: 0
- _DistortionStrength: 1
- _DistortionStrengthScaled: 0.1
- _DstBlend: 1
- _EnableExternalAlpha: 0
- _EnvironmentReflections: 1
- _FlipbookBlending: 0
- _FlipbookMode: 0
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossinessSource: 0
- _GlossyReflections: 0
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueOffset: 0
- _ReceiveShadows: 1
- _SampleGI: 0
- _SegmentTransparency: 0.8
- _Shininess: 0
- _Smoothness: 0.5
- _SmoothnessSource: 0
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1
- _SoftParticlesNearFadeDistance: 0
- _SpecSource: 0
- _SpecularHighlights: 1
- _SrcBlend: 5
- _Stencil: 0
- _StencilComp: 0
- _StencilOp: 0
- _StencilReadMask: 0
- _StencilWriteMask: 0
- _Strength: 0.2
- _Surface: 1
- _Transparency: 0.445
- _UVSec: 0
- _UseUIAlphaClip: 0
- _WorkflowMode: 1
- _ZWrite: 0
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _BaseColorAddSubDiff: {r: -1, g: 1, b: 0, a: 0}
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _Flip: {r: 1, g: 1, b: 1, a: 1}
- _RemoveColor: {r: 0, g: 0, b: 0, a: 1}
- _RendererColor: {r: 1, g: 1, b: 1, a: 1}
- _ReplaceColor: {r: 1, g: 1, b: 1, a: 0}
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
--- !u!114 &3089368426582508830
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 1

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Materials/SegmentationMaterial.mat.meta


fileFormatVersion: 2
guid: f81ae556e923c4b1d9a6047faeaa99aa
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources.meta


fileFormatVersion: 2
guid: 6998a51e743dc432c9e1edbbed2e2566
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

171
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/BoundingBoxPrefab.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1633194878988975384
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4870595019017500996}
- component: {fileID: 364050011935639306}
- component: {fileID: 7218880252870594959}
m_Layer: 5
m_Name: BoundingBoxPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4870595019017500996
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1633194878988975384}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8991206466818883376}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0, y: 1}
--- !u!222 &364050011935639306
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1633194878988975384}
m_CullTransparentMesh: 0
--- !u!114 &7218880252870594959
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1633194878988975384}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9529412, g: 0.33562368, b: 0.12941174, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 44b5bee1ec2ca43c092ad21cd29748a8, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7937696831727727488
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8991206466818883376}
- component: {fileID: 5224755520443495957}
- component: {fileID: 521312507235122078}
- component: {fileID: 6983286864234823325}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8991206466818883376
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7937696831727727488}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 4870595019017500996}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 5, y: -5}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!222 &5224755520443495957
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7937696831727727488}
m_CullTransparentMesh: 0
--- !u!114 &521312507235122078
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7937696831727727488}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9529412, g: 0.33562368, b: 0.12941174, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 397721830eb764bbc8cd9fecf3ab1290, type: 3}
m_FontSize: 32
m_FontStyle: 1
m_BestFit: 0
m_MinSize: 1
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Object
--- !u!114 &6983286864234823325
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7937696831727727488}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 3, y: -3}
m_UseGraphicAlpha: 1

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/BoundingBoxPrefab.prefab.meta


fileFormatVersion: 2
guid: 85501d694004a4f33a1f56553c9b2b92
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

598
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericSlider.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6374784292818490195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784292818490194}
m_Layer: 5
m_Name: Fill Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784292818490194
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784292818490195}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6374784293898242116}
m_Father: {fileID: 6374784293047607865}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: -5, y: 0}
m_SizeDelta: {x: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6374784293047607862
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784293047607865}
- component: {fileID: 6374784293047607867}
- component: {fileID: 6374784293047607864}
m_Layer: 5
m_Name: Slider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784293047607865
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293047607862}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6374784293886523806}
- {fileID: 6374784292818490194}
- {fileID: 6374784294464427910}
m_Father: {fileID: 6374784293342824938}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 12}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6374784293047607867
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293047607862}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 6374784293723858456}
m_FillRect: {fileID: 6374784293898242116}
m_HandleRect: {fileID: 6374784293723858457}
m_Direction: 0
m_MinValue: 0
m_MaxValue: 1
m_WholeNumbers: 0
m_Value: 0
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
--- !u!114 &6374784293047607864
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293047607862}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: 4
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &6374784293342824939
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784293342824938}
- component: {fileID: 6374784293342824943}
- component: {fileID: 6374784293342824940}
- component: {fileID: 6374784293342824941}
m_Layer: 5
m_Name: GenericSlider
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784293342824938
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293342824939}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6374784294729382760}
- {fileID: 6374784293047607865}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6374784293342824943
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293342824939}
m_CullTransparentMesh: 0
--- !u!114 &6374784293342824940
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293342824939}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &6374784293342824941
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293342824939}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 15
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 3
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 1
m_ChildScaleHeight: 0
--- !u!1 &6374784293723858454
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784293723858457}
- component: {fileID: 6374784293723858459}
- component: {fileID: 6374784293723858456}
m_Layer: 5
m_Name: Handle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784293723858457
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293723858454}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6374784294464427910}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 12, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6374784293723858459
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293723858454}
m_CullTransparentMesh: 0
--- !u!114 &6374784293723858456
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293723858454}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6374784293886523807
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784293886523806}
- component: {fileID: 6374784293886523776}
- component: {fileID: 6374784293886523777}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784293886523806
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293886523807}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6374784293047607865}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.25}
m_AnchorMax: {x: 1, y: 0.75}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6374784293886523776
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293886523807}
m_CullTransparentMesh: 0
--- !u!114 &6374784293886523777
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293886523807}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6374784293898242117
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784293898242116}
- component: {fileID: 6374784293898242118}
- component: {fileID: 6374784293898242119}
m_Layer: 5
m_Name: Fill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784293898242116
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293898242117}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6374784292818490194}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 10, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6374784293898242118
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293898242117}
m_CullTransparentMesh: 0
--- !u!114 &6374784293898242119
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784293898242117}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6374784294464427911
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784294464427910}
m_Layer: 5
m_Name: Handle Slide Area
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784294464427910
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784294464427911}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 6374784293723858457}
m_Father: {fileID: 6374784293047607865}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -12, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6374784294729382761
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6374784294729382760}
- component: {fileID: 6374784294729382765}
- component: {fileID: 6374784294729382762}
- component: {fileID: 6374784294729382763}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &6374784294729382760
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784294729382761}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 6374784293342824938}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 30}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &6374784294729382765
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784294729382761}
m_CullTransparentMesh: 0
--- !u!114 &6374784294729382762
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784294729382761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 397721830eb764bbc8cd9fecf3ab1290, type: 3}
m_FontSize: 24
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Generic Slider
--- !u!114 &6374784294729382763
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6374784294729382761}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericSlider.prefab.meta


fileFormatVersion: 2
guid: 5cdb99a397fb6487590b21a044f8ffcd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

335
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericToggle.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5620663266170330011
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5620663266170330008}
- component: {fileID: 5620663266170330014}
- component: {fileID: 5620663266170330009}
m_Layer: 5
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5620663266170330008
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266170330011}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_Children: []
m_Father: {fileID: 5620663266272600928}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -33, y: -0.5}
m_SizeDelta: {x: 14, y: -3}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5620663266170330014
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266170330011}
m_CullTransparentMesh: 0
--- !u!114 &5620663266170330009
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266170330011}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 397721830eb764bbc8cd9fecf3ab1290, type: 3}
m_FontSize: 24
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: Generic Toggle
--- !u!1 &5620663266272600931
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5620663266272600928}
- component: {fileID: 5620663266272600934}
- component: {fileID: 5620663266272600929}
m_Layer: 5
m_Name: GenericToggle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5620663266272600928
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266272600931}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5620663266814857893}
- {fileID: 5620663266170330008}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &5620663266272600934
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266272600931}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 5620663266814857818}
toggleTransition: 1
graphic: {fileID: 5620663266748790646}
m_Group: {fileID: 0}
onValueChanged:
m_PersistentCalls:
m_Calls: []
m_IsOn: 1
--- !u!114 &5620663266272600929
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266272600931}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: 160
m_PreferredHeight: 20
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &5620663266748790640
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5620663266748790641}
- component: {fileID: 5620663266748790647}
- component: {fileID: 5620663266748790646}
m_Layer: 5
m_Name: Checkmark
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5620663266748790641
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266748790640}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5620663266814857893}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 14, y: 14}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5620663266748790647
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266748790640}
m_CullTransparentMesh: 0
--- !u!114 &5620663266748790646
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266748790640}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 331e953e4177743c6a5ff16884a97dcf, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5620663266814857892
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5620663266814857893}
- component: {fileID: 5620663266814857819}
- component: {fileID: 5620663266814857818}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5620663266814857893
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266814857892}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5620663266748790641}
m_Father: {fileID: 5620663266272600928}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 16, y: 16}
m_Pivot: {x: 1, y: 0.5}
--- !u!222 &5620663266814857819
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266814857892}
m_CullTransparentMesh: 0
--- !u!114 &5620663266814857818
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5620663266814857892}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.16470589, g: 0.16470589, b: 0.16470589, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/GenericToggle.prefab.meta


fileFormatVersion: 2
guid: 4dc80013d4f184e83a0d8c3da1a05417
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/Inter-Light.otf
文件差异内容过多而无法显示
查看文件

22
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/Inter-Light.otf.meta


fileFormatVersion: 2
guid: 397721830eb764bbc8cd9fecf3ab1290
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Inter
fontNames:
- Inter
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

287
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/KeyValuePanel.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3284129489564578195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4595725647490753358}
- component: {fileID: 4496511663627014910}
- component: {fileID: 6034931589588613035}
- component: {fileID: 7049261054784314162}
m_Layer: 5
m_Name: Value
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4595725647490753358
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3284129489564578195}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 5547799090381645220}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 1, y: 0.5}
--- !u!222 &4496511663627014910
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3284129489564578195}
m_CullTransparentMesh: 0
--- !u!114 &6034931589588613035
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3284129489564578195}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.7264151, g: 0.70928264, b: 0.70928264, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 397721830eb764bbc8cd9fecf3ab1290, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: VALUE
--- !u!114 &7049261054784314162
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3284129489564578195}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: 1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &5085956214946841210
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 924712682360615393}
- component: {fileID: 7386780920487943076}
- component: {fileID: 1894703116479988963}
- component: {fileID: 6489701985588846927}
m_Layer: 5
m_Name: Key
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &924712682360615393
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5085956214946841210}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.5, y: 0.5, z: 1}
m_Children: []
m_Father: {fileID: 5547799090381645220}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &7386780920487943076
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5085956214946841210}
m_CullTransparentMesh: 0
--- !u!114 &1894703116479988963
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5085956214946841210}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.7264151, g: 0.70928264, b: 0.70928264, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: 397721830eb764bbc8cd9fecf3ab1290, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 2
m_MaxSize: 40
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: 'KEY:'
--- !u!114 &6489701985588846927
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5085956214946841210}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: 4
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &9007962583023748487
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5547799090381645220}
- component: {fileID: 8878022795811502189}
- component: {fileID: 5555615362143100286}
- component: {fileID: 8848784309261800470}
m_Layer: 5
m_Name: KeyValuePanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5547799090381645220
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9007962583023748487}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 924712682360615393}
- {fileID: 4595725647490753358}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &8878022795811502189
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9007962583023748487}
m_CullTransparentMesh: 0
--- !u!114 &5555615362143100286
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9007962583023748487}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 0
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
--- !u!114 &8848784309261800470
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9007962583023748487}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8ffbc2d71e7b74cdc803e4d76cff5db4, type: 3}
m_Name:
m_EditorClassIdentifier:
key: {fileID: 1894703116479988963}
value: {fileID: 6034931589588613035}

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/KeyValuePanel.prefab.meta


fileFormatVersion: 2
guid: 86c6e42ad096b4b8e8853c8d00f6adbc
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

74
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader


Shader "Perception/SegRemoveBackgroundShader"
{
Properties
{
_MainTex ("Main Texture", 2D) = "defaulttexture" { }
_RemoveColor ("Remove Color", Color) = (0, 0, 0, 1)
_SegmentTransparency("Segment Transparency", Range(0.0,1.0)) = 0.5
_BackTransparency("Background Transparency", Range(0.0,1.0)) = 0
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent" }
LOD 100
ZWrite off
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag Lambert alpha
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
fixed4 _RemoveColor;
float _SegmentTransparency;
float _BackTransparency;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
if (abs(col.r - _RemoveColor.r) < .01f)
{
if (abs(col.g - _RemoveColor.g) < .01f)
{
if (abs(col.b - _RemoveColor.b) < .01f)
{
col.a = _BackTransparency;
}
}
}
if (abs(col.a - _BackTransparency) > .01f) col.a = _SegmentTransparency;
return col;
}
ENDCG
}
}
}

9
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegRemoveBackgroundShader.shader.meta


fileFormatVersion: 2
guid: 2466ee374918c4aaea96fd1134177d71
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

73
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegmentTexture.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6732225215165335482
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 968786849326295845}
- component: {fileID: 84779842494960409}
- component: {fileID: 5662008187905630377}
m_Layer: 5
m_Name: SegmentTexture
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &968786849326295845
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6732225215165335482}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0, y: 1}
--- !u!222 &84779842494960409
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6732225215165335482}
m_CullTransparentMesh: 0
--- !u!114 &5662008187905630377
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6732225215165335482}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 2100000, guid: f81ae556e923c4b1d9a6047faeaa99aa, type: 2}
m_Color: {r: 0.4, g: 0.4627451, b: 0.73333335, a: 1}
m_RaycastTarget: 0
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/SegmentTexture.prefab.meta


fileFormatVersion: 2
guid: 6cff9bccc14a649b59b9e4a19d0b3ba9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

1001
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/VisualizationUI.prefab
文件差异内容过多而无法显示
查看文件

7
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Resources/VisualizationUI.prefab.meta


fileFormatVersion: 2
guid: 5d7678e45cbe34953884861e62372b0d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures.meta


fileFormatVersion: 2
guid: 83860b6228dcb4df5acdc9ea3e144e9a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/outline_box.png

之前 之后
宽度: 100  |  高度: 100  |  大小: 2.1 KiB

104
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/outline_box.png.meta


fileFormatVersion: 2
guid: 44b5bee1ec2ca43c092ad21cd29748a8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 0
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 2, y: 2, z: 2, w: 2}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

3
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/sharp_done_white_18dp.png

之前 之后
宽度: 36  |  高度: 36  |  大小: 171 B

104
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/Textures/sharp_done_white_18dp.png.meta


fileFormatVersion: 2
guid: 331e953e4177743c6a5ff16884a97dcf
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

79
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
namespace UnityEngine.Perception.GroundTruth
{
/// <summary>
/// The visualization canvas. This canvas should contain all labeler visualization components.
/// All visualizlation components should be added to this canvas via teh AddComponent method.
/// </summary>
public class VisualizationCanvas : MonoBehaviour
{
/// <summary>
/// The control panel contains the UI control elements used to interact with the labelers.
/// </summary>
public ControlPanel controlPanel;
/// <summary>
/// The HUD panel displays realtime key/value pair data on a UI panel.
/// </summary>
public HUDPanel hudPanel;
/// <summary>
/// Game object which acts as the scene container for all of the dynamic labeler visuals
/// </summary>
public GameObject dynaicContentHolder;
// Start is called before the first frame update
void Start()
{
if (GameObject.Find("EventSystem") == null)
{
var eventSystemGo = new GameObject("EventSystem");
eventSystemGo.AddComponent<UnityEngine.EventSystems.EventSystem>();
eventSystemGo.AddComponent<StandaloneInputModule>();
}
}
/// <summary>
/// Adds a new UI components to the visualization canvas. Pass in fullscreen if the component should take up
/// the entire screen. Pass in setAsLowestElement if the component should be rendered behind all other components.
/// This method will return false if the element could not be added, true if everything works properly.
/// </summary>
/// <param name="component">UI component that should be added to this UI canvas</param>
/// <param name="fullScreen">Should this component's rect transform be set to fill the entire dimensions of the parent, defaults to true</param>
/// <param name="setAsLowestElement">Should this UI component be rendered as the lowest UI component in the scene, defaults to false</param>
/// <returns>True if the component was added properly, false if an error occurred.</returns>
public bool AddComponent(GameObject component, bool fullScreen = true, bool setAsLowestElement = false)
{
if (component == null)
{
Debug.LogError("Trying to add a null component to VisualizationCanvas");
return false;
}
RectTransform trans = component.GetComponent<RectTransform>();
if (trans == null)
{
Debug.LogWarning("Adding UI element without a rect transform, adding one to it");
trans = component.AddComponent<RectTransform>();
}
if (fullScreen)
{
trans.anchorMin = new Vector2(0, 0);
trans.anchorMax = new Vector2(1, 1);
trans.pivot = new Vector2(0.5f, 0.5f);
trans.offsetMax = new Vector2(0, 0);
trans.offsetMin = new Vector2(0, 0);
}
trans.SetParent(dynaicContentHolder.transform, false);
if (setAsLowestElement) component.transform.SetAsFirstSibling();
return true;
}
}
}

11
com.unity.perception/Runtime/GroundTruth/Labelers/Visualization/VisualizationCanvas.cs.meta


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

0
.gitmodules

正在加载...
取消
保存