DSD-DBS / raillabel

A devkit for working with recorded and annotated train ride data from Deutsche Bahn.
Apache License 2.0
20 stars 7 forks source link

Request to optimize the output format of raillabel.filter #47

Closed yinheyanxian closed 4 months ago

yinheyanxian commented 5 months ago

Hi!

Thank you so much for opening up the OSDaR23 dataset and devkit. This is the most valuable dataset I have ever seen, and I think it is a milestone in improving the level of autonomous train. As a railway researcher, I can't wait to work with this dataset. Specifically, I focus on the liDAR data in your dataset, such as cuboid labels for object detection, vec labels for semantic segmentation, and poly3d labels for track line detection.

I read the raillabel documentation and found the raillabel.filter method to extract the data I wanted from the annotated json file. My code looks like this:

import raillabel

scene = raillabel.load(r'G:\OSDaR23\2_station_berliner_tor_2.1\2_station_berliner_tor_2.1_labels.json')

scene_with_only_cuboid = raillabel.filter(
    scene,
    include_annotation_types=['cuboid'], # annotation_types
    include_sensors=['lidar'], # sensor
    include_frames=[250] # frame
)
print(scene_with_only_cuboid)

The output is some cuboid labels about lidar in the annotated json file.

Scene(metadata=Metadata(schema_version='1.0.0', annotator='FusionSystems GmbH (Chemnitz, Germany), on behalf of the German Centre for Rail Traffic Research (Germany, www.dzsf.bund.de) and in cooperation with Digitale Schiene Deutschland / DB Netz AG (Germany)', comment='The Open Sensor Data for Rail 2023 (OSDaR23, https://doi.org/10.57806/9mv146r0) is published by the German Centre for Rail Traffic Research at the Federal Railway Authority (DZSF, https://www.dzsf.bund.de). Annotation data (file type .json) are published under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/legalcode). Sensor data (file types .png, .pcd, and .csv) are published under CC BY-SA 3.0 de (https://creativecommons.org/licenses/by-sa/3.0/de/legalcode).', exporter_version='3.1', file_version='1.2.0', name="sequence #2 'station berliner tor' / part 2.1", subschema_version='3.0.0', tagged_file='2_station_berliner_tor_2.1'), sensors={'lidar': Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None)}, objects={'009f768e-7e8f-4148-8754-d4c4d178fba0': Object(uid='009f768e-7e8f-4148-8754-d4c4d178fba0', name='signal0003', type='signal'), '02efca74-6fa5-4e5e-8537-955fe0f903df': Object(uid='02efca74-6fa5-4e5e-8537-955fe0f903df', name='person0002', type='person'), '0e7df2ce-d484-48c6-abaf-a50d74c208a1': Object(uid='0e7df2ce-d484-48c6-abaf-a50d74c208a1', name='person0021', type='person'), '17039a1e-193b-4e87-9e8a-3a63601219ca': Object(uid='17039a1e-193b-4e87-9e8a-3a63601219ca', name='person0019', type='person'), '2183bb80-a159-4071-bda8-a38c5649ddde': Object(uid='2183bb80-a159-4071-bda8-a38c5649ddde', name='signal_pole0002', type='signal_pole'), '3b278088-b046-4068-844a-df5bcf6d6f0a': Object(uid='3b278088-b046-4068-844a-df5bcf6d6f0a', name='signal_pole0001', type='signal_pole'), '42a9195b-3d0f-46ae-a882-a82f8a2d09df': Object(uid='42a9195b-3d0f-46ae-a882-a82f8a2d09df', name='person0022', type='person'), '51a23bc1-dfb0-4e62-8939-51bbdd36fe7f': Object(uid='51a23bc1-dfb0-4e62-8939-51bbdd36fe7f', name='person0014', type='person'), '621f3d9d-38ca-41ae-9e60-7935e5c8fe9c': Object(uid='621f3d9d-38ca-41ae-9e60-7935e5c8fe9c', name='catenary_pole0002', type='catenary_pole'), '7cd41b06-5ad4-4cb2-9b8a-69c50bd008e1': Object(uid='7cd41b06-5ad4-4cb2-9b8a-69c50bd008e1', name='person0004', type='person'), '81e4ee59-eeb0-4d89-b9c5-72d8fc3ba991': Object(uid='81e4ee59-eeb0-4d89-b9c5-72d8fc3ba991', name='person0001', type='person'), '843b5c17-da2c-492b-a08a-a8a2db60f146': Object(uid='843b5c17-da2c-492b-a08a-a8a2db60f146', name='person0012', type='person'), '8f85857a-03bd-4e98-8a46-c6f3647c6e8d': Object(uid='8f85857a-03bd-4e98-8a46-c6f3647c6e8d', name='catenary_pole0009', type='catenary_pole'), '9020a691-ef94-4c02-baf2-ab47fc289058': Object(uid='9020a691-ef94-4c02-baf2-ab47fc289058', name='person0011', type='person'), '9bb5e432-8ca8-48ee-b60c-59ac618f5b0b': Object(uid='9bb5e432-8ca8-48ee-b60c-59ac618f5b0b', name='person0013', type='person'), 'a5cd77ba-6631-4809-be65-d0e507e935c3': Object(uid='a5cd77ba-6631-4809-be65-d0e507e935c3', name='signal0002', type='signal'), 'a6021bcf-07bd-4a09-8693-5c5beaa733e4': Object(uid='a6021bcf-07bd-4a09-8693-5c5beaa733e4', name='catenary_pole0004', type='catenary_pole'), 'aaba282c-7ec9-4588-8fe9-e84efff78e51': Object(uid='aaba282c-7ec9-4588-8fe9-e84efff78e51', name='catenary_pole0003', type='catenary_pole'), 'be220d58-4eff-4ce9-8b07-a9e2e815209b': Object(uid='be220d58-4eff-4ce9-8b07-a9e2e815209b', name='person0003', type='person'), 'd8338667-f730-4faa-8360-f562c07447d1': Object(uid='d8338667-f730-4faa-8360-f562c07447d1', name='signal0001', type='signal'), 'f23256f1-18e9-4c25-93a5-848322b3b022': Object(uid='f23256f1-18e9-4c25-93a5-848322b3b022', name='catenary_pole0001', type='catenary_pole')}, frames={250: Frame(uid=250, timestamp=Decimal('1631531385.099957000'), sensors={'lidar': SensorReference(sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), timestamp=Decimal('1631531385.099957000'), uri='/lidar/250_1631531385.099957000.pcd')}, frame_data={}, annotations={'e6935e80-a8e7-46eb-94cf-878a8c51c5ca': Cuboid(uid='e6935e80-a8e7-46eb-94cf-878a8c51c5ca', object=Object(uid='009f768e-7e8f-4148-8754-d4c4d178fba0', name='signal0003', type='signal'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'occlusion': '0-25 %', 'signalFace': 'front', 'type': 'light', 'connectedTo': ['2183bb80-a159-4071-bda8-a38c5649ddde']}, pos=Point3d(x=116.9, y=19.28, z=3.35), quat=Quaternion(x=0.025441631294542886, y=-0.00046664475167300205, z=0.21342361008556482, w=0.9766283163505926), size=Size3d(x=0.7, y=0.7, z=0.9)), '2e724265-e791-422a-871d-6643ec3ae00d': Cuboid(uid='2e724265-e791-422a-871d-6643ec3ae00d', object=Object(uid='02efca74-6fa5-4e5e-8537-955fe0f903df', name='person0002', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'connectedTo': []}, pos=Point3d(x=95.55, y=12.14, z=2.45), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.8, y=0.8, z=1.9)), '4f981094-60bf-43e8-8871-460781a7725f': Cuboid(uid='4f981094-60bf-43e8-8871-460781a7725f', object=Object(uid='0e7df2ce-d484-48c6-abaf-a50d74c208a1', name='person0021', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'connectedTo': []}, pos=Point3d(x=8.18, y=-3.66, z=1.75), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.8, y=0.8, z=1.9)), '9011cd42-2f4c-484f-8616-174b4c99ef78': Cuboid(uid='9011cd42-2f4c-484f-8616-174b4c99ef78', object=Object(uid='17039a1e-193b-4e87-9e8a-3a63601219ca', name='person0019', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['backpack'], 'connectedTo': []}, pos=Point3d(x=38.29, y=-4.02, z=1.9), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.0, y=1.0, z=1.8)), '197889a8-3194-4af3-9783-afa4e463fba6': Cuboid(uid='197889a8-3194-4af3-9783-afa4e463fba6', object=Object(uid='2183bb80-a159-4071-bda8-a38c5649ddde', name='signal_pole0002', type='signal_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '50-75 %', 'type': 'structured', 'connectedTo': ['a5cd77ba-6631-4809-be65-d0e507e935c3', '009f768e-7e8f-4148-8754-d4c4d178fba0']}, pos=Point3d(x=117.71, y=19.65, z=1.4), quat=Quaternion(x=0.0, y=0.0, z=0.21337142653381594, w=0.9769711532788081), size=Size3d(x=1.0, y=1.0, z=2.8)), 'e06f2570-4a2c-4ab0-9d29-805b134864cc': Cuboid(uid='e06f2570-4a2c-4ab0-9d29-805b134864cc', object=Object(uid='3b278088-b046-4068-844a-df5bcf6d6f0a', name='signal_pole0001', type='signal_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured', 'connectedTo': ['d8338667-f730-4faa-8360-f562c07447d1']}, pos=Point3d(x=131.54, y=26.84, z=2.8), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.8, y=0.9, z=4.8)), '6f852f9b-2490-4dad-b3a4-8642e00dae8e': Cuboid(uid='6f852f9b-2490-4dad-b3a4-8642e00dae8e', object=Object(uid='42a9195b-3d0f-46ae-a882-a82f8a2d09df', name='person0022', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'sitting', 'connectedTo': []}, pos=Point3d(x=5.54, y=-5.73, z=1.49), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.9, y=1.4, z=1.1)), '54bfb1cd-7af4-42c3-9828-18fa70dd9abb': Cuboid(uid='54bfb1cd-7af4-42c3-9828-18fa70dd9abb', object=Object(uid='51a23bc1-dfb0-4e62-8939-51bbdd36fe7f', name='person0014', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['backpack'], 'connectedTo': []}, pos=Point3d(x=90.2, y=5.93, z=2.2), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.0, y=1.1, z=2.0)), 'c83aef2a-0dbe-4f68-aeb9-0d6aebedc0d9': Cuboid(uid='c83aef2a-0dbe-4f68-aeb9-0d6aebedc0d9', object=Object(uid='621f3d9d-38ca-41ae-9e60-7935e5c8fe9c', name='catenary_pole0002', type='catenary_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured'}, pos=Point3d(x=120.18, y=28.13, z=3.67), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.2, y=0.9, z=6.9)), '2e7478db-8f04-4e0b-ac73-0e6e1be4088f': Cuboid(uid='2e7478db-8f04-4e0b-ac73-0e6e1be4088f', object=Object(uid='7cd41b06-5ad4-4cb2-9b8a-69c50bd008e1', name='person0004', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '50-75 %', 'pose': 'upright', 'connectedTo': []}, pos=Point3d(x=100.26, y=12.47, z=2.3), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.0, y=0.6, z=2.0)), '94faacdf-046d-415b-9b87-62d30957338a': Cuboid(uid='94faacdf-046d-415b-9b87-62d30957338a', object=Object(uid='81e4ee59-eeb0-4d89-b9c5-72d8fc3ba991', name='person0001', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': True, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['backpack'], 'connectedTo': []}, pos=Point3d(x=85.27, y=8.08, z=2.25), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.0, y=0.9, z=1.9)), '269e66fb-bef3-4ccc-9aa8-7938e6aa1f6d': Cuboid(uid='269e66fb-bef3-4ccc-9aa8-7938e6aa1f6d', object=Object(uid='843b5c17-da2c-492b-a08a-a8a2db60f146', name='person0012', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['backpack'], 'connectedTo': []}, pos=Point3d(x=49.5, y=0.27, z=1.9), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.0, y=0.8, z=1.8)), 'cb0465c9-086c-4300-8784-739a36e437af': Cuboid(uid='cb0465c9-086c-4300-8784-739a36e437af', object=Object(uid='8f85857a-03bd-4e98-8a46-c6f3647c6e8d', name='catenary_pole0009', type='catenary_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured'}, pos=Point3d(x=12.74, y=12.5, z=3.77), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.8, y=0.8, z=6.7)), 'da6367d9-91d2-499e-93d1-8ed16fec4a93': Cuboid(uid='da6367d9-91d2-499e-93d1-8ed16fec4a93', object=Object(uid='9020a691-ef94-4c02-baf2-ab47fc289058', name='person0011', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['other'], 'connectedTo': []}, pos=Point3d(x=33.66, y=-1.47, z=1.9), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.2, y=1.0, z=1.8)), '3894d979-e83c-4c64-a50a-0c7c1620d699': Cuboid(uid='3894d979-e83c-4c64-a50a-0c7c1620d699', object=Object(uid='9bb5e432-8ca8-48ee-b60c-59ac618f5b0b', name='person0013', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': False, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '0-25 %', 'pose': 'upright', 'carrying': ['backpack'], 'connectedTo': []}, pos=Point3d(x=49.2, y=-0.51, z=1.9), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.9, y=1.0, z=1.8)), '59866674-d80d-4d10-aa82-7f2f554c771c': Cuboid(uid='59866674-d80d-4d10-aa82-7f2f554c771c', object=Object(uid='a5cd77ba-6631-4809-be65-d0e507e935c3', name='signal0002', type='signal'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'occlusion': '25-50 %', 'signalFace': 'front', 'type': 'light', 'connectedTo': ['2183bb80-a159-4071-bda8-a38c5649ddde']}, pos=Point3d(x=117.66, y=19.62, z=4.08), quat=Quaternion(x=0.0, y=0.0, z=0.20355631252976772, w=0.979063239851892), size=Size3d(x=1.1, y=1.4, z=2.55)), '5d669fa1-5725-4e53-956b-f1cb8673c160': Cuboid(uid='5d669fa1-5725-4e53-956b-f1cb8673c160', object=Object(uid='a6021bcf-07bd-4a09-8693-5c5beaa733e4', name='catenary_pole0004', type='catenary_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured'}, pos=Point3d(x=42.82, y=12.69, z=3.82), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.3, y=0.9, z=6.6)), '58bf6947-4cd6-4cb5-9a23-8ced39c3b777': Cuboid(uid='58bf6947-4cd6-4cb5-9a23-8ced39c3b777', object=Object(uid='aaba282c-7ec9-4588-8fe9-e84efff78e51', name='catenary_pole0003', type='catenary_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured'}, pos=Point3d(x=12.88, y=9.47, z=3.75), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.8, y=0.8, z=6.9)), '00c715ed-ac30-4b27-a832-69a9cd8971ad': Cuboid(uid='00c715ed-ac30-4b27-a832-69a9cd8971ad', object=Object(uid='be220d58-4eff-4ce9-8b07-a9e2e815209b', name='person0003', type='person'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isDistracted': True, 'isDummy': False, 'age': 'adult', 'aid': 'none', 'function': 'passenger', 'occlusion': '50-75 %', 'pose': 'upright', 'connectedTo': []}, pos=Point3d(x=99.13, y=12.43, z=2.3), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=0.9, y=0.7, z=2.0)), '3f912029-15a8-4a58-aa39-91dbdfed0d7b': Cuboid(uid='3f912029-15a8-4a58-aa39-91dbdfed0d7b', object=Object(uid='d8338667-f730-4faa-8360-f562c07447d1', name='signal0001', type='signal'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'occlusion': '0-25 %', 'signalFace': 'back', 'type': 'light', 'connectedTo': ['3b278088-b046-4068-844a-df5bcf6d6f0a']}, pos=Point3d(x=131.58, y=26.83, z=6.02), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.8, y=1.0, z=2.0)), '2b1bfa4c-42ea-4c40-a3da-5d854f5c19b5': Cuboid(uid='2b1bfa4c-42ea-4c40-a3da-5d854f5c19b5', object=Object(uid='f23256f1-18e9-4c25-93a5-848322b3b022', name='catenary_pole0001', type='catenary_pole'), sensor=Sensor(uid='lidar', extrinsics=Transform(pos=Point3d(x=0.0, y=0.0, z=0.0), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)), intrinsics=None, type=<SensorType.LIDAR: 'lidar'>, uri='lidar', description=None), attributes={'isTruncatedBottom': False, 'isTruncatedTop': False, 'occlusion': '0-25 %', 'type': 'structured'}, pos=Point3d(x=79.6, y=21.21, z=3.52), quat=Quaternion(x=0.0, y=0.0, z=0.0, w=1.0), size=Size3d(x=1.3, y=0.9, z=7.2))})})

