Skip to main content

Accessors for CARLA Panoramic Depth Detection Dataset, the dataset created as part of my thesis

Project description

CPDD-Dataset

This is the data access package for the CARLA panoramaic depth detection dataset, created and published as part of my thesis Dataset and Evaluation of Self-Supervised Learning for Panoramic Depth Estimation

The code used to generate the dataset is available at https://github.com/rnett/CARLASim.

Example

Set the environment variable CARLA_DOWNLOAD_LOCATION to wherever you want to keep the data.

Then, loading the data is as simple as:

import cpdd_dataset

train_configs = cpdd_dataset.config.load_csv("train_data.csv")
train_data = []

for config in train_configs:
    with config.cylindrical_data.download() as data:
        train_data.append({"color": data.color, "depth": data.depth})

You can make a csv file structured like:

city,rain,time,num_cars,num_peds,index
Town01,Clear,Noon,*,*,2

and load it in a single line: carla_dataset.data.load_csv("train.csv").

If you need camera intrinsics, CylindricalIntrinsics, SphericalIntrinsics, PinholeIntrinsics, and Pinhole90Intrinsics (see Utilities) classes are available in data, and provide the intrinsics values and matrix.

K = CylindricalIntrinsics().K

Structure

Data Location

To set the dataset download/loading location, you can use data.set_download_location, and get_download_location to get it. However, this is not advised. Instead, set the environment variable CARLA_DOWNLOAD_LOCATION. The above methods are simply wrappers around it. It is loaded using pathlib.Path, so use whatever path format your machine does.

Config

Each simulation run is represented by a config.Config object, which contains the simulation parameters (city, rain, number of pedestrians, etc) necessary to get the location of the data files. It provides utility methods and properties based on this, including getting data files for pinhole, cylindrical, spherical, and pose data, getting the local and remote locations, and downloading all of the data files.

Loading

A Config can be constructed manually or from the folder name (using Config.from_folder_name), but will probably be loaded from config.expand_wildcards. expand_wildcards fills None parameters will all valid values. You probably don't need to use it directly, as loader methods load_df, load_csv, and load_text methods are provided, as well as all.

Data Files

Data files can be gotten from Config objects, and represent a data file. They have download methods that accept a force parameter, an is_downloaded() method, and a data property. Non-pose data files also have an intrinsics property to get the associated intrinsics (described later). The data property opens and loads the file, returning a DataFile. DataFiles also work with Python's with blocks, and can be used like with file as data:. This has the advantage of automatically closing the file. The pinhole data file also exposes side methods top, bottom, etc. to get individual sides' groups within the pinhole data file, and a __getitem__ operator that takes a data.Side to do the same.

Data

The data objects gotten from data files expose the ndarray data for the training run. Pinhole data (gotten from pinhole data files) has properties to get the data for each side. Pinhole side data (gotten from side data files), cylindrical data, and spherical data have rgb and depth properties that return their respective data as numpy ndarrays. Both are of shape [batch, height, width, channels], where color images have 3 channels (RGB) and depth images have 1. Depth images are uint16 and have the depth in decimeters, while color images are the standard uint8. Pinhole images are 768x768, while cylindrical and spherical images are 2048x1024 (width x height).

Pose data objects have fields absolute_pose, relative_pose, and start_relative_pose. Relative pose is relative to the last pose value, while start relative pose is relative to the inital post of that simulation. Pose data is shape [batch, 6], where the 6 values are [X, Y, Z, x, y, z] where [X, Y, Z] is the position in meters, and [x, y, z] is the unit heading vector of the car.

Intrinsics

CylindricalIntrinsics, SphericalIntrinsics, PinholeIntrinsics, and Pinhole90Intrinsics (see Utilities) are available in data, and provide the intrinsics values and matrix. Each object has K, normalized_K, height, width, f_x, f_y, c_x, c_y, and fov (degrees) fields.

Utilities

A method data.crop_pinhole_to_90 is provided to crop the 100 degree FOV pinhole images into 90 degree FOV images of the same size. It uses cv2.getRectSubPix internally. The intrinsics for these images are provided by Pinhole90Intrinsics using the same format as other intrinsics.

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

cpdd-dataset-0.1.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cpdd_dataset-0.1.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file cpdd-dataset-0.1.3.tar.gz.

File metadata

  • Download URL: cpdd-dataset-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.5 Linux/4.19.128-microsoft-standard

File hashes

Hashes for cpdd-dataset-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4671c398019b5e7741fb69c375dae150b7f83339e4190050b0b7483a154a2543
MD5 18d79277ed46a6fb41f5cb58c3949254
BLAKE2b-256 e31c062d6a3385f95b923371b57e21e1e126ea14fa2f7e85eaa0fa1087141310

See more details on using hashes here.

File details

Details for the file cpdd_dataset-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cpdd_dataset-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.5 Linux/4.19.128-microsoft-standard

File hashes

Hashes for cpdd_dataset-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7f9639b7079cc95ea0c6a1d9d35fc48dca3baa97966d316fff3efdf5ec28e080
MD5 0d5edcb023db801a62d2a1c8a245531b
BLAKE2b-256 ce0392ce93d70f0b026ce14d1773e38046baead2a1b02c4288445bece61904c7

See more details on using hashes here.

Supported by

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