Class LabelEntryMatchCache
Cache of instance id -> label entry index for a LabelConfig. This is not well optimized and is the source of a known memory leak for apps that create new instances frequently.
Namespace: UnityEngine.Perception.GroundTruth
Syntax
public class LabelEntryMatchCache : object, IGroundTruthGenerator, IDisposable
Methods
Dispose()
Declaration
public void Dispose()
TryGetLabelEntryFromInstanceId(UInt32, out IdLabelEntry, out Int32)
Retrieves the label entry for the given instance id.
Declaration
public bool TryGetLabelEntryFromInstanceId(uint instanceId, out IdLabelEntry labelEntry, out int index)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | instanceId | The instance id to look up |
IdLabelEntry | labelEntry | The IdLabelEntry of the match if found. Otherwise returns .
|
Int32 | index | The index of the matched IdLabelEntry in the IdLabelConfig if found. Otherwise returns -1. |
Returns
Type | Description |
---|---|
Boolean | True if a the instance id was found in the cache. |
Explicit Interface Implementations
IGroundTruthGenerator.ClearMaterialProperties(MaterialPropertyBlock, Renderer, Labeling, UInt32)
Disables ground truth generation for a Labeling component or its associated
Declaration
void IGroundTruthGenerator.ClearMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId)
Parameters
Type | Name | Description |
---|---|---|
MaterialPropertyBlock | mpb | The |
Renderer | renderer | The |
Labeling | labeling | The LabelManager component for which ground-truth generation should stop. |
UInt32 | instanceId | The instanceId assigned to the given LabelManager instance. |
Implements
IGroundTruthGenerator.SetupMaterialProperties(MaterialPropertyBlock, Renderer, Labeling, UInt32)
Enables ground truth generation for a Labeling component or its associated
Declaration
void IGroundTruthGenerator.SetupMaterialProperties(MaterialPropertyBlock mpb, Renderer renderer, Labeling labeling, uint instanceId)
Parameters
Type | Name | Description |
---|---|---|
MaterialPropertyBlock | mpb | The |
Renderer | renderer | The |
Labeling | labeling | The LabelManager component that was registered, created, or enabled |
UInt32 | instanceId | The instanceId assigned to the given LabelManager instance. |