vis4d.data.datasets.nuscenes

NuScenes multi-sensor video dataset.

Classes

NuScenes(data_root[, keys_to_load, sensors, ...])

NuScenes multi-sensor video dataset.

class NuScenes(data_root, keys_to_load=('images', 'boxes2d', 'boxes3d'), sensors=('LIDAR_TOP', 'CAM_FRONT', 'CAM_FRONT_LEFT', 'CAM_FRONT_RIGHT', 'CAM_BACK', 'CAM_BACK_LEFT', 'CAM_BACK_RIGHT'), version='v1.0-trainval', split='train', max_sweeps=10, skip_empty_samples=False, point_based_filter=False, distance_based_filter=False, cache_as_binary=False, cached_file_path=None, **kwargs)[source]

NuScenes multi-sensor video dataset.

This dataset loads both LiDAR and camera inputs from the NuScenes dataset into the Vis4D expected format for multi-sensor, video datasets.

Creates an instance of the class.

Parameters:
  • data_root (str) – Root directory of nuscenes data in original format.

  • keys_to_load (tuple[str, ...]) – Keys to load from the dataset. Defaults to (K.images, K.boxes2d, K.boxes3d).

  • sensors (Sequence[str, ...]) – Which sensor to load. Defaults to (“LIDAR_TOP”, “CAM_FRONT”, “CAM_FRONT_LEFT”, “CAM_FRONT_RIGHT”, “CAM_BACK”, “CAM_BACK_LEFT”, “CAM_BACK_RIGHT”).

  • version (str, optional) – Version of the data to load. Defaults to “v1.0-trainval”.

  • split (str, optional) – Split of the data to load. Defaults to “train”.

  • max_sweeps (int, optional) – Maximum number of sweeps for a single key-frame to load. Defaults to 10.

  • skip_empty_samples (bool, optional) – Whether to skip samples without annotations. Defaults to False.

  • point_based_filter (bool, optional) – Whether to filter out samples based on the number of points in the point cloud. Defaults to False.

  • distance_based_filter (bool, optional) – Whether to filter out samples based on the distance of the object from the ego vehicle. Defaults to False.

  • cache_as_binary (bool) – Whether to cache the dataset as binary. Default: False.

  • cached_file_path (str | None) – Path to a cached file. If cached file exist then it will load it instead of generating the data mapping. Default: None.

__getitem__(idx)[source]

Get single sample.

Parameters:

idx (int) – Index of sample.

Returns:

sample at index in Vis4D input format.

Return type:

DictData

__len__()[source]

Length.

Return type:

int

__repr__()[source]

Concise representation of the dataset.

Return type:

str

get_cat_ids(idx)[source]

Return the samples.

Return type:

list[int]