浏览代码

Updating HDRP test project. Implementing CameraLabeler runtime and adding tests.

/labeler_mock_mb
Jon Hogins 4 年前
当前提交
d5159004
共有 31 个文件被更改,包括 946 次插入230 次删除
  1. 139
      TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity
  2. 1
      TestProjects/PerceptionHDRP/Packages/manifest.json
  3. 2
      TestProjects/PerceptionHDRP/ProjectSettings/EditorSettings.asset
  4. 4
      TestProjects/PerceptionHDRP/ProjectSettings/ProjectVersion.txt
  5. 101
      TestProjects/PerceptionURP/Assets/Scenes/SampleScene.unity
  6. 14
      TestProjects/PerceptionURP/Assets/SemanticSegmentationLabelingConfiguration.asset
  7. 1
      TestProjects/PerceptionURP/Packages/manifest.json
  8. 16
      TestProjects/PerceptionURP/Packages/packages-lock.json
  9. 2
      TestProjects/PerceptionURP/ProjectSettings/QualitySettings.asset
  10. 15
      com.unity.perception/Editor/GroundTruth/PerceptionCameraEditor.cs
  11. 2
      com.unity.perception/Editor/GroundTruth/SemanticSegmentationPassEditor.cs
  12. 11
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBoxLabeler.cs
  13. 23
      com.unity.perception/Runtime/GroundTruth/Labelers/CameraLabeler.cs
  14. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/ObjectCountLabeler.cs
  15. 8
      com.unity.perception/Runtime/GroundTruth/Labelers/RenderedObjectInfoLabeler.cs
  16. 21
      com.unity.perception/Runtime/GroundTruth/Labelers/SemanticSegmentationLabeler.cs
  17. 7
      com.unity.perception/Runtime/GroundTruth/Labeling/LabelingConfiguration.cs
  18. 23
      com.unity.perception/Runtime/GroundTruth/Labeling/LabelingConfiguration2.cs
  19. 56
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
  20. 10
      com.unity.perception/Runtime/GroundTruth/PerceptionCamera_InstanceSegmentation.cs
  21. 8
      com.unity.perception/Runtime/GroundTruth/SemanticSegmentationPass.cs
  22. 4
      com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs
  23. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/ObjectCountLabelerTests.cs
  24. 93
      com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs
  25. 2
      com.unity.perception/Tests/Runtime/GroundTruthTests/SegmentationGroundTruthTests.cs
  26. 10
      com.unity.perception/Tests/Runtime/Unity.Perception.Runtime.Tests.asmdef
  27. 21
      TestProjects/PerceptionHDRP/Assets/SemanticSegmentationLabelingConfiguration.asset
  28. 8
      TestProjects/PerceptionHDRP/Assets/SemanticSegmentationLabelingConfiguration.asset.meta
  29. 541
      TestProjects/PerceptionHDRP/Packages/packages-lock.json
  30. 20
      com.unity.perception/Runtime/GroundTruth/Labeling/SemanticSegmentationLabelConfig.cs
  31. 3
      com.unity.perception/Runtime/GroundTruth/Labeling/SemanticSegmentationLabelConfig.cs.meta

139
TestProjects/PerceptionHDRP/Assets/Scenes/SampleScene.unity


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &4662619
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4662620}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4662620
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4662619}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.7286716, y: -2.380882, z: 5.498973}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Children:
- {fileID: 963194228}
- {fileID: 705507995}
- {fileID: 1640252283}
- {fileID: 464025709}
- {fileID: 411238281}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &411238276
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 411238277}
- component: {fileID: 411238282}
m_Layer: 0
m_Name: Cube (2)
m_Name: Crate
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Script: {fileID: 11500000, guid: 8b33f0bc2b78db642a758f07826d0dd0, type: 3}
m_Name:
m_EditorClassIdentifier:
classes:
labels:
- Crate
--- !u!65 &411238278
BoxCollider:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411238276}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.3786716, y: 2.380882, z: -4.288973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 155.99806, y: 83.926025, z: -149.97618}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 4
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &411238282
MonoBehaviour:

- component: {fileID: 464025705}
- component: {fileID: 464025710}
m_Layer: 0
m_Name: Cube (1)
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Script: {fileID: 11500000, guid: 8b33f0bc2b78db642a758f07826d0dd0, type: 3}
m_Name:
m_EditorClassIdentifier:
classes:
labels:
- Cube
--- !u!65 &464025706
BoxCollider:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 464025704}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 2.6386716, y: 2.380882, z: -3.9089727}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 92.92311, y: 83.926025, z: -136.20119}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 3
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &464025710
MonoBehaviour:

m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 6.25e-43, y: 1.0156355e+12, z: 6.25e-43, w: 2.8676e-41}
m_BoundingSphereOverride: {x: 6.3e-43, y: 108.39679, z: 6.3e-43, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 2.7286716, y: 5.3808823, z: -5.498973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 96.1856, y: 192.67596, z: -193.83864}
m_LocalScale: {x: 36.249973, y: 36.249977, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 1
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &705507996
MonoBehaviour:

m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 9
m_Version: 10
m_ObsoleteShadowResolutionTier: 1
m_ObsoleteUseShadowQualitySettings: 0
m_ObsoleteCustomShadowResolution: 512

m_FilterSizeTraced: 16
m_SunLightConeAngle: 0.5
m_LightShadowRadius: 0.5
m_SemiTransparentShadow: 0
m_ColorShadow: 1
m_EvsmExponent: 15
m_EvsmLightLeakBias: 0
m_EvsmVarianceBias: 0.00001

useVolumetric: 1
featuresFoldout: 1
showAdditionalSettings: 0
m_AreaLightEmissiveMeshShadowCastingMode: 0
m_AreaLightEmissiveMeshMotionVectorGenerationMode: 0
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: -0.17179534, y: 0.30667058, z: -0.056378223, w: -0.93448436}
m_LocalPosition: {x: 5.5378666, y: 3.5565922, z: -7.528791}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 198.01884, y: 126.545494, z: -267.4195}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 0
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &963194229
MonoBehaviour:

