Struct Annotation | Perception | 0.5.0-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Struct Annotation

    A handle to an annotation. Can be used to report metrics on the annotation.

    Inherited Members
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.Perception.GroundTruth
    Syntax
    public struct Annotation : IEquatable<Annotation>

    Fields

    Id

    The ID of the annotation which will be used in the json metadata.

    Declaration
    public readonly Guid Id
    Field Value
    Type Description
    Guid

    SensorHandle

    The SensorHandle on which the annotation was reported

    Declaration
    public readonly SensorHandle SensorHandle
    Field Value
    Type Description
    SensorHandle

    Step

    The step on which the annotation was reported.

    Declaration
    public readonly int Step
    Field Value
    Type Description
    Int32

    Properties

    IsNil

    Returns true if the annotation is nil (created using default instantiation).

    Declaration
    public bool IsNil { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(Annotation)

    Declaration
    public bool Equals(Annotation other)
    Parameters
    Type Name Description
    Annotation other
    Returns
    Type Description
    Boolean
    Implements
    IEquatable<T>.Equals(T)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    ReportMetric(MetricDefinition, String)

    Reports a metric on this annotation. May only be called in the same frame as the annotation was reported.

    Declaration
    public void ReportMetric(MetricDefinition metricDefinition, [NotNull] string valuesJsonArray)
    Parameters
    Type Name Description
    MetricDefinition metricDefinition
    String valuesJsonArray

    A string-based JSON array to be placed in the "values" field of the metric

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if values is null

    InvalidOperationException

    Thrown if SensorHandle reports false for ShouldCaptureThisFrame.

    ReportMetric<T>(MetricDefinition, T[])

    Reports a metric on this annotation. May only be called in the same frame as the annotation was reported.

    Declaration
    public void ReportMetric<T>(MetricDefinition metricDefinition, [NotNull] T[] values)
    Parameters
    Type Name Description
    MetricDefinition metricDefinition
    T[] values
    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if values is null

    InvalidOperationException

    Thrown if SensorHandle reports false for ShouldCaptureThisFrame.

    ReportMetricAsync(MetricDefinition)

    Report a metric whose values will be supplied in a later frame.

    Declaration
    public AsyncMetric ReportMetricAsync(MetricDefinition metricDefinition)
    Parameters
    Type Name Description
    MetricDefinition metricDefinition

    The type of the metric.

    Returns
    Type Description
    AsyncMetric

    A handle to an AsyncMetric, which can be used to report values for this metric in future frames.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023