Skip to content

World

BBox2D

Bases: NamedTuple

Model for 2D Bounding Box.

Source code in mbodied/types/sense/world.py
11
12
13
14
15
16
17
class BBox2D(NamedTuple):
    """Model for 2D Bounding Box."""

    x1: float
    y1: float
    x2: float
    y2: float

BBox3D

Bases: NamedTuple

Model for 3D Bounding Box.

Source code in mbodied/types/sense/world.py
20
21
22
23
24
25
26
27
28
class BBox3D(NamedTuple):
    """Model for 3D Bounding Box."""

    x1: float
    y1: float
    z1: float
    x2: float
    y2: float
    z2: float

PixelCoords

Bases: NamedTuple

Model for Pixel Coordinates.

Source code in mbodied/types/sense/world.py
31
32
33
34
35
class PixelCoords(NamedTuple):
    """Model for Pixel Coordinates."""

    u: int
    v: int

World

Bases: Sample

Model for World Data.

Attributes:

Name Type Description
image Image | None

The image of the world.

depth Image | None

The depth image of the world.

annotated Image | None

The annotated image of the world.

objects List[WorldObject]

The list of world objects.

Source code in mbodied/types/sense/world.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
class World(Sample):
    """Model for World Data.

    Attributes:
        image (Image | None): The image of the world.
        depth (Image | None): The depth image of the world.
        annotated (Image | None): The annotated image of the world.
        objects (List[WorldObject]): The list of world objects.
    """

    image: Image | None = None
    depth: Image | None = None
    annotated: Image | None = None
    objects: List[WorldObject] = Field(default_factory=list, description="List of world objects")

WorldObject

Bases: Sample

Model for World Object. It describes the objects in the world.

Attributes:

Name Type Description
name str

The name of the object.

bbox_2d BBox2D | None

The 2D bounding box of the object.

bbox_3d BBox3D | None

The 3D bounding box of the object.

pose Pose | None

The pose of the object.

pixel_coords PixelCoords | None

The pixel coordinates of the object.

Source code in mbodied/types/sense/world.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class WorldObject(Sample):
    """Model for World Object. It describes the objects in the world.

    Attributes:
        name (str): The name of the object.
        bbox_2d (BBox2D | None): The 2D bounding box of the object.
        bbox_3d (BBox3D | None): The 3D bounding box of the object.
        pose (Pose | None): The pose of the object.
        pixel_coords (PixelCoords | None): The pixel coordinates of the object.
    """

    name: str = ""
    bbox_2d: BBox2D | None = None
    bbox_3d: BBox3D | None = None
    pose: Pose | None = None
    pixel_coords: PixelCoords | None = None
    mask: NumpyArray | None = None