Class CameraLabeler | Perception | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class CameraLabeler

    Abstract class for defining custom annotation and metric generation to be run by PerceptionCamera. Instances of CameraLabeler on labelers will be invoked each frame the camera is set to capture data (see ShouldCaptureThisFrame).

    Inheritance
    Object
    CameraLabeler
    BoundingBox2DLabeler
    BoundingBox3DLabeler
    ObjectCountLabeler
    RenderedObjectInfoLabeler
    SemanticSegmentationLabeler
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.Perception.GroundTruth
    Syntax
    [Serializable]
    public abstract class CameraLabeler

    Fields

    enabled

    Whether the CameraLabeler should be set up and called each frame.

    Declaration
    public bool enabled
    Field Value
    Type Description
    Boolean

    Properties

    description

    A human-readable description of the labeler

    Declaration
    public abstract string description { get; protected set; }
    Property Value
    Type Description
    String

    hudPanel

    The heads up display (HUD) panel. Generally used to add stats to the display.

    Declaration
    public HUDPanel hudPanel { get; }
    Property Value
    Type Description
    HUDPanel

    perceptionCamera

    The PerceptionCamera that contains this labeler.

    Declaration
    protected PerceptionCamera perceptionCamera { get; }
    Property Value
    Type Description
    PerceptionCamera

    sensorHandle

    The SensorHandle for the PerceptionCamera that contains this labeler. Use this to report annotations and metrics.

    Declaration
    protected SensorHandle sensorHandle { get; }
    Property Value
    Type Description
    SensorHandle

    supportsVisualization

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

    Declaration
    protected abstract bool supportsVisualization { get; }
    Property Value
    Type Description
    Boolean

    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 virtual void Cleanup()

    OnBeginRendering()

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

    Declaration
    protected virtual void OnBeginRendering()

    OnUpdate()

    Called during the Update each frame the the labeler is enabled and ShouldCaptureThisFrame is true.

    Declaration
    protected virtual void OnUpdate()

    OnVisualize()

    Labeling pass to display labeler's visualization components, if applicable. Important note, all labeler's visualizations need to use Unity's Immediate Mode GUI (IMGUI) system. This called is triggered from call. This call happens immediately before OnVisualizeAdditionalUI() so that the visualization components are drawn below the UI elements.

    Declaration
    protected virtual void OnVisualize()

    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) system. This called is triggered from call. This call happens immediately after the OnVisualize() so that the visualization components are drawn below the UI elements.

    Declaration
    protected virtual void OnVisualizeAdditionalUI()

    OnVisualizerEnabledChanged(Boolean)

    Called when the labeler's visualization capability is turned on or off.

    Declaration
    protected virtual void OnVisualizerEnabledChanged(bool visualizerEnabled)
    Parameters
    Type Name Description
    Boolean visualizerEnabled

    The current enabled state of the visualizer

    Setup()

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

    Declaration
    protected virtual void Setup()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023