paralleldomain.model.dataset¶
- class Dataset(decoder)¶
The
Dataset
object is the entry point for loading any data.A dataset manages all attached scenes and its sensor data. It takes care of calling the decoder when specific data is required and stores it in the PD SDK model classes and attributes.
- Parameters:
decoder (DatasetDecoderProtocol) –
- get_scene(scene_name)¶
Allows access to a scene by using its name.
- get_sensor_frames(sensor_names=None, frame_ids=None, scene_names=None, shuffle=False, concurrent=False, max_queue_size=8, max_workers=4, random_seed=42, only_cameras=False, only_radars=False, only_lidars=False)¶
Returns a generator that yields all sensor frames from the scenes with the given names. If None is passed for scenes_names all scenes in this dataset are used. Same for sensor_names and frame_ids. None means all available will be returned.
- Return type:
- Parameters:
- get_unordered_scene(scene_name)¶
Allows access to a sensor frame set by using its name.
- Parameters:
scene_name (
str
) – Name of sensor frame set to be returned- Return type:
UnorderedScene
- Returns:
Returns the SensorFrameSet object for a sensor frame set name.
- scene_pipeline(shuffle=False, concurrent=False, endless_loop=False, random_seed=42, scene_names=None, only_ordered_scenes=False, max_queue_size=8, max_workers=4)¶
Returns a generator that yields all scenes from the dataset with the given names. If None is passed for scenes_names all scenes in this dataset are returned.
- sensor_frame_pipeline(shuffle=False, concurrent=False, endless_loop=False, random_seed=42, scene_names=None, frame_ids=None, sensor_names=None, only_ordered_scenes=False, max_queue_size=8, max_workers=4, only_cameras=False, only_radars=False, only_lidars=False)¶
Returns a generator that yields tuples of SensorFrame, Frame, Scene from the dataset. It can also be configured to only return certain scenes, frames, sensors. By setting shuffle = True the data is returned a randomized order. By setting concurrent = True threads are used to speed up the generator.
You can use this as quick access to sensor frames to load images, annotations etc. and feed those to your models or to encode the sensor frames into another data format.
- Parameters:
shuffle (
bool
) – if = True the data is returned a randomized orderconcurrent (
bool
) – if = True threads are used to speed up the generatorendless_loop (
bool
) – whether to iterate over the scenes of the dataset in an endless looprandom_seed (
int
) – seed used for shuffling the datascene_names (
Optional
[List
[str
]]) – optional iterable of scene_names, if set, only frames from these scenes are yieldedframe_ids (
Union
[Dict
[str
,Iterable
[str
]],Iterable
[str
],None
]) –- optional, dict/iterable containing frame_ids::
if frame_ids is None, yield all frames from each scene
- if frame_ids is a dictionary, mapping scene_names to frame_ids:
if a scene_name is among the dictionary keys, the corresponding value defines which frames to yield from that scene
if a scene_name is not in the dictionary, yield all frames from that scene
if frame_ids is an iterable, yield the same set of frames from each scene
sensor_names (
Optional
[Iterable
[str
]]) – optional iterable of sensor_names, if set, only frames recorded with these sensors are yieldedonly_ordered_scenes (
bool
) – if = True, only yield frames from ordered scenesmax_queue_size (
int
) – maximum queue sizemax_workers (
int
) – max number of worker threadsonly_cameras (
bool
) – only yield camera framesonly_radars (
bool
) – only yield radar framesonly_lidars (
bool
) – only yield lidar frames
- Return type:
Generator
[Tuple
[SensorFrame
[Optional
[datetime
]],Frame
,Union
[UnorderedScene
,Scene
]],None
,None
]
- property available_annotation_identifiers: List[AnnotationIdentifier]¶
Returns a list of available annotation identifiers for the dataset.
- property available_annotation_types: List[Type[Annotation]]¶
Returns a list of available annotation types for the dataset.
- property camera_frames: Generator[CameraSensorFrame[datetime | None], None, None]¶
Returns a generator that yields all CameraSensorFrames of all the unordered scenes in this dataset.
- property camera_names: Set[str]¶
Returns the names of all camera sensors across all scenes in this dataset.
- property decoder_init_kwargs: Dict[str, Any]¶
Returns an optional path to a file or a folder where the dataset is stored.
- property format: str¶
Returns a str with the name of the dataset storage format (e.g. dgp, cityscapes, nuscenes).
- property lidar_frames: Generator[LidarSensorFrame[datetime | None], None, None]¶
Returns a generator that yields all LidarSensorFrames of all the unordered scenes in this dataset.
- property lidar_names: Set[str]¶
Returns the names of all lidar sensors across all scenes in this dataset.
- property metadata: DatasetMeta¶
Returns a list of scene names within the dataset.
- property radar_frames: Generator[RadarSensorFrame[datetime | None], None, None]¶
Returns a generator that yields all RadarSensorFrames of all the unordered scenes in this dataset.
- property radar_names: Set[str]¶
Returns the names of all Radar sensors across all scenes in this dataset.
- property scenes: Dict[str, Scene]¶
Returns a dictionary of
Scene
instances with the scene name as key.
- property sensor_frames: Generator[SensorFrame[datetime | None], None, None]¶
Returns a generator that yields all SensorFrames (Lidar and Camera) of all the unordered scenes in this dataset.