Class Metric
Abstract class that holds the common data found in all metrics. Concrete instances of this class will add data for their specific metric type.
Namespace: UnityEngine.Perception.GroundTruth.DataModel
Syntax
public abstract class Metric : DataModelElement, IMessageProducer
Constructors
Metric(MetricDefinition, String, String)
Creates a new metric.
Declaration
protected Metric(MetricDefinition definition, string sensorId = null, string annotationId = null)
Parameters
Type | Name | Description |
---|---|---|
MetricDefinition | definition | The metric definition |
String | sensorId | The sensor ID of the sensor associated with this metric, this value can be empty |
String | annotationId | The annotation ID of the annotation associated with this metric, this value can be empty |
Properties
annotationId
The annotation ID that this metric is associated with. If the value is none ("") then the metric is capture wide, and not associated with a specific annotation.
Declaration
public string annotationId { get; }
Property Value
Type | Description |
---|---|
String |
modelType
Declaration
public override string modelType { get; }
Property Value
Type | Description |
---|---|
String |
Overrides
sensorId
The sensor ID that this metric is associated with, this value can be null or empty if the metric is not associated with any particular sensor.
Declaration
public string sensorId { get; }
Property Value
Type | Description |
---|---|
String |
Methods
GetValues<T>()
Retrieves an array of the metric values.
Declaration
public abstract T[] GetValues<T>()
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
ToMessage(IMessageBuilder)
Convert contents int a message.
Declaration
public override void ToMessage(IMessageBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
IMessageBuilder | builder | The message builder that will convert the class's contents into a message |