Crate kitti_dataset

source ·
Expand description

Dataset loader, data parsers and writers for KITTI dataset.

§Dataset Loader

The dataset loader allows you to iterate through all kinds of data samples. Currently, ObjectDataset and TrackingDataset are supported.

The dataset layout for Object Detection Evaluation 2012 dataset is presented below for example. You can download appropriate zip files on the official site and extract them together to get the layout.

object/training
├── calib
├── image_2
├── image_3
├── label_2
└── velodyne

The usage of dataset API is demonstrated in the code.

use kitti_dataset::dataset::{object::SampleData, ObjectDataset};

let dataset = ObjectDataset::open("/path/to/kitti_dir/object/training")?;

// To get a specific frame
let frame = dataset.frame(0).unwrap();

// Iterate through all frames
for frame in dataset.frame_iter() {
    // Obtain a specific sample
    let sample = frame.key("image_2").unwrap();
    let SampleData::Image(image) = sample.data()? else {
        unreachable!();
    };

    // Iterate through all samples
    for sample in frame.sample_iter() {
        let data = sample.data()?;
    }
}

§Data Types

The section is a comprehensive list of available data types used in the KITTI dataset. Each type has one or more associated data loaders. For example, Label::vec_from_path() reads a list of labels in one .txt file. Please click into the type pages to discover available methods.

§Common

§Object Detection

  • object::Label - Object detection labels for Object Detection Evaluation

    Car 0.00 0 -1.58 587.01 173.33 614.12 200.12 1.65 1.67 3.64 -0.65 1.71 46.70 -1.59
    Cyclist 0.00 0 -2.46 665.45 160.00 717.93 217.99 1.72 0.47 1.65 2.45 1.35 22.10 -2.35
    Pedestrian 0.00 2 0.21 423.17 173.67 433.17 224.03 1.60 0.38 0.30 -5.87 1.63 23.11 -0.03
    
  • object::Calibration - 3D Object Detection Evaluation 2017 camera calibration matrices

    P0: 7.070493000000e+02 0.000000000000e+00 6.040814000000e+02 0.000000000000e+00 0.000000000000e+00 7.070493000000e+02 1.805066000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
    P1: 7.070493000000e+02 0.000000000000e+00 6.040814000000e+02 -3.797842000000e+02 0.000000000000e+00 7.070493000000e+02 1.805066000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
    P2: 7.070493000000e+02 0.000000000000e+00 6.040814000000e+02 4.575831000000e+01 0.000000000000e+00 7.070493000000e+02 1.805066000000e+02 -3.454157000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 4.981016000000e-03
    P3: 7.070493000000e+02 0.000000000000e+00 6.040814000000e+02 -3.341081000000e+02 0.000000000000e+00 7.070493000000e+02 1.805066000000e+02 2.330660000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 3.201153000000e-03
    R0_rect: 9.999128000000e-01 1.009263000000e-02 -8.511932000000e-03 -1.012729000000e-02 9.999406000000e-01 -4.037671000000e-03 8.470675000000e-03 4.123522000000e-03 9.999556000000e-01
    Tr_velo_to_cam: 6.927964000000e-03 -9.999722000000e-01 -2.757829000000e-03 -2.457729000000e-02 -1.162982000000e-03 2.749836000000e-03 -9.999955000000e-01 -6.127237000000e-02 9.999753000000e-01 6.931141000000e-03 -1.143899000000e-03 -3.321029000000e-01
    Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01
    

