Skip to content

Commit

Permalink
feat: add JSONObjectData
Browse files Browse the repository at this point in the history
  • Loading branch information
tklockau committed Nov 4, 2024
1 parent 4e261d6 commit 5cf8d78
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions raillabel/json_format/object_data.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion raillabel/json_format/poly3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion raillabel/json_format/vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .attributes import JSONAttributes


class JSONPoly2d(BaseModel):
class JSONVec(BaseModel):
"""A vector (list) of numbers."""

name: str
Expand Down

0 comments on commit 5cf8d78

Please sign in to comment.