Example Scene ============= This page contains a complete example scene in JSON format that can be used as a template or for testing. Complete Scene JSON ------------------- The following JSON represents a simple scene with: - An ego vehicle with a 3-frame trajectory - One camera sensor - One LiDAR sensor - One radar sensor - One dynamic vehicle actor .. literalinclude:: _static/example_scene.json :language: json :caption: example_scene.json Loading the Example ------------------- To load and work with this example: .. code-block:: python from mimic_data_api import Scene # Copy the JSON above to a file named "example_scene.json" # Then load it: with open("example_scene.json", "r") as f: scene = Scene.model_validate_json(f.read()) # Inspect the loaded scene print(f"Ego trajectory frames: {len(scene.ego_vehicle.trajectory.timestamps)}") print(f"Cameras: {len(scene.ego_vehicle.sensors.cameras)}") print(f"LiDARs: {len(scene.ego_vehicle.sensors.lidars or [])}") print(f"Radars: {len(scene.ego_vehicle.sensors.radars or [])}") print(f"Actors: {len(scene.actors)}") Scene Visualization ------------------- The scene described above represents: .. code-block:: text Time: t=0s Time: t=2s y (left) y (left) ^ ^ | | -----+------> x (forward) -----+------> x (forward) | | [Actor] [Actor] x=30m, y=3.5m x=46m, y=3.5m (adjacent lane) (adjacent lane) [Ego] [Ego] x=0m, y=0m x=20m, y=0m (origin) (moved forward) The ego vehicle travels forward at 10 m/s, while the actor vehicle (in the adjacent lane at y=3.5m) travels at 8 m/s. Minimal Scene Example --------------------- A minimal valid scene with just a camera: .. code-block:: json { "ego_vehicle": { "trajectory": { "timestamps": [0.0], "object2world": [ [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] ], "angular_velocity": null, "linear_velocity": null }, "sensors": { "cameras": [ { "id": 1, "name": "camera", "camera_model": "pinhole", "distortion_parameters": { "p1": 0, "p2": 0, "k1": 0, "k2": 0, "k3": 0, "k4": 0 }, "extrinsics": [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]], "trajectory": { "timestamps": [0.0], "object2world": [ [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] ], "angular_velocity": null, "linear_velocity": null }, "intrinsics": { "fx": 500, "fy": 500, "cx": 320, "cy": 240, "skew": 0, "height": 480, "width": 640 }, "images_data": [ { "filepath": "image.png", "timestamp": 0.0, "undistorded": true, "rolling_shutter": { "readout_time": 0.0, "readout_direction": "global" } } ] } ], "lidars": null, "radars": null } }, "actors": [] } This minimal example contains the bare minimum required fields for a valid scene. Download -------- :download:`Download example_scene.json <_static/example_scene.json>`