module documentation

Utilities for working with datasets in KITTI format.

Copyright 2017-2025, Voxel51, Inc.

Class KITTIAnnotationWriter Class for writing annotations in KITTI detection format.
Class KITTIDetectionDatasetExporter Exporter that writes KITTI detection datasets to disk.
Class KITTIDetectionDatasetImporter Importer for KITTI detection datasets stored on disk.
Function download_kitti_detection_dataset Downloads the KITTI object detection dataset from the web.
Function download_kitti_multiview_dataset Downloads and prepares the multiview KITTI dataset.
Function load_kitti_detection_annotations Loads the KITTI detection annotations from the given TXT file.
Variable logger Undocumented
Variable o3d Undocumented
Function _convert_velodyne_to_pcd Undocumented
Function _do_conversion Undocumented
Function _download_and_unpack_kitti_zip Undocumented
Function _load_calibration_matrices Undocumented
Function _load_kitti_annotations Undocumented
Function _make_kitti_detection_row Undocumented
Function _normalize_3d_detections Undocumented
Function _parse_kitti_detection_row Undocumented
Function _prepare_kitti_split Undocumented
Function _proj_3d_to_right_camera Undocumented
Function _roty Undocumented
Function _swap_coordinates Undocumented
Function _write_fo3d_files Undocumented
Constant _CALIB Undocumented
Constant _LABELS Undocumented
Constant _LEFT_IMAGES Undocumented
Constant _RIGHT_IMAGES Undocumented
Constant _VELODYNE Undocumented
def download_kitti_detection_dataset(dataset_dir, splits=None, scratch_dir=None, overwrite=False, cleanup=False): (source)

Downloads the KITTI object detection dataset from the web.

The dataset will be organized on disk in as follows:

dataset_dir/
    train/
        data/
            000000.png
            000001.png
            ...
        labels/
            000000.txt
            000001.txt
            ...
    test/
        data/
            000000.png
            000001.png
            ...
Parameters
dataset_dirthe directory in which to construct the dataset
splits:Nonethe split or list of splits to download. Supported values are ("train", "test")
scratch_dir:Nonea scratch directory to use to download any necessary temporary files
overwrite:Falsewhether to redownload the zips if they already exist
cleanup:Falsewhether to delete the downloaded zips and scratch directory
def download_kitti_multiview_dataset(dataset_dir, splits=None, scratch_dir=None, overwrite=False, cleanup=False, num_workers=None): (source)

Downloads and prepares the multiview KITTI dataset.

The dataset will be organized on disk in as follows, with each split stored in :ref:`FiftyOneDataset format <FiftyOneDataset-import>`:

dataset_dir/
    train/
        labels/
            000000.txt
            000001.txt
            ...
        calib/
            000000.txt
            000001.txt
            ...
        left/
            000000.png
            000001.png
            ...
        right/
            000000.png
            000001.png
            ...
        velodyne/
            000000.bin
            000001.bin
            ...
        pcd/
            000000.pcd
            000001.pcd
            ...
        metadata.json
        samples.json
    test/
        ...
Parameters
dataset_dirthe directory in which to construct the dataset
splits:Nonethe split or list of splits to download. Supported values are ("train", "test")
scratch_dir:Nonea scratch directory to use to download any necessary temporary files
overwrite:Falsewhether to redownload/regenerate files if they already exist
cleanup:Falsewhether to delete the downloaded zips and scratch directory
num_workers:Nonea suggested number of processes to use when converting LiDAR to PCD
def load_kitti_detection_annotations(txt_path, frame_size, extra_attrs=True): (source)

Loads the KITTI detection annotations from the given TXT file.

See :ref:`this page <KITTIDetectionDataset-import>` for format details.

Parameters
txt_paththe path to the annotations TXT file
frame_sizethe (width, height) of the image
extra_attrs:True

whether to load extra annotation attributes onto the imported labels. Supported values are:

  • True: load all extra attributes found
  • False: do not load extra attributes
  • a name or list of names of specific attributes to load
Returns
a fiftyone.core.detections.Detections instance

Undocumented

Undocumented

def _convert_velodyne_to_pcd(velodyne_map, calib_map, pcd_dir, uuids, overwrite=False, num_workers=None): (source)

Undocumented

def _do_conversion(input): (source)

Undocumented

def _download_and_unpack_kitti_zip(data, dataset_dir, scratch_dir, splits, name, cleanup=False, overwrite=False): (source)

Undocumented

def _load_calibration_matrices(inpath): (source)

Undocumented

def _load_kitti_annotations(labels_path, frame_size): (source)

Undocumented

def _make_kitti_detection_row(detection, frame_size): (source)

Undocumented

def _normalize_3d_detections(detections): (source)

Undocumented

def _parse_kitti_detection_row(row, frame_size, extra_attrs): (source)

Undocumented

def _prepare_kitti_split(split_dir, overwrite=False, num_workers=None): (source)

Undocumented

def _proj_3d_to_right_camera(detections3d, calib, frame_size): (source)

Undocumented

def _roty(t): (source)

Undocumented

def _swap_coordinates(vec): (source)

Undocumented

def _write_fo3d_files(pcd_dir, fo3d_dir, overwrite=False, abs_paths=False): (source)

Undocumented

Undocumented

Value
{'url': 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_calib.zip',
 'contents': {'train': ['training', 'calib'], 'test': ['testing', 'calib']}}

Undocumented

Value
{'url': 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_label_2.zip'
,
 'contents': {'train': ['training', 'label_2']}}
_LEFT_IMAGES: dict = (source)

Undocumented

Value
{'url': 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_image_2.zip'
,
 'contents': {'train': ['training', 'image_2'], 'test': ['testing', 'image_2']}}
_RIGHT_IMAGES: dict = (source)

Undocumented

Value
{'url': 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_image_3.zip'
,
 'contents': {'train': ['training', 'image_3'], 'test': ['testing', 'image_3']}}
_VELODYNE: dict = (source)

Undocumented

Value
{'url': 'https://s3.eu-central-1.amazonaws.com/avg-kitti/data_object_velodyne.zi
p',
 'contents': {'train': ['training', 'velodyne'],
              'test': ['testing', 'velodyne']}}