Skip to main content

utilities and pytorch datasets for the KITTI Vision Benchmark Suite

Project description

Pytorch KITTI

code style Python version PyPI version License

This project aims to provide a simple yet effective way to scaffold and load the KITTI Vision Banchmark Dataset providing

  • Datasets: Pytorch datasets to load each dataset

  • Scaffolding: to download the datasets

  • Metrics: common metrics used for each dataset

  • Transformations: utilities to manipulate samples

Installation

To install torch-kitti

$ pip install torch-kitti

Scaffolding datasets

To manually download the datasets the torch-kitti command line utility comes in handy:

$ torch_kitti download --help
usage: Torch Kitti download [-h]
                            {sync_rectified,depth_completion,depth_prediction}
                            path

positional arguments:
  {sync_rectified,depth_completion,depth_prediction}
                        name of the dataset to download
  path                  where scaffold the dataset

optional arguments:
  -h, --help            show this help message and exit

Actually available datasets are:

  • KITTI Depth Completion Dataset
  • KITTI Depth Prediction Dataset
  • KITTI Raw Sync+Rect Dataset

Loading Datasets

All datasets return dictionaries, utilities to manipulate them can be found in the torch_kitti.transforms module. Often each dataset provides options to include optional fields, for instance KittiDepthCompletionDataset usually provides simply the img, its sparse depth groundtruth gt and the sparse lidar hints lidar but using load_stereo=True stereo images will be included for each example.

from torchvision.transforms import Compose, RandomCrop, ToTensor

from torch_kitti.depth_completion import KittiDepthCompletionDataset
from torch_kitti.transforms import ApplyToFeatures

transform = ApplyToFeatures(
    Compose(
        [
            ToTensor(),
            RandomCrop([256, 512]),
        ]
    ),
    features=["img", "gt", "lidar"],
)

ds = KittiDepthCompletionDataset(
    "kitti_raw_sync_rect_root",
    "kitti_depth_completion_root",
    load_stereo=False,
    transform=transform,
    download=True,  # download if not found
)

Contributing

Developing setup

Download from kitti and cd in the folder then prepare a virtual environment (1), install dev and doc dependencies (2) and pre-commit (3).

$ git clone https://github.com/andreaconti/torch_kitti.git
$ cd torch_kitti
$ python3 -m virtualenv .venv && source .venv/bin/activate  # (1)
$ pip install .[dev, doc] # (2)
$ pre-commit install  # (3)
$ python3 setup.py develop
$ pytest

Feel free to open an issue on GitHub, fork the repository and submit a pull request to solve bugs, improve docs, add datasets and features. All new feature must be tested.

Disclaimer on KITTI Vision Benchmark Suite

This library is an utility that downloads and prepares the dataset. The KITTI Vision Benchmark Suite is not hosted by this project nor it's claimed that you have license to use the dataset, it is your responsibility to determine whether you have permission to use this dataset under its license. You can find more details here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch-kitti-0.2.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

torch_kitti-0.2.2-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file torch-kitti-0.2.2.tar.gz.

File metadata

  • Download URL: torch-kitti-0.2.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.5

File hashes

Hashes for torch-kitti-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4de2f7d45a51826176dd50e13612f769c50d5089c56185ed00f51b34ec3a1750
MD5 79c955526c90bb4da7ce82e8248e3611
BLAKE2b-256 5aa9778a09b0da62509a232b92be7ad504b59f9cbfd75b07612f7202bcacbe09

See more details on using hashes here.

File details

Details for the file torch_kitti-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: torch_kitti-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.5

File hashes

Hashes for torch_kitti-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 661cf97baea896576364590a1321d3be9ab13ed0b193d4c08a6165d2cc01ad69
MD5 0ace8bd029e91c89b10cd698e356390e
BLAKE2b-256 08820f955f5e5ef4c2f468e1fdef3c2206627de94191c44e421f7beebd0a0863

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page