From 3b864275e8b44b8be04d119cd15054df39f5bcd8 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Mon, 4 Nov 2024 08:54:34 +0100 Subject: [PATCH] feat: add JSONStreamRadar --- raillabel/json_format/stream_radar.py | 46 +++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 raillabel/json_format/stream_radar.py diff --git a/raillabel/json_format/stream_radar.py b/raillabel/json_format/stream_radar.py new file mode 100644 index 0000000..6724e49 --- /dev/null +++ b/raillabel/json_format/stream_radar.py @@ -0,0 +1,46 @@ +# Copyright DB InfraGO AG and contributors +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from typing import Literal + +from pydantic import BaseModel + + +class JSONStreamRadar(BaseModel): + """A stream describes the source of a data sequence, usually a sensor. + + This specific object contains the intrinsics of a radar sensor. + """ + + type: Literal["radar"] + "A string encoding the type of the stream." + + stream_properties: JSONStreamRadarProperties + "Intrinsic calibration of the stream." + + uri: str + "A string encoding the subdirectory containing the sensor files." + + description: str | None + "Description of the stream." + + +class JSONStreamRadarProperties(BaseModel): + """Intrinsic calibration of the stream.""" + + intrinsics_radar: JSONIntrinsicsRadar + + +class JSONIntrinsicsRadar(BaseModel): + """JSON object defining an instance of the intrinsic parameters of a radar.""" + + resolution_px_per_m: float + "Number correlating pixel in the output image to a position relative to the sensor in meters." + + height_px: int + "Height of the radar output in pixel." + + width_px: int + "Width of the radar output in pixel."