description: The main camera
period: 0.0166
startTime: 0
produceSegmentationImages: 1
produceObjectCountAnnotations: 1
LabelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
type: 2}
captureRgbImages: 1
m_Labelers:
- id: 0
- id: 1
- id: 2
- id: 3
references:
version: 1
00000000:
type: {class: BoundingBox2DLabeler, ns: UnityEngine.Perception.GroundTruth,
asm: Unity.Perception.Runtime}
data:
enabled: 1
foldout: 0
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
labelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
type: 2}
00000001:
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,
asm: Unity.Perception.Runtime}
data:
enabled: 1
foldout: 0
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
00000002:
type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
data:
enabled: 1
foldout: 0
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
m_LabelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
type: 2}
00000003:
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,
asm: Unity.Perception.Runtime}
data:
enabled: 1
foldout: 0
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
labelingConfiguration: {fileID: 11400000, guid: be3971a848968144e8d07d9136a5bf49,
type: 2}
--- !u!1 &1640252278
GameObject:
m_ObjectHideFlags: 0

- component: {fileID: 1640252279}
- component: {fileID: 1640252284}
m_Layer: 0
m_Name: Cube
m_Name: Box
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Script: {fileID: 11500000, guid: 8b33f0bc2b78db642a758f07826d0dd0, type: 3}
m_Name:
m_EditorClassIdentifier:
classes:
labels:
- Box
--- !u!65 &1640252280
BoxCollider:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1640252278}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 2.7286716, y: 2.380882, z: -5.498973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 96.1856, y: 83.926025, z: -193.83864}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1640252284

1
TestProjects/PerceptionHDRP/Packages/manifest.json


"com.unity.testtools.codecoverage": "0.2.2-preview",
"com.unity.textmeshpro": "2.0.1",
"com.unity.ugui": "1.0.0",
"nuget.moq": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",

2
TestProjects/PerceptionHDRP/ProjectSettings/EditorSettings.asset


inProgressEnabled: 1
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_AsyncShaderCompilation: 0
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_ShowLightmapResolutionOverlay: 1

4
TestProjects/PerceptionHDRP/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2019.3.13f1
m_EditorVersionWithRevision: 2019.3.13f1 (d4ddf0d95db9)
m_EditorVersion: 2019.4.1f1
m_EditorVersionWithRevision: 2019.4.1f1 (e6c045e14e4e)

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


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &4662619
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4662620}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4662620
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4662619}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.7286716, y: -2.380882, z: 5.498973}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Children:
- {fileID: 963194228}
- {fileID: 705507995}
- {fileID: 1640252283}
- {fileID: 464025709}
- {fileID: 411238281}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &411238276
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 411238276}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.3786716, y: 2.380882, z: -4.288973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 155.99806, y: 83.926025, z: -149.97618}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 4
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &411238282
MonoBehaviour:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 464025704}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 2.6386716, y: 2.380882, z: -3.9089727}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 92.92311, y: 83.926025, z: -136.20119}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 3
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &464025710
MonoBehaviour:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 705507993}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 2.7286716, y: 5.3808823, z: -5.498973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 96.1856, y: 192.67596, z: -193.83864}
m_LocalScale: {x: 36.249973, y: 36.249977, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 1
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &705507996
MonoBehaviour:

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_LocalRotation: {x: -0.17179534, y: 0.30667058, z: -0.056378223, w: -0.93448436}
m_LocalPosition: {x: 5.5378666, y: 3.5565922, z: -7.528791}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 198.01884, y: 126.545494, z: -267.4195}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_RootOrder: 0
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &963194229
Camera:

period: 0.0166
startTime: 0
captureRgbImages: 1
labelers:
m_Labelers:
- id: 0
- id: 1
- id: 2

