annotations

audio

class stardust.components.annotations.audio.Audio(start, end, **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of video label task

Args:
start: float

The start time of annotation for this audio

end: float

The end time of annotation for this audio

Returns:

Audio instance

Examples:
audio = Audio(start=0.57, 12.13)

box2d

class stardust.components.annotations.box.Box2D(p1=None, p2=None, center=None, size=None, source=None, **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of box2d label task

Args:
p1:

Point obj or a Sequence obj, the point at the top left corner of a 2d box

p2:

Point obj or a Sequence obj, the point at the bottom right corner of a 2d box

center:

Center point coordinates, supporting Point objects or sequences of length 2

size:

Size, supports Point objects or sequences of length 2

source:

camera name, string, camera name

Returns:

Box2D instance

Examples:
bx = Box2D(center=[473.07, 395.93], size=[38.65, 28.67])
bx.area

>>> output
1108.0955000000001
property corners: Dict[str, Point]
Returns:

float: the conner points os the current box2d

property x1: float
Returns:

float: The x-coordinate of the top left point.

property y1: float
Returns:

float: The y-coordinate of the top left point.

property x2: float
Returns:

float: The x-coordinate of the bottom right point.

property y2: float
Returns:

float: The y-coordinate of the bottom right point.

property height: float
Returns:

float: the height of the current box2d, axis y

property width: float
Returns:

float: the width of the current box2d, axis x

property area: float
Returns:

float: the area of the current box2d

static gen_box(slot, children_lst=None, parent_id=None, label_kind=None, **kwargs)[source]

generate the Box2D obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor id

Returns:

a Box2D instance

box3d

class stardust.components.annotations.box3d.Box3D(center, size, rotation, rotation_order='XYZ', **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of 3d geometry box.

Args:
center:

like: [4.133927784395542, -3.777526126541506, 0.7891658530222055] or Point3D obj

size:

like [7.298632312111001, 2.192134290714646, 1.9819562591803783], Iterable, extent in x, y and z direction or Point3D obj

rotation:

like [0, 0, -1.5713694508648803], Iterable

rotation_order:

default to be XYZ

Returns:

Box3D instance

Examples:
box = Box3D(Point3D(4.13, -3.77, 0.78),Point3D(1, 5, 1),[0, 0, -1.57])

box.volume

>>> output:
>>> 5
property vertices: array

The 8 vertices of the current 3D frame object

Returns:

np.array, the points from box3d

Examples:
box.vertices

>>> output:

>>> np.array([[ 1.63421476 -3.2760934   0.28916585]
 [ 1.63364163 -4.27609323  0.28916585]
 [ 6.63421394 -3.27895902  0.28916585]
 [ 1.63421476 -3.2760934   1.28916585]
 [ 6.63364081 -4.27895885  1.28916585]
 [ 6.63421394 -3.27895902  1.28916585]
 [ 1.63364163 -4.27609323  1.28916585]
 [ 6.63364081 -4.27895885  0.28916585]])
static gen_box3d(slot, children_lst=None, parent_id=None, label_kind=None, team_id=None)[source]

generate the Box3D obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor ID

Returns:

a Box3D instance

input

class stardust.components.annotations.input.InputTypeEnum(value)[source]

Bases: Enum

An enumeration.

Select = 'select'
Multiselect = 'multiple'
Nest = 'nested'
Number = 'number'
Text = 'text'
MultiText = 'multiple-text'
class stardust.components.annotations.input.Input(input_type, value=None, required=False, default=None, name=None, options=None, **kwargs)[source]

Bases: AnnotationObject

This structure defines that your input can only be a drop-down box or an input textarea box

Args:
kind:

one type of [select, text, multiple selet]

value:

_T

required:

if necessary

default:

default value

name:

the name of the current select obj

options:

All choices allowed by value

Returns:

Input instance

Examples:
input = Input(input_type="select", value="rain")
input.value

output:
>>> rain
static gen_input(child, parent_id=None)[source]

generate the input obj

Args:
child:

subclass

parent_id:

superclass

Returns:

a Input instance

line

class stardust.components.annotations.line.InterpolationEnum(value)[source]

Bases: Enum

An enumeration.

Straight = 'line'
BSpline = 'b-spline'
Spline = 'spline'
class stardust.components.annotations.line.Line(points, interpolation='line', **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of 2d line.

Args:
points:

A list composed of Point objects or a Sequence composed of numbers

interpolation:

Filled line between points, default straight line

Returns:

Line instance

Examples:
line = Line([(0,0), (1,1), (2,2), (3,3)])
static gen_line(slot, children_lst=None, parent_id=None, label_kind=None, **kwargs)[source]

generate the Box3D obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor ID

Returns:

a Line instance

point

class stardust.components.annotations.point.Point(x, y, **kwargs)[source]

Bases: AnnotationObject

This class defines the concept of 2d geometry point

Args:

x: a float number y: a float number

Returns:

Point instance

Examples:
p = Point(11.12, 345.43)
to_array()[source]
Return type:

array

classmethod gen_point(slot, children_lst, parent_id, label_kind=None)[source]

generate the Polygon obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor ID

Returns:

a Polygon instance

point3d

class stardust.components.annotations.point3d.Point3D(x, y, z)[source]

Bases: object

This class defines the concept of 3d geometry point

Args:

x: a float number y: a float number z: a float number

Returns:

Point3D instance

Examples:
p = Point(11.12, 345.43, 46,78)
x: NumberFiled
y: NumberFiled
z: NumberFiled
to_array()[source]
Return type:

array

polygon

class stardust.components.annotations.polygon.Polygon(points, **kwargs)[source]

Bases: Line, AnnotationObject, Polygon

This class defines the concept of 2d geometry Polygon

Args:
points:

A list composed of Point objects or a Sequence composed of numbers

Returns:

Polygon instance

Examples:
polygon = Polygon([(0,0), (1,1), (2,2), (3,3)])
property area: float
Returns: float

the area of current polygon instance

property points_num: float
Returns: float

the points num of current polygon instance

property bounding_box
Returns: float

box2d obj, the box3d outer the current polygon

static gen_polygon(slot, children_lst, parent_id, label_kind)[source]

generate the Polygon obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor ID

Returns:

a Polygon instance

text

class stardust.components.annotations.text.Text(start=None, end=None, content=None, **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of text label task

Args:
start:

The start time of annotation for this text

end:

The end time of annotation for this text

Returns:

Text instance

Examples:
text = Text(start=0.57, end=12.13)
classmethod gen_text(slot, children_lst=None, parent_id=None, label_kind=None)[source]

generate the Polygon obj

Args:
slot:

rosetta slot

children_lst:

rosetta children

parent_id:

Upper floor ID

Returns:

a Polygon instance

video

class stardust.components.annotations.video.Video(start, end, fps=30, **kwargs)[source]

Bases: AnnotationObject

This class defines the structure of video label task

Args:
start:

The start time of annotation for this text

end:

The end time of annotation for this text

Returns:

Video class

Examples:
video = Video(start=0.57, end=12.13)