utilities and pytorch datasets for the KITTI Vision Benchmark Suite
Project description
Pytorch KITTI
This project aims to provide a simple yet effective way to scaffold and load the KITTI Vision Banchmark Dataset providing Datasets, a simple way to download them, metrics and transformations.
Installation
To install torch-kitti
$ pip install torch-kitti
Scaffolding datasets
To manually download the datasets 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 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
)
Develop
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
Tests use some environment variables to locate each dataset on the file system and perform specific tests on it. If they are not found tests are skipped.
- KITTI_SYNC_RECT_ROOT: root of the kitti sync rect dataset
- KITTI_DEPTH_COMPLETION_ROOT: root of the kitti depth completion dataset
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
Built Distribution
File details
Details for the file torch-kitti-0.1.0.tar.gz
.
File metadata
- Download URL: torch-kitti-0.1.0.tar.gz
- Upload date:
- Size: 17.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421a35055e83c7b52b56bce73644a732e23e41332308e2357f7afd755822d893 |
|
MD5 | f70dccb3725f8e117f3ad00b13de6e7e |
|
BLAKE2b-256 | cfd57250f0e4b7b32bb4dada4f960417bbbbfd76c6371e16675e0fab09c5af6a |
File details
Details for the file torch_kitti-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: torch_kitti-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2532ba4fbf70a8fc78283a6ffb239e9fd007cab512262029a20f026a3fe5e19 |
|
MD5 | 2a58f0053394db729ca0bb0368432dc6 |
|
BLAKE2b-256 | 2d4d5d9bacf398ce106d28abedf1186d513de6cdec4d2d33b51f5d32c937ac7d |