§Tracking

  • tracking::Label - Tracking labels for Object Tracking Evaluation

    0 40 Car 0 1 -0.846079 1129.142258 162.748587 1241.000000 223.323419 1.500000 1.610071 4.069631 16.204139 1.250580 19.092509 -0.150167
    1 0 Car 0 0 2.917216 0.000000 182.291562 220.536500 256.742509 1.491984 1.588650 4.106539 -11.652879 1.736447 16.864469 2.319742
    1 1 Car 0 0 2.886886 398.707515 170.768137 553.526667 222.702626 1.492172 1.666927 4.500000 -4.227687 1.449374 22.678314 2.704154
    1 2 Car 0 1 -1.134233 830.185677 160.148863 991.640373 251.980749 1.649293 1.669751 3.639134 6.203001 1.432202 14.799351 -0.745043
    2 0 Car 0 0 2.952925 0.000000 181.644428 160.336384 258.017227 1.491984 1.588650 4.106539 -12.245073 1.702574 15.415174 2.289919
    
  • tracking::Oxts - GPS/IMU data type for Object Tracking Evaluation

    49.011212804408 8.4228850417969 112.83492279053 0.022447 1e-05 -1.2219096732051 -3.3256321640686 1.1384311814592 3.5147680214713 0.037625160413037 -0.03878884255623 -0.29437452763793 0.037166856911681 9.9957015129717 -0.30581030960531 -0.19635662515203 9.9942128010936 -0.017332142869546 0.024792163815438 0.14511808479348 -0.017498934149631 0.021393359392165 0.14563031426063 0.49229361157748 0.068883960397178 4 10 4 4 0
    49.01120997371 8.4228865746799 112.84690093994 0.022857 0.004342 -1.2060766732051 -3.2881070007181 1.1667449071211 3.488638681917 0.054703935610776 0.011017553303551 -0.14011828216638 1.0142711526489 10.536284805105 -0.11933995891782 0.77095084470794 10.557191097922 -0.0044213078422351 0.047499861901847 0.13888384511551 -0.0041658784261557 0.044282418023417 0.13995351452114 0.49229361157748 0.068883960397178 4 10 4 4 0
    49.011207340729 8.4228879062526 112.86553955078 0.023136 0.014862 -1.1936236732051 -3.2411567408588 1.2346955705869 3.468542331508 0.020905692383421 0.087430817119982 -0.37599422874402 0.92464351685799 10.21491279541 -0.28214813630003 0.68838604691212 10.237591960914 -0.0011286126703085 0.10138706616598 0.12365328181544 8.8704809942824e-06 0.098502901229822 0.12597678052672 0.51960850647386 0.072917761896537 4 10 4 4 0
    

§Odometry

  • odometry::Calibration - Visual Odometry / SLAM Evaluation 2012 calibration files

    P0: 7.188560000000e+02 0.000000000000e+00 6.071928000000e+02 0.000000000000e+00 0.000000000000e+00 7.188560000000e+02 1.852157000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
    P1: 7.188560000000e+02 0.000000000000e+00 6.071928000000e+02 -3.861448000000e+02 0.000000000000e+00 7.188560000000e+02 1.852157000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00
    P2: 7.188560000000e+02 0.000000000000e+00 6.071928000000e+02 4.538225000000e+01 0.000000000000e+00 7.188560000000e+02 1.852157000000e+02 -1.130887000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 3.779761000000e-03
    P3: 7.188560000000e+02 0.000000000000e+00 6.071928000000e+02 -3.372877000000e+02 0.000000000000e+00 7.188560000000e+02 1.852157000000e+02 2.369057000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 4.915215000000e-03
    Tr: 4.276802385584e-04 -9.999672484946e-01 -8.084491683471e-03 -1.198459927713e-02 -7.210626507497e-03 8.081198471645e-03 -9.999413164504e-01 -5.403984729748e-02 9.999738645903e-01 4.859485810390e-04 -7.206933692422e-03 -2.921968648686e-01
    
  • odometry::Pose - Visual Odometry / SLAM Evaluation 2012 pose

    1.000000e+00 9.043680e-12 2.326809e-11 5.551115e-17 9.043683e-12 1.000000e+00 2.392370e-10 3.330669e-16 2.326810e-11 2.392370e-10 9.999999e-01 -4.440892e-16
    9.999978e-01 5.272628e-04 -2.066935e-03 -4.690294e-02 -5.296506e-04 9.999992e-01 -1.154865e-03 -2.839928e-02 2.066324e-03 1.155958e-03 9.999971e-01 8.586941e-01
    9.999910e-01 1.048972e-03 -4.131348e-03 -9.374345e-02 -1.058514e-03 9.999968e-01 -2.308104e-03 -5.676064e-02 4.128913e-03 2.312456e-03 9.999887e-01 1.716275e+00
    

Re-exports§

Modules§