docs.unity3d.com
    Show / Hide Table of Contents

    Class LabelConfig<T>

    A definition for how a Labeling should be resolved to a single label and id for ground truth generation.

    Inheritance
    Object
    LabelConfig<T>
    IdLabelConfig
    SemanticSegmentationLabelConfig
    Namespace: UnityEngine.Perception.GroundTruth
    Syntax
    public class LabelConfig<T> : ScriptableObject where T : ILabelEntry
    Type Parameters
    Name Description
    T

    The entry type. Must derive from ILabelEntry

    Fields

    DoesLabelMatchAnEntryName

    Name of the function that checks whether a given string matches any of the label entries in this label configuration, used for reflection purposes.

    Declaration
    public const string DoesLabelMatchAnEntryName = null
    Field Value
    Type Description
    String

    labelEntriesFieldName

    The name of the serialized field for label entries.

    Declaration
    public const string labelEntriesFieldName = null
    Field Value
    Type Description
    String

    m_LabelEntries

    List of LabelEntry items added to this label configuration

    Declaration
    protected List<T> m_LabelEntries
    Field Value
    Type Description
    List<T>

    publicLabelEntriesFieldName

    Name of the public accessor for the list of label entries, used for reflection purposes.

    Declaration
    public const string publicLabelEntriesFieldName = null
    Field Value
    Type Description
    String

    Properties

    labelEntries

    A sequence of ILabelEntry which defines the labels relevant for this configuration and their values.

    Declaration
    public IReadOnlyList<T> labelEntries { get; }
    Property Value
    Type Description
    IReadOnlyList<T>

    Methods

    DoesLabelMatchAnEntry(String)

    Does the given string match any of the label entries added to this label configuration.

    Declaration
    public bool DoesLabelMatchAnEntry(string label)
    Parameters
    Type Name Description
    String label
    Returns
    Type Description
    Boolean

    Init(IEnumerable<T>)

    Initialize the list of LabelEntries on this LabelingConfiguration. Should only be called immediately after instantiation.

    Declaration
    public void Init(IEnumerable<T> newLabelEntries)
    Parameters
    Type Name Description
    IEnumerable<T> newLabelEntries

    The LabelEntry values to associate with this LabelingConfiguration

    OnInit()

    Called when the labelEntries list is assigned using Init(IEnumerable<T>)

    Declaration
    protected virtual void OnInit()

    TryGetMatchingConfigurationEntry(Labeling, out T)

    Attempts to find the matching index in m_LabelEntries for the given Labeling.

    Declaration
    public bool TryGetMatchingConfigurationEntry(Labeling labeling, out T labelEntry)
    Parameters
    Type Name Description
    Labeling labeling

    The Labeling to match

    T labelEntry

    When this method returns, contains the matching ILabelEntry, or

    default
    if no match was found.
    Returns
    Type Description
    Boolean

    Returns true if a match was found. False if not.

    Remarks

    The matching index is the first class name in the given Labeling which matches an entry in m_LabelEntries.

    TryGetMatchingConfigurationEntry(Labeling, out T, out Int32)

    Attempts to find the matching index in m_LabelEntries for the given Labeling.

    Declaration
    public bool TryGetMatchingConfigurationEntry(Labeling labeling, out T labelEntry, out int labelEntryIndex)
    Parameters
    Type Name Description
    Labeling labeling

    The Labeling to match

    T labelEntry

    When this method returns, contains the matching ILabelEntry, or

    default
    if no match was found.
    Int32 labelEntryIndex

    When this method returns, contains the index of the matching ILabelEntry, or

    -1
    if no match was found.
    Returns
    Type Description
    Boolean

    Returns true if a match was found. False if not.

    Remarks

    The matching index is the first class name in the given Labeling which matches an entry in m_LabelEntries.

    Back to top
    Terms of use
    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