00000000:
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,
asm: Unity.Perception.Runtime}
type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
labelingConfiguration: {fileID: 11400000, guid: e74234fe725079e4aa7ecd74797ceb79,
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
m_LabelingConfiguration: {fileID: 11400000, guid: e74234fe725079e4aa7ecd74797ceb79,
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,
type: {class: BoundingBox2DLabeler, ns: UnityEngine.Perception.GroundTruth,
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
labelingConfiguration: {fileID: 11400000, guid: e74234fe725079e4aa7ecd74797ceb79,
type: 2}
type: {class: BoundingBox2DLabeler, ns: UnityEngine.Perception.GroundTruth,
type: {class: RenderedObjectInfoLabeler, ns: UnityEngine.Perception.GroundTruth,
annotationId: F9F22E05-443F-4602-A422-EBE4EA9B55CB
objectInfoMetricId: 5BA92024-B3B7-41A7-9D3F-C03A6A8DDD01
type: {class: ObjectCountLabeler, ns: UnityEngine.Perception.GroundTruth, asm: Unity.Perception.Runtime}
type: {class: SemanticSegmentationLabeler, ns: UnityEngine.Perception.GroundTruth,
asm: Unity.Perception.Runtime}
objectCountMetricId: 51DA3C27-369D-4929-AEA6-D01614635CE2
m_LabelingConfiguration: {fileID: 11400000, guid: e74234fe725079e4aa7ecd74797ceb79,
type: 2}
annotationId: 12F94D8D-5425-4DEB-9B21-5E53AD957D66
labelConfig: {fileID: 11400000, guid: c140c5aa05dd09e4fadaa26de31b1f39, type: 2}
--- !u!114 &963194231
MonoBehaviour:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1640252278}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 2.7286716, y: 2.380882, z: -5.498973}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 96.1856, y: 83.926025, z: -193.83864}
m_LocalScale: {x: 36.249973, y: 36.249973, z: 36.249973}
m_Father: {fileID: 4662620}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1640252284

14
TestProjects/PerceptionURP/Assets/SemanticSegmentationLabelingConfiguration.asset


m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 0}
m_Script: {fileID: 11500000, guid: a9d0176327854820ab53adc46cbec7c1, type: 3}
m_EditorClassIdentifier: Unity.Perception.Runtime:UnityEngine.Perception.GroundTruth:SemanticSegmentationLabelConfig
m_EditorClassIdentifier:
pixelValue: 10000
- label: Crate
pixelValue: 20000
color: {r: 1, g: 0, b: 0, a: 0}
pixelValue: 30000
AutoAssignIds: 1
StartingLabelId: 1
color: {r: 0, g: 1, b: 0.14507627, a: 0}
- label: Crate
color: {r: 0, g: 0.21097231, b: 1, a: 0}

1
TestProjects/PerceptionURP/Packages/manifest.json


"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.12",
"com.unity.ugui": "1.0.0",
"nuget.moq": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",

16
TestProjects/PerceptionURP/Packages/packages-lock.json


"com.unity.modules.ui": "1.0.0"
}
},
"nuget.castle-core": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"url": "https://packages.unity.com"
},
"nuget.moq": {
"version": "1.0.0",
"depth": 0,
"source": "registry",
"dependencies": {
"nuget.castle-core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {

2
TestProjects/PerceptionURP/ProjectSettings/QualitySettings.asset


skinWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
antiAliasing: 2
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1

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


{
ReorderableList m_LabelersList;
SerializedProperty labelersProperty => this.serializedObject.FindProperty("m_Labelers");
m_LabelersList = new ReorderableList(this.serializedObject, this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)), true, false, true, true);
m_LabelersList = new ReorderableList(this.serializedObject, labelersProperty, true, false, true, true);
m_LabelersList.drawHeaderCallback = (rect) => {
EditorGUI.LabelField(rect, "Camera Labelers", EditorStyles.largeLabel);
};

float GetElementHeight(int index)
{
var serializedProperty = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers));
var serializedProperty = labelersProperty;
var element = serializedProperty.GetArrayElementAtIndex(index);
var editor = GetCameraLabelerDrawer(element, index);
return editor.GetElementHeight(element);

void DrawElement(Rect rect, int index, bool isactive, bool isfocused)
{
var element = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers)).GetArrayElementAtIndex(index);
var element = labelersProperty.GetArrayElementAtIndex(index);
var editor = GetCameraLabelerDrawer(element, index);
editor.OnGUI(rect, element);
}

void OnAdd(ReorderableList list)
{
Undo.RegisterCompleteObjectUndo(target, "Remove camera labeler");
var labelers = this.serializedObject.FindProperty(nameof(PerceptionCamera.labelers));
var labelers = labelersProperty;
var dropdownOptions = TypeCache.GetTypesDerivedFrom<CameraLabeler>();
var menu = new GenericMenu();

public override void OnInspectorGUI()
{
if (EditorSettings.asyncShaderCompilation)
{
EditorGUILayout.HelpBox("Asynchronous shader compilation is currently enabled.", MessageType.Warning);
}
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.description)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.period)));
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(PerceptionCamera.startTime)));

}
Dictionary<SerializedProperty, CameraLabelerDrawer> cameraLabelerDrawers = new Dictionary<SerializedProperty, CameraLabelerDrawer>();
CameraLabelerDrawer GetCameraLabelerDrawer(SerializedProperty element, int listIndex)

2
com.unity.perception/Editor/GroundTruth/SemanticSegmentationPassEditor.cs


{
AddProperty(customPass.FindPropertyRelative(nameof(SemanticSegmentationPass.targetCamera)));
AddProperty(customPass.FindPropertyRelative(nameof(SemanticSegmentationPass.targetTexture)));
AddProperty(customPass.FindPropertyRelative(nameof(SemanticSegmentationPass.labelingConfiguration)));
AddProperty(customPass.FindPropertyRelative(nameof(SemanticSegmentationPass.semanticSegmentationLabelConfig)));
base.Initialize(customPass);
}
}

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


static ProfilerMarker s_BoundingBoxCallback = new ProfilerMarker("OnBoundingBoxesReceived");
public LabelingConfiguration labelingConfiguration;
Dictionary<int, AsyncAnnotation> m_AsyncAnnotations = new Dictionary<int, AsyncAnnotation>();
Dictionary<int, AsyncAnnotation> m_AsyncAnnotations;
AnnotationDefinition m_BoundingBoxAnnotationDefinition;
BoundingBoxValue[] m_BoundingBoxValues;

