Class IdLabelConfig
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 IdLabelConfig : LabelConfig<IdLabelEntry>
Fields
autoAssignIds
Whether the inspector will auto-assign ids based on the id of the first element.
Declaration
public bool autoAssignIds
Field Value
Type | Description |
---|---|
Boolean |
startingLabelId
Whether the inspector will start label ids at zero or one when autoAssignIds is enabled.
Declaration
public StartingLabelId startingLabelId
Field Value
Type | Description |
---|---|
StartingLabelId |
Methods
CreateLabelEntryMatchCache(Allocator)
Creates a LabelEntryMatchCache from the currently registered labeled objects, which can be used to look up labeling information in future frames, even after the objects have been destroyed. Due to timing of labeled object registration, if this is called during or before LateUpdate, this cache may become invalid.
It is recommended to only use this method in rendering, as the cache is guaranteed to be in its final state for ground truth generation.
Declaration
public LabelEntryMatchCache CreateLabelEntryMatchCache(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocator for creating the cache. |
Returns
Type | Description |
---|---|
LabelEntryMatchCache | The created cache. |
GetAnnotationSpecification()
Returns the label entries as structures suited for writing out to JSON datasets.
Declaration
public IdLabelConfig.LabelEntrySpec[] GetAnnotationSpecification()
Returns
Type | Description |
---|---|
IdLabelConfig.LabelEntrySpec[] |
OnInit()
Called when the labelEntries list is assigned using Init(IEnumerable<T>)
Declaration
protected override void OnInit()
Overrides
TryGetLabelEntryFromInstanceId(UInt32, out IdLabelEntry)
Attempts to find the label id for the given instance id.
Declaration
public bool TryGetLabelEntryFromInstanceId(uint instanceId, out IdLabelEntry labelEntry)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | instanceId | The instanceId of the object for which the labelId should be found |
IdLabelEntry | labelEntry | The LabelEntry associated with the object. default if not found |
Returns
Type | Description |
---|---|
Boolean | True if a labelId is found for the given instanceId. |
TryGetLabelEntryFromInstanceId(UInt32, out IdLabelEntry, out Int32)
Attempts to find the label id for the given instance id.
Declaration
public bool TryGetLabelEntryFromInstanceId(uint instanceId, out IdLabelEntry labelEntry, out int index)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | instanceId | The instanceId of the object for which the labelId should be found |
IdLabelEntry | labelEntry | The LabelEntry associated with the object. default if not found |
Int32 | index | The index of the found LabelEntry in labelEntries. -1 if not found |
Returns
Type | Description |
---|---|
Boolean | True if a labelId is found for the given instanceId. |