Struct AnnotationHandle
A handle to an annotation. Can be used to report metrics on the annotation.
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth
Assembly: Unity.Perception.Runtime.dll
Syntax
public readonly struct AnnotationHandle : IDatasetHandle, IEquatable<AnnotationHandle>
Properties
Id
The ID of the annotation which will be used in the json metadata.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
string |
IsNil
Returns true if the annotation is nil (created using default instantiation).
Declaration
public bool IsNil { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Equals(object)
Compares AnnotationHandle handler with any other object
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | object |
Returns
Type | Description |
---|---|
bool | True is object is AnnotationHandle SensorHandlers are equal and Definitions are equal |
Overrides
Equals(AnnotationHandle)
Compares AnnotationHandle handler with another AnnotationHandle
Declaration
public bool Equals(AnnotationHandle other)
Parameters
Type | Name | Description |
---|---|---|
AnnotationHandle | other | AnnotationHandle |
Returns
Type | Description |
---|---|
bool | True is SensorHandlers are equal and Definitions are equal |
GetHashCode()
Ovverided GetHashCode based on Id
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Hash based on Id |
Overrides
IsValid()
Check if handler is valid
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
bool | True is definition is not null |
ReportMetric(MetricDefinition, Metric)
Synchronously report a metric for the current simulation frame.
Declaration
public void ReportMetric(MetricDefinition definition, Metric metric)
Parameters
Type | Name | Description |
---|---|---|
MetricDefinition | definition | The definition of the metric to report |
Metric | metric | The metric value |
ReportMetricAsync(MetricDefinition)
Report a metric whose values will be supplied in a later frame.
Declaration
public AsyncFuture<Metric> ReportMetricAsync(MetricDefinition metricDefinition)
Parameters
Type | Name | Description |
---|---|---|
MetricDefinition | metricDefinition | The type of the metric. |
Returns
Type | Description |
---|---|
AsyncFuture<Metric> | A handle to an AsyncMetric, which can be used to report values for this metric in future frames. |