Class SemanticSegmentationLabeler
Labeler which generates a semantic segmentation image each frame. Each object is rendered to the semantic segmentation image using the color associated with it based on the given SemanticSegmentationLabelConfig. Semantic segmentation images are saved to the dataset in PNG format.
Only one SemanticSegmentationLabeler can render at once across all cameras.
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth
Assembly: solution.dll
Syntax
[Serializable]
public sealed class SemanticSegmentationLabeler : CameraLabeler
Constructors
Name | Description |
---|---|
SemanticSegmentationLabeler() | Creates a new SemanticSegmentationLabeler. Be sure to assign labelConfig before adding to a PerceptionCamera. |
SemanticSegmentationLabeler(SemanticSegmentationLabelConfig, RenderTexture) | Creates a new SemanticSegmentationLabeler with the given SemanticSegmentationLabelConfig. |
Fields
Name | Description |
---|---|
annotationId | The id to associate with semantic segmentation annotations in the dataset. |
labelConfig | The SemanticSegmentationLabelConfig which maps labels to pixel values. |
Properties
Name | Description |
---|---|
description | A human-readable description of the labeler |
supportsVisualization | Labelers should set this in their setup to define if they support realtime visualization of their data. |
targetTexture | The RenderTexture on which semantic segmentation images are drawn. Will be resized on startup to match the camera resolution. |
Methods
Name | Description |
---|---|
Cleanup() | Called when the Labeler is about to be destroyed or removed from the PerceptionCamera. Use this to clean up to state. |
OnBeginRendering() | Called just before the camera renders each frame the the labeler is enabled and ShouldCaptureThisFrame is true. |
OnVisualizeAdditionalUI() | In this pass, a labeler can add custom GUI controls to the scene. Important note, all labeler's additional GUIs need to use Unity's Immediate Mode GUI (IMGUI) https://docs.unity3d.com/Manual/GUIScriptingGuide.html system. This called is triggered from perceptionCamera.OnGUI call. This call happens immediately after the OnVisualize() so that the visualization components are drawn below the UI elements. |
OnVisualizerEnabledChanged(bool) | Called when the labeler's visualization capability is turned on or off. |
Setup() | Called just before the first call to OnUpdate() or OnBeginRendering(). Implement this to initialize state. |
Events
Name | Description |
---|---|
imageReadback | Event which is called each frame a semantic segmentation image is read back from the GPU. |