public override void Setup()
{
if (labelingConfiguration == null)
throw new InvalidOperationException("LabelingConfiguration must be supplied");
m_AsyncAnnotations = new Dictionary<int, AsyncAnnotation>();
PerceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;
perceptionCamera.RenderedObjectInfosCalculated += OnRenderedObjectInfosCalculated;
m_AsyncAnnotations[Time.frameCount] = PerceptionCamera.SensorHandle.ReportAnnotationAsync(m_BoundingBoxAnnotationDefinition);
m_AsyncAnnotations[Time.frameCount] = perceptionCamera.SensorHandle.ReportAnnotationAsync(m_BoundingBoxAnnotationDefinition);
}
void OnRenderedObjectInfosCalculated(int frameCount, NativeArray<RenderedObjectInfo> renderedObjectInfos)

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


public bool enabled;
public bool foldout;
protected PerceptionCamera PerceptionCamera { get; private set; }
internal bool isInitialized { get; private set; }
protected PerceptionCamera perceptionCamera { get; private set; }
public abstract void Setup();
public virtual void Setup() { }
public virtual void OnSimulationEnding() {}
public virtual void Cleanup() {}
PerceptionCamera = perceptionCamera;
SensorHandle = perceptionCamera.SensorHandle;
Setup();
try
{
this.perceptionCamera = perceptionCamera;
SensorHandle = perceptionCamera.SensorHandle;
Setup();
isInitialized = true;
}
catch (Exception)
{
this.enabled = false;
throw;
}
}
}
}

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


ClassCountValue[] m_ClassCountValues;
Dictionary<int, AsyncMetric> m_ObjectCountAsyncMetrics = new Dictionary<int, AsyncMetric>();
Dictionary<int, AsyncMetric> m_ObjectCountAsyncMetrics;
MetricDefinition m_ObjectCountMetricDefinition;
public ObjectCountLabeler()

if (labelingConfiguration == null)
throw new InvalidOperationException("LabelingConfiguration must be supplied");
PerceptionCamera.RenderedObjectInfosCalculated += (frameCount, objectInfo) =>
m_ObjectCountAsyncMetrics = new Dictionary<int, AsyncMetric>();
perceptionCamera.RenderedObjectInfosCalculated += (frameCount, objectInfo) =>
{
NativeArray<uint> objectCounts = ComputeObjectCounts(objectInfo);
ObjectCountsComputed?.Invoke(frameCount, objectCounts, labelingConfiguration.LabelEntries);

"Counts of objects for each label in the sensor's view", id: new Guid(objectCountMetricId));
}
m_ObjectCountAsyncMetrics[Time.frameCount] = PerceptionCamera.SensorHandle.ReportMetricAsync(m_ObjectCountMetricDefinition);
m_ObjectCountAsyncMetrics[Time.frameCount] = perceptionCamera.SensorHandle.ReportMetricAsync(m_ObjectCountMetricDefinition);
}
NativeArray<uint> ComputeObjectCounts(NativeArray<RenderedObjectInfo> objectInfo)

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


// ReSharper restore InconsistentNaming
RenderedObjectInfoValue[] m_VisiblePixelsValues;
Dictionary<int, AsyncMetric> m_ObjectInfoAsyncMetrics = new Dictionary<int, AsyncMetric>();
Dictionary<int, AsyncMetric> m_ObjectInfoAsyncMetrics;
MetricDefinition m_RenderedObjectInfoMetricDefinition;
public RenderedObjectInfoLabeler()

return;
}
PerceptionCamera.RenderedObjectInfosCalculated += (frameCount, objectInfo) =>
m_ObjectInfoAsyncMetrics = new Dictionary<int, AsyncMetric>();
perceptionCamera.RenderedObjectInfosCalculated += (frameCount, objectInfo) =>
{
ProduceRenderedObjectInfoMetric(objectInfo, frameCount);
};

id: new Guid(objectInfoMetricId));
}
m_ObjectInfoAsyncMetrics[Time.frameCount] = PerceptionCamera.SensorHandle.ReportMetricAsync(m_RenderedObjectInfoMetricDefinition);
m_ObjectInfoAsyncMetrics[Time.frameCount] = perceptionCamera.SensorHandle.ReportMetricAsync(m_RenderedObjectInfoMetricDefinition);
}
void ProduceRenderedObjectInfoMetric(NativeArray<RenderedObjectInfo> renderedObjectInfos, int frameCount)

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


