docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    CameraLabeler
    SemanticSegmentationLabeler
    Implements
    IOverlayPanelProvider
    Inherited Members
    CameraLabeler.enabled
    CameraLabeler.hudPanel
    CameraLabeler.overlayPanel
    CameraLabeler.visualizationEnabled
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.GroundTruth.Labelers
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [Serializable]
    [MovedFrom("UnityEngine.Perception.GroundTruth")]
    public sealed class SemanticSegmentationLabeler : CameraLabeler, IOverlayPanelProvider

    Constructors

    SemanticSegmentationLabeler()

    Creates a new SemanticSegmentationLabeler. Be sure to assign labelConfig before adding to a PerceptionCamera.

    Declaration
    public SemanticSegmentationLabeler()

    SemanticSegmentationLabeler(SemanticSegmentationLabelConfig)

    Creates a new SemanticSegmentationLabeler with the given SemanticSegmentationLabelConfig.

    Declaration
    public SemanticSegmentationLabeler(SemanticSegmentationLabelConfig labelConfig)
    Parameters
    Type Name Description
    SemanticSegmentationLabelConfig labelConfig

    The label config associating labels with colors.

    Fields

    annotationId

    The string id used to identify this labeler in the dataset.

    Declaration
    public string annotationId
    Field Value
    Type Description
    string

    labelConfig

    The SemanticSegmentationLabelConfig which maps labels to pixel values.

    Declaration
    public SemanticSegmentationLabelConfig labelConfig
    Field Value
    Type Description
    SemanticSegmentationLabelConfig

    Properties

    description

    A human-readable description of the labeler

    Declaration
    public override string description { get; }
    Property Value
    Type Description
    string
    Overrides
    CameraLabeler.description

    label

    Interface that should be defined by a class that wants to be able to provide a image to the overlay panel.

    Declaration
    public string label { get; }
    Property Value
    Type Description
    string

    labelerId

    The GUID id to associate with the data produced by this labeler.

    Declaration
    public override string labelerId { get; }
    Property Value
    Type Description
    string
    Overrides
    CameraLabeler.labelerId

    overlayImage

    Interface that should be defined by a class that wants to be able to provide a image to the overlay panel.

    Declaration
    public Texture overlayImage { get; }
    Property Value
    Type Description
    Texture

    supportsVisualization

    Labelers should set this in their setup to define if they support realtime visualization of their data.

    Declaration
    protected override bool supportsVisualization { get; }
    Property Value
    Type Description
    bool
    Overrides
    CameraLabeler.supportsVisualization

    Methods

    Cleanup()

    Called when the Labeler is about to be destroyed or removed from the PerceptionCamera. Use this to clean up to state.

    Declaration
    protected override void Cleanup()
    Overrides
    CameraLabeler.Cleanup()

    OnEndRendering(ScriptableRenderContext)

    Called just after the camera renders each frame the the labeler is enabled and ShouldCaptureThisFrame is true.

    Declaration
    protected override void OnEndRendering(ScriptableRenderContext ctx)
    Parameters
    Type Name Description
    ScriptableRenderContext ctx

    The current context from the Scriptable Render Pipeline.

    Overrides
    CameraLabeler.OnEndRendering(ScriptableRenderContext)

    Setup()

    Called just before the first call to OnUpdate() or OnBeginRendering(ScriptableRenderContext). Implement this to initialize state.

    Declaration
    protected override void Setup()
    Overrides
    CameraLabeler.Setup()

    Events

    imageReadback

    Event which is called each frame a semantic segmentation image is read back from the GPU. The first returned parameter is the Time.frameCount when the frame was captured, the second is the readback pixel data, and the final parameter is the source segmentation texture.

    Declaration
    public event Action<int, NativeArray<Color32>, RenderTexture> imageReadback
    Event Type
    Type Description
    Action<int, NativeArray<Color32>, RenderTexture>

    Implements

    IOverlayPanelProvider
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)