From 2df4b77d49dc6d1f28af01123e42520924619f18 Mon Sep 17 00:00:00 2001 From: unexcellent <> Date: Wed, 30 Oct 2024 17:15:56 +0100 Subject: [PATCH] feat: add JSONObject --- raillabel/json_format/object.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 raillabel/json_format/object.py diff --git a/raillabel/json_format/object.py b/raillabel/json_format/object.py new file mode 100644 index 0000000..796cc22 --- /dev/null +++ b/raillabel/json_format/object.py @@ -0,0 +1,30 @@ +# Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from pydantic import BaseModel + +from .element_data_pointer import JSONElementDataPointer +from .frame_interval import JSONFrameInterval + + +class JSONObject(BaseModel): + """An object is the main type of annotation element. + + Object is designed to represent spatiotemporal entities, such as physical objects in the real + world. Objects shall have a name and type. Objects may have static and dynamic data. Objects + are the only type of elements that may have geometric data, such as bounding boxes, cuboids, + polylines, images, etc. + """ + + name: str + "Name of the object. It is a friendly name and not used for indexing." + + type: str + "The type of an object defines the class the object corresponds to." + + frame_intervals: list[JSONFrameInterval] | None + "The array of frame intervals where this object exists or is defined." + + object_data_pointers: dict[str, JSONElementDataPointer] | None