SemanticSegmentationPass m_SemanticSegmentationPass;
#endif
Dictionary<int, AsyncAnnotation> m_AsyncAnnotations = new Dictionary<int, AsyncAnnotation>();
Dictionary<int, AsyncAnnotation> m_AsyncAnnotations;
public SemanticSegmentationLabeler()
{

public override void Setup()
{
var myCamera = PerceptionCamera.GetComponent<Camera>();
var myCamera = perceptionCamera.GetComponent<Camera>();
var width = myCamera.pixelWidth;
var height = myCamera.pixelHeight;

this.enabled = false;
}
m_AsyncAnnotations = new Dictionary<int, AsyncAnnotation>();
var customPassVolume = this.GetComponent<CustomPassVolume>() ?? gameObject.AddComponent<CustomPassVolume>();
var gameObject = perceptionCamera.gameObject;
var customPassVolume = gameObject.GetComponent<CustomPassVolume>() ?? gameObject.AddComponent<CustomPassVolume>();
m_SemanticSegmentationPass = new SemanticSegmentationPass(myCamera, semanticSegmentationTexture, labelingConfiguration)
m_SemanticSegmentationPass = new SemanticSegmentationPass(myCamera, semanticSegmentationTexture, labelConfig)
{
name = "Labeling Pass"
};

PerceptionCamera.AddScriptableRenderPass(new SemanticSegmentationUrpPass(myCamera, semanticSegmentationTexture, labelConfig));
perceptionCamera.AddScriptableRenderPass(new SemanticSegmentationUrpPass(myCamera, semanticSegmentationTexture, labelConfig));
#endif
var specs = labelConfig.LabelEntries.Select((l) => new SemanticSegmentationSpec()

m_SemanticSegmentationTextureReader = new RenderTextureReader<Color32>(semanticSegmentationTexture, myCamera,
(frameCount, data, tex) => OnSemanticSegmentationImageRead(frameCount, data));
SimulationManager.SimulationEnding += OnSimulationEnding;
SimulationManager.SimulationEnding += Cleanup;
}
void OnSemanticSegmentationImageRead(int frameCount, NativeArray<Color32> data)

public override void OnBeginRendering()
{
m_AsyncAnnotations[Time.frameCount] = PerceptionCamera.SensorHandle.ReportAnnotationAsync(m_SemanticSegmentationAnnotationDefinition);
m_AsyncAnnotations[Time.frameCount] = perceptionCamera.SensorHandle.ReportAnnotationAsync(m_SemanticSegmentationAnnotationDefinition);
public override void OnSimulationEnding()
public override void Cleanup()
{
m_SemanticSegmentationTextureReader?.WaitForAllImages();
m_SemanticSegmentationTextureReader?.Dispose();

void OnDisable()
{
SimulationManager.SimulationEnding -= OnSimulationEnding;
SimulationManager.SimulationEnding -= Cleanup;
m_SemanticSegmentationTextureReader?.Dispose();
m_SemanticSegmentationTextureReader = null;

7
com.unity.perception/Runtime/GroundTruth/Labeling/LabelingConfiguration.cs


[CreateAssetMenu(fileName = "LabelingConfiguration", menuName = "Perception/Labeling Configuration", order = 1)]
public class LabelingConfiguration : ScriptableObject
{
[FormerlySerializedAs("LabelingConfigurations")]
[FormerlySerializedAs("LabelEntries")]
[SerializeField]

m_LabelEntryMatchCache = new LabelEntryMatchCache(this);
return m_LabelEntryMatchCache.TryGetLabelEntryFromInstanceId(instanceId, out labelEntry, out index);
}
void OnDestroy()
{
m_LabelEntryMatchCache.Dispose();
m_LabelEntryMatchCache = null;
}
[SuppressMessage("ReSharper", "InconsistentNaming")]

23
com.unity.perception/Runtime/GroundTruth/Labeling/LabelingConfiguration2.cs


{
}
[Serializable]
public struct SemanticSegmentationLabelEntry : ILabelEntry
{
string ILabelEntry.label => this.label;
public string label;
public Color color;
}
/// <summary>
/// A definition for how a <see cref="Labeling"/> should be resolved to a single label and id for ground truth generation.
/// </summary>
[CreateAssetMenu(fileName = "SemanticSegmentationLabelingConfiguration", menuName = "Perception/Semantic Segmentation Label Config", order = 1)]
public class SemanticSegmentationLabelConfig : LabelingConfiguration2<SemanticSegmentationLabelEntry>
{
/// <summary>
/// Whether the inspector will auto-assign ids based on the id of the first element.
/// </summary>
public bool AutoAssignIds = true;
/// <summary>
/// Whether the inspector will start label ids at zero or one when <see cref="AutoAssignIds"/> is enabled.
/// </summary>
public StartingLabelId StartingLabelId = StartingLabelId.One;
}
/// <summary>
/// A definition for how a <see cref="Labeling"/> should be resolved to a single label and id for ground truth generation.
/// </summary>

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


/// Event invoked after the camera finishes rendering during a frame.
/// </summary>
public List<CameraLabeler> labelers = new List<CameraLabeler>();
List<CameraLabeler> m_Labelers = new List<CameraLabeler>();
Dictionary<string, object> m_PersistentSensorData = new Dictionary<string, object>();
#if URP_PRESENT

SetupInstanceSegmentation();
foreach (var labeler in labelers)
{
labeler.Init(this);
}
RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering;
SimulationManager.SimulationEnding += OnSimulationEnding;
}

var cam = GetComponent<Camera>();
cam.enabled = SensorHandle.ShouldCaptureThisFrame;
foreach (var labeler in labelers)
foreach (var labeler in m_Labelers)
{
if (!labeler.enabled)
continue;
if (!labeler.isInitialized)
labeler.Init(this);
}
}
void OnValidate()
{
if (m_Labelers == null)
m_Labelers = new List<CameraLabeler>();
}
void CaptureRgbData(Camera cam)

void OnSimulationEnding()
{
foreach (var labeler in labelers)
labeler.OnSimulationEnding();
foreach (var labeler in m_Labelers)
{
if (labeler.isInitialized)
labeler.Cleanup();
}
}
void OnBeginCameraRendering(ScriptableRenderContext _, Camera cam)

#endif
CaptureRgbData(cam);
foreach (var labeler in labelers)
foreach (var labeler in m_Labelers)
{
if (!labeler.enabled)
continue;
if (!labeler.isInitialized)
labeler.Init(this);
}
}
void OnDisable()

SensorHandle = default;
CleanUpInstanceSegmentation();
}
public IReadOnlyList<CameraLabeler> labelers => m_Labelers;
public void AddLabeler(CameraLabeler cameraLabeler) => m_Labelers.Add(cameraLabeler);
public bool RemoveLabeler(CameraLabeler cameraLabeler)
{
if (m_Labelers.Remove(cameraLabeler))
{
if (cameraLabeler.isInitialized)
cameraLabeler.Cleanup();
return true;
}
return false;
}
}
}

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


