Class LabelConfig<T>
A definition for how a Labeling should be resolved to a single label and id for ground truth generation.
Inherited Members
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
labelEntriesFieldName
The name of the serialized field for label entries.
Declaration
public const string labelEntriesFieldName = "m_LabelEntries"
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
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 |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown once the LabelConfig has been used at runtime. The specific timing of this depends on the LabelConfig implementation. |
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 UnityEngine.Perception.GroundTruth.LabelConfig`1.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 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 UnityEngine.Perception.GroundTruth.LabelConfig`1.m_LabelEntries.
TryGetMatchingConfigurationEntry(Labeling, out T, out Int32)
Attempts to find the matching index in UnityEngine.Perception.GroundTruth.LabelConfig`1.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 if no match was found.
|
| Int32 | labelEntryIndex | When this method returns, contains the index of the matching ILabelEntry, or 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 UnityEngine.Perception.GroundTruth.LabelConfig`1.m_LabelEntries.