diff --git a/raillabel/json_format/object_data.py b/raillabel/json_format/object_data.py new file mode 100644 index 0000000..78cc13a --- /dev/null +++ b/raillabel/json_format/object_data.py @@ -0,0 +1,22 @@ +# Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import BaseModel + +from .bbox import JSONBbox +from .cuboid import JSONCuboid +from .poly2d import JSONPoly2d +from .poly3d import JSONPoly3d +from .vec import JSONVec + + +class JSONObjectData(BaseModel): + """Container of annotations of an object in a frame.""" + + bbox: list[JSONBbox] | None + cuboid: list[JSONCuboid] | None + poly2d: list[JSONPoly2d] | None + poly3d: list[JSONPoly3d] | None + vec: list[JSONVec] | None diff --git a/raillabel/json_format/poly3d.py b/raillabel/json_format/poly3d.py index 6c6e15f..488df30 100644 --- a/raillabel/json_format/poly3d.py +++ b/raillabel/json_format/poly3d.py @@ -10,7 +10,7 @@ from .attributes import JSONAttributes -class JSONPoly2d(BaseModel): +class JSONPoly3d(BaseModel): """A 3D polyline defined as a sequence of 3D points.""" name: str diff --git a/raillabel/json_format/vec.py b/raillabel/json_format/vec.py index 842c00f..925956e 100644 --- a/raillabel/json_format/vec.py +++ b/raillabel/json_format/vec.py @@ -11,7 +11,7 @@ from .attributes import JSONAttributes -class JSONPoly2d(BaseModel): +class JSONVec(BaseModel): """A vector (list) of numbers.""" name: str