var customPassVolume = this.GetComponent<CustomPassVolume>() ?? gameObject.AddComponent<CustomPassVolume>();
customPassVolume.injectionPoint = CustomPassInjectionPoint.BeforeRendering;
customPassVolume.isGlobal = true;
m_SegmentationPass = new InstanceSegmentationPass()
m_InstanceSegmentationPass = new InstanceSegmentationPass()
targetCamera = myCamera,
targetTexture = m_SegmentationTexture
targetCamera = GetComponent<Camera>(),
targetTexture = m_InstanceSegmentationTexture
m_SegmentationPass.EnsureInit();
customPassVolume.customPasses.Add(m_SegmentationPass);
m_InstanceSegmentationPass.EnsureInit();
customPassVolume.customPasses.Add(m_InstanceSegmentationPass);
#endif
#if URP_PRESENT
AddScriptableRenderPass(new InstanceSegmentationUrpPass(camera, m_InstanceSegmentationTexture));

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


public class SemanticSegmentationPass : CustomPass
{
public RenderTexture targetTexture;
public LabelingConfiguration labelingConfiguration;
public SemanticSegmentationLabelConfig semanticSegmentationLabelConfig;
public SemanticSegmentationPass(Camera targetCamera, RenderTexture targetTexture, LabelingConfiguration labelingConfiguration)
public SemanticSegmentationPass(Camera targetCamera, RenderTexture targetTexture, SemanticSegmentationLabelConfig semanticSegmentationLabelConfig)
this.labelingConfiguration = labelingConfiguration;
this.semanticSegmentationLabelConfig = semanticSegmentationLabelConfig;
this.targetCamera = targetCamera;
EnsureInit();
}

if (m_SemanticSegmentationCrossPipelinePass == null)
{
m_SemanticSegmentationCrossPipelinePass = new SemanticSegmentationCrossPipelinePass(targetCamera, labelingConfiguration);
m_SemanticSegmentationCrossPipelinePass = new SemanticSegmentationCrossPipelinePass(targetCamera, semanticSegmentationLabelConfig);
m_SemanticSegmentationCrossPipelinePass.EnsureActivated();
}
}

4
com.unity.perception/Tests/Editor/PerceptionCameraEditorTests.cs


var perceptionCamera = cameraObject.AddComponent<PerceptionCamera>();
perceptionCamera.captureRgbImages = true;
perceptionCamera.labelers.Add(new BoundingBox2DLabeler(labelingConfiguration));
perceptionCamera.labelers.Add(new RenderedObjectInfoLabeler(labelingConfiguration));
perceptionCamera.AddLabeler(new BoundingBox2DLabeler(labelingConfiguration));
perceptionCamera.AddLabeler(new RenderedObjectInfoLabeler(labelingConfiguration));
cameraObject.SetActive(true);
}

2
com.unity.perception/Tests/Runtime/GroundTruthTests/ObjectCountLabelerTests.cs


perceptionCamera.captureRgbImages = false;
var classCountLabeler = new ObjectCountLabeler(labelingConfiguration);
classCountLabeler.ObjectCountsComputed += onClassCountsReceived;
perceptionCamera.labelers.Add(classCountLabeler);
perceptionCamera.AddLabeler(classCountLabeler);
cameraObject.SetActive(true);
return cameraObject;

93
com.unity.perception/Tests/Runtime/GroundTruthTests/PerceptionCameraIntegrationTests.cs


