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 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
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]])
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
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)])
point
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
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
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)
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)