Datatypes
rerun.datatypes
class Angle
Bases: AngleExt
Datatype: Angle in either radians or degrees.
inner: float = field(converter=float)
class-attribute
instance-attribute
Must be one of:
-
Radians (float): Angle in radians. One turn is equal to 2π (or τ) radians. Only one of
degrees
orradians
should be set. -
Degrees (float): Angle in degrees. One turn is equal to 360 degrees. Only one of
degrees
orradians
should be set.
kind: Literal['radians', 'degrees'] = field(default='radians')
class-attribute
instance-attribute
Possible values:
-
"radians": Angle in radians. One turn is equal to 2π (or τ) radians. Only one of
degrees
orradians
should be set. -
"degrees": Angle in degrees. One turn is equal to 360 degrees. Only one of
degrees
orradians
should be set.
class AnnotationInfo
Bases: AnnotationInfoExt
Datatype: Annotation info annotating a class id or key-point id.
Color and label will be used to annotate entities/keypoints which reference the id. The id refers either to a class or key-point id
def __init__(id, label=None, color=None)
Create a new instance of the AnnotationInfo datatype.
PARAMETER | DESCRIPTION |
---|---|
id |
TYPE:
|
label |
The label that will be shown in the UI.
TYPE:
|
color |
The color that will be applied to the annotated entity.
TYPE:
|
class Bool
Datatype: A single boolean.
def __init__(value)
Create a new instance of the Bool datatype.
class ClassDescription
Bases: ClassDescriptionExt
Datatype: The description of a semantic Class.
If an entity is annotated with a corresponding ClassId
, Rerun will use
the attached AnnotationInfo
to derive labels and colors.
Keypoints within an annotation class can similarly be annotated with a
KeypointId
in which case we should defer to the label and color for the
AnnotationInfo
specifically associated with the Keypoint.
Keypoints within the class can also be decorated with skeletal edges.
Keypoint-connections are pairs of KeypointId
s. If an edge is
defined, and both keypoints exist within the instance of the class, then the
keypoints should be connected with an edge. The edge should be labeled and
colored as described by the class's AnnotationInfo
.
Note that a ClassDescription
can be directly logged using rerun.log
.
This is equivalent to logging a rerun.AnnotationContext
containing
a single ClassDescription
.
def __init__(*, info, keypoint_annotations=[], keypoint_connections=[])
Create a new instance of the ClassDescription datatype.
PARAMETER | DESCRIPTION |
---|---|
info |
The
TYPE:
|
keypoint_annotations |
The
TYPE:
|
keypoint_connections |
The connections between keypoints.
TYPE:
|
class ClassDescriptionMapElem
Bases: ClassDescriptionMapElemExt
Datatype: A helper type for mapping class IDs to class descriptions.
This is internal to the AnnotationContext
structure.
def __init__(class_id, class_description)
Create a new instance of the ClassDescriptionMapElem datatype.
PARAMETER | DESCRIPTION |
---|---|
class_id |
The key: the class ID.
TYPE:
|
class_description |
The value: class name, color, etc.
TYPE:
|
class ClassId
Datatype: A 16-bit ID representing a type of semantic class.
def __init__(id)
Create a new instance of the ClassId datatype.
class EntityPath
Datatype: A path to an entity in the DataStore
.
def __init__(path)
Create a new instance of the EntityPath datatype.
class Float32
Datatype: A single-precision 32-bit IEEE 754 floating point number.
def __init__(value)
Create a new instance of the Float32 datatype.
class KeypointId
Datatype: A 16-bit ID representing a type of semantic keypoint within a class.
KeypointId
s are only meaningful within the context of a [rerun.datatypes.ClassDescription
].
Used to look up an [rerun.datatypes.AnnotationInfo
] for a Keypoint within the
[rerun.components.AnnotationContext
].
def __init__(id)
Create a new instance of the KeypointId datatype.
class KeypointPair
Bases: KeypointPairExt
Datatype: A connection between two Keypoints
.
def __init__(keypoint0, keypoint1)
Create a new instance of the KeypointPair datatype.
PARAMETER | DESCRIPTION |
---|---|
keypoint0 |
The first point of the pair.
TYPE:
|
keypoint1 |
The second point of the pair.
TYPE:
|
class Mat3x3
Bases: Mat3x3Ext
Datatype: A 3x3 Matrix.
Matrices in Rerun are stored as flat list of coefficients in column-major order:
column 0 column 1 column 2
-------------------------------------------------
row 0 | flat_columns[0] flat_columns[3] flat_columns[6]
row 1 | flat_columns[1] flat_columns[4] flat_columns[7]
row 2 | flat_columns[2] flat_columns[5] flat_columns[8]
However, construction is done from a list of rows, which follows NumPy's convention:
np.testing.assert_array_equal(
rr.datatypes.Mat3x3([1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns, np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32)
)
np.testing.assert_array_equal(
rr.datatypes.Mat3x3([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32),
)
columns
parameter:
np.testing.assert_array_equal(
rr.datatypes.Mat3x3(columns=[1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns,
np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32),
)
np.testing.assert_array_equal(
rr.datatypes.Mat3x3(columns=[[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns,
np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32),
)
def __init__(rows=None, *, columns=None)
class Mat4x4
Bases: Mat4x4Ext
Datatype: A 4x4 Matrix.
Matrices in Rerun are stored as flat list of coefficients in column-major order:
column 0 column 1 column 2 column 3
--------------------------------------------------------------------
row 0 | flat_columns[0] flat_columns[4] flat_columns[8] flat_columns[12]
row 1 | flat_columns[1] flat_columns[5] flat_columns[9] flat_columns[13]
row 2 | flat_columns[2] flat_columns[6] flat_columns[10] flat_columns[14]
row 3 | flat_columns[3] flat_columns[7] flat_columns[11] flat_columns[15]
However, construction is done from a list of rows, which follows NumPy's convention:
np.testing.assert_array_equal(
rr.datatypes.Mat4x4([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]).flat_columns,
np.array([1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 4, 8, 12, 16], dtype=np.float32),
)
np.testing.assert_array_equal(
rr.datatypes.Mat4x4([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]).flat_columns,
np.array([1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 4, 8, 12, 16], dtype=np.float32),
)
columns
parameter:
np.testing.assert_array_equal(
rr.datatypes.Mat4x4(columns=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]).flat_columns,
np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], dtype=np.float32),
)
np.testing.assert_array_equal(
rr.datatypes.Mat4x4(columns=[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]).flat_columns,
np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], dtype=np.float32),
)
def __init__(rows=None, *, columns=None)
class Material
Bases: MaterialExt
Datatype: Material properties of a mesh, e.g. its color multiplier.
def __init__(albedo_factor=None)
Create a new instance of the Material datatype.
PARAMETER | DESCRIPTION |
---|---|
albedo_factor |
Optional color multiplier.
TYPE:
|
class Quaternion
Bases: QuaternionExt
Datatype: A Quaternion represented by 4 real numbers.
Note: although the x,y,z,w components of the quaternion will be passed through to the datastore as provided, when used in the Viewer Quaternions will always be normalized.
class Range1D
Bases: Range1DExt
Datatype: A 1D range, specifying a lower and upper bound.
def __init__(range)
Create a new instance of the Range1D datatype.
class Range2D
Datatype: An Axis-Aligned Bounding Box in 2D space, implemented as the minimum and maximum corners.
def __init__(x_range, y_range)
Create a new instance of the Range2D datatype.
PARAMETER | DESCRIPTION |
---|---|
x_range |
The range of the X-axis (usually left and right bounds).
TYPE:
|
y_range |
The range of the Y-axis (usually top and bottom bounds).
TYPE:
|
class Rgba32
Bases: Rgba32Ext
Datatype: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
The color is stored as a 32-bit integer, where the most significant
byte is R
and the least significant byte is A
.
Float colors are assumed to be in 0-1 gamma sRGB space. All other colors are assumed to be in 0-255 gamma sRGB space. If there is an alpha, we assume it is in linear space, and separate (NOT pre-multiplied).
def __init__(rgba)
Create a new instance of the Rgba32 datatype.
class Rotation3D
Bases: Rotation3DExt
Datatype: A 3D rotation.
inner: Union[datatypes.Quaternion, datatypes.RotationAxisAngle] = field(converter=Rotation3DExt.inner__field_converter_override)
class-attribute
instance-attribute
Must be one of:
-
Quaternion (datatypes.Quaternion): Rotation defined by a quaternion.
-
AxisAngle (datatypes.RotationAxisAngle): Rotation defined with an axis and an angle.
class RotationAxisAngle
Bases: RotationAxisAngleExt
Datatype: 3D rotation represented by a rotation around a given axis.
def __init__(axis, angle=None, *, radians=None, degrees=None)
Create a new instance of the RotationAxisAngle datatype.
PARAMETER | DESCRIPTION |
---|---|
axis |
Axis to rotate around. This is not required to be normalized. If normalization fails (typically because the vector is length zero), the rotation is silently ignored.
TYPE:
|
angle |
How much to rotate around the axis.
TYPE:
|
radians |
How much to rotate around the axis, in radians. Specify this instead of
TYPE:
|
degrees |
How much to rotate around the axis, in radians. Specify this instead of
TYPE:
|
class Scale3D
Bases: Scale3DExt
Datatype: 3D scaling factor, part of a transform representation.
Example
# uniform scaling
scale = rr.datatypes.Scale3D(3.)
# non-uniform scaling
scale = rr.datatypes.Scale3D([1, 1, -1])
scale = rr.datatypes.Scale3D(rr.datatypes.Vec3D([1, 1, -1]))
inner: Union[datatypes.Vec3D, float] = field(converter=Scale3DExt.inner__field_converter_override)
class-attribute
instance-attribute
Must be one of:
-
ThreeD (datatypes.Vec3D): Individual scaling factors for each axis, distorting the original object.
-
Uniform (float): Uniform scaling factor along all axis.
class TensorBuffer
Bases: TensorBufferExt
Datatype: The underlying storage for a Tensor
.
Tensor elements are stored in a contiguous buffer of a single type.
inner: Union[npt.NDArray[np.float16], npt.NDArray[np.float32], npt.NDArray[np.float64], npt.NDArray[np.int16], npt.NDArray[np.int32], npt.NDArray[np.int64], npt.NDArray[np.int8], npt.NDArray[np.uint16], npt.NDArray[np.uint32], npt.NDArray[np.uint64], npt.NDArray[np.uint8]] = field(converter=TensorBufferExt.inner__field_converter_override)
class-attribute
instance-attribute
Must be one of:
-
U8 (npt.NDArray[np.uint8]): 8bit unsigned integer.
-
U16 (npt.NDArray[np.uint16]): 16bit unsigned integer.
-
U32 (npt.NDArray[np.uint32]): 32bit unsigned integer.
-
U64 (npt.NDArray[np.uint64]): 64bit unsigned integer.
-
I8 (npt.NDArray[np.int8]): 8bit signed integer.
-
I16 (npt.NDArray[np.int16]): 16bit signed integer.
-
I32 (npt.NDArray[np.int32]): 32bit signed integer.
-
I64 (npt.NDArray[np.int64]): 64bit signed integer.
-
F16 (npt.NDArray[np.float16]): 16bit IEEE-754 floating point, also known as
half
. -
F32 (npt.NDArray[np.float32]): 32bit IEEE-754 floating point, also known as
float
orsingle
. -
F64 (npt.NDArray[np.float64]): 64bit IEEE-754 floating point, also known as
double
. -
JPEG (npt.NDArray[np.uint8]): Raw bytes of a JPEG file.
-
NV12 (npt.NDArray[np.uint8]): NV12 is a YUV 4:2:0 chroma downsamples format with 8 bits per channel.
First comes entire image in Y, followed by interleaved lines ordered as U0, V0, U1, V1, etc.
-
YUY2 (npt.NDArray[np.uint8]): YUY2, also known as YUYV is a YUV 4:2:2 chroma downsampled format with 8 bits per channel.
The order of the channels is Y0, U0, Y1, V0.
kind: Literal['u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64', 'f16', 'f32', 'f64', 'jpeg', 'nv12', 'yuy2'] = field(default='u8')
class-attribute
instance-attribute
Possible values:
-
"u8": 8bit unsigned integer.
-
"u16": 16bit unsigned integer.
-
"u32": 32bit unsigned integer.
-
"u64": 64bit unsigned integer.
-
"i8": 8bit signed integer.
-
"i16": 16bit signed integer.
-
"i32": 32bit signed integer.
-
"i64": 64bit signed integer.
-
"f16": 16bit IEEE-754 floating point, also known as
half
. -
"f32": 32bit IEEE-754 floating point, also known as
float
orsingle
. -
"f64": 64bit IEEE-754 floating point, also known as
double
. -
"jpeg": Raw bytes of a JPEG file.
-
"nv12": NV12 is a YUV 4:2:0 chroma downsamples format with 8 bits per channel.
First comes entire image in Y, followed by interleaved lines ordered as U0, V0, U1, V1, etc.
-
"yuy2": YUY2, also known as YUYV is a YUV 4:2:2 chroma downsampled format with 8 bits per channel.
The order of the channels is Y0, U0, Y1, V0.
class TensorData
Bases: TensorDataExt
Datatype: An N-dimensional array of numbers.
The number of dimensions and their respective lengths is specified by the shape
field.
The dimensions are ordered from outermost to innermost. For example, in the common case of
a 2D RGB Image, the shape would be [height, width, channel]
.
These dimensions are combined with an index to look up values from the buffer
field,
which stores a contiguous array of typed values.
Note that the buffer may be encoded in a compressed format such as jpeg
or
in a format with downsampled chroma, such as NV12 or YUY2.
For file formats, the shape is used as a hint, for chroma downsampled format
the shape has to be the shape of the decoded image.
def __init__(*, shape=None, buffer=None, array=None, dim_names=None)
Construct a TensorData
object.
The TensorData
object is internally represented by three fields: shape
and buffer
.
This constructor provides additional arguments 'array', and 'dim_names'. When passing in a
multi-dimensional array such as a np.ndarray
, the shape
and buffer
fields will be
populated automagically.
PARAMETER | DESCRIPTION |
---|---|
self |
The TensorData object to construct.
TYPE:
|
shape |
The shape of the tensor. If None, and an array is provided, the shape will be inferred from the shape of the array.
TYPE:
|
buffer |
The buffer of the tensor. If None, and an array is provided, the buffer will be generated from the array.
TYPE:
|
array |
A numpy array (or The array of the tensor. If None, the array will be inferred from the buffer.
TYPE:
|
dim_names |
The names of the tensor dimensions when generating the shape from an array. |
class TensorDimension
Datatype: A single dimension within a multi-dimensional tensor.
class TensorDimensionIndexSelection
Datatype: Indexing a specific tensor dimension.
Selecting dimension=2
and index=42
is similar to doing tensor[:, :, 42, :, :, …]
in numpy.
class TensorDimensionSelection
Bases: TensorDimensionSelectionExt
Datatype: Selection of a single tensor dimension.
def __init__(dimension, *, invert=False)
Create a new instance of the TensorDimensionSelection datatype.
PARAMETER | DESCRIPTION |
---|---|
dimension |
The dimension number to select.
TYPE:
|
invert |
Invert the direction of the dimension.
TYPE:
|
class TimeInt
Bases: TimeIntExt
Datatype: A 64-bit number describing either nanoseconds OR sequence numbers.
def __init__(*, seq=None, seconds=None, nanos=None)
Create a new instance of the TimeInt datatype.
PARAMETER | DESCRIPTION |
---|---|
seq |
Time as a sequence number. Mutually exclusive with seconds and nanos.
TYPE:
|
seconds |
Time in seconds. Mutually exclusive with seq and nanos.
TYPE:
|
nanos |
Time in nanoseconds. Mutually exclusive with seq and seconds.
TYPE:
|
class TimeRange
Datatype: Visible time range bounds for a specific timeline.
def __init__(start, end)
Create a new instance of the TimeRange datatype.
PARAMETER | DESCRIPTION |
---|---|
start |
Low time boundary for sequence timeline.
TYPE:
|
end |
High time boundary for sequence timeline.
TYPE:
|
class TimeRangeBoundary
Bases: TimeRangeBoundaryExt
Datatype: Left or right boundary of a time range.
inner: Union[None, datatypes.TimeInt] = field()
class-attribute
instance-attribute
Must be one of:
-
CursorRelative (datatypes.TimeInt): Boundary is a value relative to the time cursor.
-
Absolute (datatypes.TimeInt): Boundary is an absolute value.
-
Infinite (None): The boundary extends to infinity.
kind: Literal['cursor_relative', 'absolute', 'infinite'] = field(default='cursor_relative')
class-attribute
instance-attribute
Possible values:
-
"cursor_relative": Boundary is a value relative to the time cursor.
-
"absolute": Boundary is an absolute value.
-
"infinite": The boundary extends to infinity.
def absolute(time=None, *, seq=None, seconds=None, nanos=None)
staticmethod
Boundary that is at an absolute time.
PARAMETER | DESCRIPTION |
---|---|
time |
Absolute time. Mutually exclusive with seq, seconds and nanos.
TYPE:
|
seq |
Absolute time in sequence numbers. Use this for sequence timelines. Mutually exclusive with time, seconds and nanos.
TYPE:
|
seconds |
Absolute time in seconds. Use this for time based timelines. Mutually exclusive with time, seq and nanos.
TYPE:
|
nanos |
Absolute time in nanoseconds. Use this for time based timelines. Mutually exclusive with time, seq and seconds.
TYPE:
|
def cursor_relative(offset=None, *, seq=None, seconds=None, nanos=None)
staticmethod
Boundary that is relative to the timeline cursor.
The offset can be positive or negative. An offset of zero (the default) means the cursor time itself.
PARAMETER | DESCRIPTION |
---|---|
offset |
Offset from the cursor time. Mutually exclusive with seq, seconds and nanos.
TYPE:
|
seq |
Offset in sequence numbers. Use this for sequence timelines. Mutually exclusive with time, seconds and nanos.
TYPE:
|
seconds |
Offset in seconds. Use this for time based timelines. Mutually exclusive with time, seq and nanos.
TYPE:
|
nanos |
Offset in nanoseconds. Use this for time based timelines. Mutually exclusive with time, seq and seconds.
TYPE:
|
def infinite()
staticmethod
Boundary that extends to infinity.
Depending on the context, this can mean the beginning or the end of the timeline.
class Transform3D
Bases: Transform3DExt
Datatype: Representation of a 3D affine transform.
inner: Union[datatypes.TranslationAndMat3x3, datatypes.TranslationRotationScale3D] = field()
class-attribute
instance-attribute
Must be one of:
-
TranslationAndMat3x3 (datatypes.TranslationAndMat3x3): Translation plus a 3x3 matrix for scale, rotation, skew, etc.
-
TranslationRotationScale (datatypes.TranslationRotationScale3D): Translation, rotation and scale, decomposed.
class TranslationAndMat3x3
Bases: TranslationAndMat3x3Ext
Datatype: Representation of an affine transform via a 3x3 affine matrix paired with a translation.
First applies the matrix, then the translation.
def __init__(translation=None, mat3x3=None, *, from_parent=False)
Create a new instance of the TranslationAndMat3x3 datatype.
PARAMETER | DESCRIPTION |
---|---|
translation |
3D translation, applied after the matrix.
TYPE:
|
mat3x3 |
3x3 matrix for scale, rotation & shear.
TYPE:
|
from_parent |
If true, the transform maps from the parent space to the space where the transform was logged. Otherwise, the transform maps from the space to its parent.
TYPE:
|
class TranslationRotationScale3D
Bases: TranslationRotationScale3DExt
Datatype: Representation of an affine transform via separate translation, rotation & scale.
class UInt32
Datatype: A 32bit unsigned integer.
def __init__(value)
Create a new instance of the UInt32 datatype.
class UInt64
Datatype: A 64bit unsigned integer.
def __init__(value)
Create a new instance of the UInt64 datatype.
class UVec2D
Datatype: A uint32 vector in 2D space.
def __init__(xy)
Create a new instance of the UVec2D datatype.
class UVec3D
Bases: UVec3DExt
Datatype: A uint32 vector in 3D space.
def __init__(xyz)
Create a new instance of the UVec3D datatype.
class UVec4D
Datatype: A uint vector in 4D space.
def __init__(xyzw)
Create a new instance of the UVec4D datatype.
class Utf8
Datatype: A string of text, encoded as UTF-8.
def __init__(value)
Create a new instance of the Utf8 datatype.
class Uuid
Bases: UuidExt
Datatype: A 16-byte UUID.
def __init__(bytes)
Create a new instance of the Uuid datatype.
PARAMETER | DESCRIPTION |
---|---|
bytes |
The raw bytes representing the UUID.
TYPE:
|
class Vec2D
Bases: Vec2DExt
Datatype: A vector in 2D space.
def __init__(xy)
Create a new instance of the Vec2D datatype.
class Vec3D
Bases: Vec3DExt
Datatype: A vector in 3D space.
def __init__(xyz)
Create a new instance of the Vec3D datatype.
class Vec4D
Bases: Vec4DExt
Datatype: A vector in 4D space.
def __init__(xyzw)
Create a new instance of the Vec4D datatype.
class VisibleTimeRange
Bases: VisibleTimeRangeExt
Datatype: Visible time range bounds for a specific timeline.
def __init__(timeline, range=None, *, start=None, end=None)
Create a new instance of the VisibleTimeRange datatype.
PARAMETER | DESCRIPTION |
---|---|
timeline |
Name of the timeline this applies to.
TYPE:
|
range |
Time range to use for this timeline.
TYPE:
|
start |
Low time boundary for sequence timeline. Specify this instead of
TYPE:
|
end |
High time boundary for sequence timeline. Specify this instead of
TYPE:
|