However, I found that the output is in tuple form, unlike the dictionary form in json, which makes it difficult to automatically extract labels from massive data. If the output of railabel.filter is also in dictionary form, automatic label extraction would be much easier.

By the way, I saw this in Labeling Guide (Top of page 12). 1710763474331 Does this mean that all cuboid labels in the dataset are directionless?

Anyway, thank you very much for your open source spirit, and I will continue to follow your work.

Thanks in advance.

unexcellent commented 5 months ago

Hi yinheyanxian, thanks for your questions.

For the first one: raillabel.filter() returns a Scene (just like the one you handed in as the first argument). If you want it as a dict you can use scene_with_only_cuboid.asdict(). If you want to store it to a file to look at it, then the easiest way is to use raillabel.save(scene_with_only_cuboid, "/path/to/output/file.json", prettify_json=True).

For the second question: In the current dataset, 3D Bounding Boxes without a orientation/direction are used. In a future dataset we would like to introduce an orientation for the 3D Bounding Boxes.

Hope that helps!

yinheyanxian commented 5 months ago

Hi yinheyanxian, thanks for your questions.

For the first one: raillabel.filter() returns a Scene (just like the one you handed in as the first argument). If you want it as a dict you can use scene_with_only_cuboid.asdict(). If you want to store it to a file to look at it, then the easiest way is to use raillabel.save(scene_with_only_cuboid, "/path/to/output/file.json", prettify_json=True).

I will get back to you for the second one.

Thanks for your reply!

In fact, I have successfully extracted cuboid annotations for lidar data. And I noticed that each cuboid has a quaternion that represents their orientation in 3D space.

However, 3D Bboxes for autonomous driving datasets like waymo or nuscenes are usually in (cx, cy, cz, l, w, h, θ) format (where cx, cy, cz are represented by bbox center coordinates, l, w, h are represented by bbox length, width and height, and θ is represented by bbox yaw Angle).

However, the quaternion appears to indicate the Angle of rotation of cuboid in all three directions xyz. I want to know how to convert quaternions into yaw angles? If only the yaw Angle is used, will it matter when training the target detection algorithm?

Thank you very much!

unexcellent commented 4 months ago

I would suggest you use the Scipy Rotation Library for converting quaternions into Euler angles. Quaternions are the industry standard but Euler angles / yaw angles should work too.

yinheyanxian commented 4 months ago

I would suggest you use the Scipy Rotation Library for converting quaternions into Euler angles. Quaternions are the industry standard but Euler angles / yaw angles should work too.

Thank you for your quick and valuable reply!

I have successfully got the Angle data of liDAR data cuboid annotation.