using UnityEngine;
using UnityEngine.Perception.GroundTruth;
using UnityEngine.TestTools;
using Object = UnityEngine.Object;
#if MOQ_PRESENT
using Moq;
#endif
namespace GroundTruthTests
{

var labelingConfiguration = CreateLabelingConfiguration();
SetupCamera(pc =>
{
pc.labelers.Add(new BoundingBox2DLabeler(labelingConfiguration));
pc.AddLabeler(new BoundingBox2DLabeler(labelingConfiguration));
});
var plane = TestHelper.CreateLabeledPlane();

{
SetupCamera(pc =>
{
pc.labelers.Add(new SemanticSegmentationLabeler(CreateSemanticSegmentationLabelConfig()));
pc.AddLabeler(new SemanticSegmentationLabeler(CreateSemanticSegmentationLabelConfig()));
});
string expectedImageFilename = $"segmentation_{Time.frameCount}.png";

StringAssert.Contains(imagePath, capturesJson);
}
#if MOQ_PRESENT
[UnityTest]
public IEnumerator AddLabelerAfterStart_ShouldInitialize()
{
var camera = SetupCamera(null);
var mockLabeler = new Mock<CameraLabeler>();
yield return null;
camera.GetComponent<PerceptionCamera>().AddLabeler(mockLabeler.Object);
yield return null;
mockLabeler.Verify(l => l.Setup(), Times.Once());
}
[UnityTest]
public IEnumerator Labeler_ShouldSetupAndUpdateAndOnBeginRenderingInFirstFrame()
{
var mockLabeler = new Mock<CameraLabeler>();
SetupCamera(p => p.AddLabeler(mockLabeler.Object));
yield return null;
mockLabeler.Verify(l => l.Setup());
mockLabeler.Verify(l => l.OnUpdate());
mockLabeler.Verify(l => l.OnBeginRendering());
}
[UnityTest]
public IEnumerator AddAndRemoveLabelerInSameFrame_ShouldDoNothing()
{
var mockLabeler = new Mock<CameraLabeler>();
var cameraObject = SetupCamera(null);
var perceptionCamera = cameraObject.GetComponent<PerceptionCamera>();
perceptionCamera.AddLabeler(mockLabeler.Object);
perceptionCamera.RemoveLabeler(mockLabeler.Object);
yield return null;
mockLabeler.Verify(l => l.Setup(), Times.Never());
mockLabeler.Verify(l => l.OnUpdate(), Times.Never());
mockLabeler.Verify(l => l.OnBeginRendering(), Times.Never());
mockLabeler.Verify(l => l.Cleanup(), Times.Never());
}
[UnityTest]
public IEnumerator RemoveLabeler_ShouldCallCleanup()
{
var mockLabeler = new Mock<CameraLabeler>();
var cameraObject = SetupCamera(null);
var perceptionCamera = cameraObject.GetComponent<PerceptionCamera>();
perceptionCamera.AddLabeler(mockLabeler.Object);
yield return null;
Assert.IsTrue(perceptionCamera.RemoveLabeler(mockLabeler.Object));
mockLabeler.Verify(l => l.Cleanup(), Times.Once());
}
[UnityTest]
public IEnumerator RemoveLabeler_OnLabelerNotAdded_ShouldNotCallCleanup()
{
var mockLabeler = new Mock<CameraLabeler>();
var cameraObject = SetupCamera(null);
var perceptionCamera = cameraObject.GetComponent<PerceptionCamera>();
yield return null;
Assert.IsFalse(perceptionCamera.RemoveLabeler(mockLabeler.Object));
mockLabeler.Verify(l => l.Cleanup(), Times.Never());
}
[UnityTest]
public IEnumerator DestroyPerceptionCameraObject_ShouldCallCleanup()
{
var mockLabeler = new Mock<CameraLabeler>();
var cameraObject = SetupCamera(null);
var perceptionCamera = cameraObject.GetComponent<PerceptionCamera>();
perceptionCamera.AddLabeler(mockLabeler.Object);
yield return null;
Object.DestroyImmediate(cameraObject);
mockLabeler.Verify(l => l.Cleanup(), Times.Once());
}
[UnityTest]
public IEnumerator SetupThrows_ShouldDisable()
{
var mockLabeler = new Mock<CameraLabeler>();
mockLabeler.Setup(l => l.Setup()).Throws<InvalidOperationException>();
var labeler = mockLabeler.Object;
SetupCamera(p => p.AddLabeler(labeler));
yield return null;
mockLabeler.Verify(l => l.Setup(), Times.Once());
mockLabeler.Verify(l => l.OnUpdate(), Times.Never());
mockLabeler.Verify(l => l.OnBeginRendering(), Times.Never());
Assert.IsFalse(labeler.enabled);
}
#endif
static LabelingConfiguration CreateLabelingConfiguration()
{
var label = "label";

var perceptionCamera = cameraObject.AddComponent<PerceptionCamera>();
perceptionCamera.captureRgbImages = false;
initPerceptionCamera(perceptionCamera);
initPerceptionCamera?.Invoke(perceptionCamera);
cameraObject.SetActive(true);
AddTestObjectForCleanup(cameraObject);

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


};
var semanticSegmentationLabeler = new SemanticSegmentationLabeler(labelConfig);
semanticSegmentationLabeler.SemanticSegmentationImageReadback += onSegmentationImageReceived;
perceptionCamera.labelers.Add(semanticSegmentationLabeler);
perceptionCamera.AddLabeler(semanticSegmentationLabeler);
cameraObject.SetActive(true);
return cameraObject;
}

10
com.unity.perception/Tests/Runtime/Unity.Perception.Runtime.Tests.asmdef


"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"Newtonsoft.Json.dll"
"Newtonsoft.Json.dll",
"Moq.dll"
],
"autoReferenced": false,
"defineConstraints": [

"name": "com.unity.render-pipelines.high-definition",
"expression": "",
"define": "HDRP_PRESENT"
},
{
"name": "nuget.moq",
"expression": "",
"define": "MOQ_PRESENT"
}
}

21
TestProjects/PerceptionHDRP/Assets/SemanticSegmentationLabelingConfiguration.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
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: a9d0176327854820ab53adc46cbec7c1, type: 3}
m_Name: SemanticSegmentationLabelingConfiguration
m_EditorClassIdentifier:
LabelEntries:
- label: Box
color: {r: 1, g: 0, b: 0, a: 1}
- label: Cube
color: {r: 0, g: 0.024693727, b: 1, a: 1}
- label: Crate
color: {r: 0, g: 1, b: 0.16973758, a: 1}

8
TestProjects/PerceptionHDRP/Assets/SemanticSegmentationLabelingConfiguration.asset.meta


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

541
TestProjects/PerceptionHDRP/Packages/packages-lock.json


{
"dependencies": {
"com.unity.burst": {
"version": "1.3.0-preview.5",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.1.0"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.2.16",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.collections": {
"version": "0.7.0-preview.2",
"depth": 3,
"source": "registry",
"dependencies": {
"com.unity.test-framework.performance": "1.3.3-preview",
"com.unity.burst": "1.3.0-preview.5"
},
"url": "https://packages.unity.com"
},
"com.unity.entities": {
"version": "0.8.0-preview.8",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.3.0-preview.5",
"com.unity.properties": "0.10.4-preview",
"com.unity.mathematics": "1.1.0",
"com.unity.serialization": "0.6.4-preview",
"com.unity.test-framework.performance": "1.3.3-preview",
"nuget.mono-cecil": "0.1.5-preview",
"com.unity.jobs": "0.2.7-preview.11",
"com.unity.scriptablebuildpipeline": "1.6.4-preview",
"com.unity.platforms": "0.2.1-preview.4"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.0",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "1.1.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.1",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.jobs": {
"version": "0.2.7-preview.11",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.collections": "0.7.0-preview.2",
"com.unity.mathematics": "1.1.0"
},
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.1.0",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "1.1.2",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.package-validation-suite": {
"version": "0.9.1-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"nuget.mono-cecil": "0.1.6-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.perception": {
"version": "file:../../../com.unity.perception",
"depth": 0,
"source": "local",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.render-pipelines.core": "7.1.6",
"com.unity.entities": "0.8.0-preview.8",
"com.unity.simulation.capture": "0.0.10-preview.6",
"com.unity.simulation.core": "0.0.10-preview.8"
}
},
"com.unity.platforms": {
"version": "0.2.1-preview.4",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.nuget.newtonsoft-json": "1.1.2",
"com.unity.properties": "0.10.4-preview",
"com.unity.searcher": "4.0.9",
"com.unity.serialization": "0.6.4-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.properties": {
"version": "0.10.4-preview",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.collections": "0.1.1-preview",
"com.unity.test-framework.performance": "1.0.9-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.core": {
"version": "7.3.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.high-definition": {
"version": "7.3.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.render-pipelines.core": "7.3.1",
"com.unity.shadergraph": "7.3.1",
"com.unity.visualeffectgraph": "7.3.1",
"com.unity.render-pipelines.high-definition-config": "7.3.1"
},
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.high-definition-config": {
"version": "7.3.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.render-pipelines.core": "7.3.1"
},
"url": "https://packages.unity.com"
},
"com.unity.scriptablebuildpipeline": {
"version": "1.6.4-preview",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.searcher": {
"version": "4.0.9",
"depth": 3,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.serialization": {
"version": "0.6.4-preview",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.1.2",
"com.unity.collections": "0.1.1-preview",
"com.unity.jobs": "0.1.1-preview",
"com.unity.mathematics": "1.1.0",
"com.unity.properties": "0.10.4-preview",
"com.unity.test-framework.performance": "1.0.9-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.shadergraph": {
"version": "7.3.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.render-pipelines.core": "7.3.1"
},
"url": "https://packages.unity.com"
},
"com.unity.simulation.capture": {
"version": "0.0.10-preview.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.simulation.core": "0.0.10-preview.8"
},
"url": "https://packages.unity.com"
},
"com.unity.simulation.core": {
"version": "0.0.10-preview.8",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.14",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework.performance": {
"version": "1.3.3-preview",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.testtools.codecoverage": {
"version": "0.2.2-preview",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.0.16"
},
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "2.0.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0"
}
},
"com.unity.visualeffectgraph": {
"version": "7.3.1",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.shadergraph": "7.3.1"
},
"url": "https://packages.unity.com"
},
"nuget.castle-core": {
"version": "1.0.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"nuget.mono-cecil": {
"version": "0.1.6-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"nuget.moq": {
"version": "1.0.0",
"depth": 0,
"source": "registry",
"dependencies": {
"nuget.castle-core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}

20
com.unity.perception/Runtime/GroundTruth/Labeling/SemanticSegmentationLabelConfig.cs


using System;
using UnityEngine.Serialization;
namespace UnityEngine.Perception.GroundTruth {
/// <summary>
/// A definition for how a <see cref="Labeling"/> should be resolved to a single label and id for ground truth generation.
/// </summary>
[CreateAssetMenu(fileName = "SemanticSegmentationLabelingConfiguration", menuName = "Perception/Semantic Segmentation Label Config", order = 1)]
public class SemanticSegmentationLabelConfig : LabelingConfiguration2<SemanticSegmentationLabelEntry>
{
}
[Serializable]
public struct SemanticSegmentationLabelEntry : ILabelEntry
{
string ILabelEntry.label => this.label;
public string label;
public Color color;
}
}

3
com.unity.perception/Runtime/GroundTruth/Labeling/SemanticSegmentationLabelConfig.cs.meta


fileFormatVersion: 2
guid: a9d0176327854820ab53adc46cbec7c1
timeCreated: 1593444493
正在加载...
取消
保存