Skip to main content

A unified interface to various 3D driving datasets

Project description

Introduction

Waymo sample

Tri3D facilitates the utilization of 3D driving datasets by providing:

  • A common coordinate and data encoding convention.
  • A common API to read data form various datasets.
  • Fast non-sequential access to any sensor sample at any frame index.
  • A convenient access to geometric transformations between sensors and timestamps.
  • Plotting utilities.

As of now, Tri3D supports the following datasets: NuScenes, ONCE Dataset Semantic KITTI Waymo open dataset, Zenseact Open Dataset.

Conventions

The following conventions are adopted across all datasets :

  • An object position designates the center of its bounding box.
  • In the local coordinate system of an object, the x axis points forward, y leftward, and z updward.
  • Length, width and height are the dimensions of the object along x, y and z axes respectively.
  • In camera sensor coordinates, x points rightward, y points downward, z point forward.
  • In image coordinates, x is the pixel column index starting from the left, y is the pixel row index starting from the top, z is the depth in meters along the optical axis.
  • In lidar coordinates, x points in the same direction as the ego car, y points leftward, z points upward.

The differences with raw dataset conventions are documented in each datasets class.

Coordinates convention

Tri3D accounts for timestamps, delays and the movement of the ego car which carries the sensors. For examples, if the boxes of a given dataset are annotated at the timestamps of the LiDAR, retrieving the boxes relative to a camera sensor (ex: boxes(seq=0, frame=5, sensor="cam")) will interpolate the box trajectories at the timestamp of frame 5 for the camera, and it will also return the object poses relatively to the position of that camera at this timestamp.

Sensor timelines and track interpolation

Dataset API

All datasets implement a common interface which provides access to data samples such as:

  • Sensor frames.
  • Acquisition timestamps.
  • Sensor poses.
  • Camera images.
  • Lidar point clouds.
  • 3D box annotations.

Moreover, a powerful .alignment() function can compute the geometric transformation between any pair of frame and sensors coordinates. The tutorial notebook goes through most of these functions.

Tri3D datasets are somewhat low-level, ie. they do not enforce the notion of sweep or keyframe where a sample of each sensor around a timestamp is assembled in a tuple. Instead, datasets expose all available samples of each sensor indexed by a per-sensor frame index. Notably, some sensors may work at a higher frequency and contain more samples than others for a given recording.

When available, keyframes and timestamps are exposed so that coherent tuples of samples can be rebuilt easily. Moreover, geometric transformations and pose interpolation functions are provided to facilitate the creation of new keyframes.

Geometric transformations

Tri3D provides a small library which facilitates the creation and manipulation of typical 3D geometric transformations: translation, rotation, affine, camera projections.

Transformations have a shared interface which supports:

  • Batching: list of transformations can be grouped together, and broadcasting rules are supported.
  • Application to 3D points: applying the transformations to points, again, boadcasting rules are implemented.
  • Composition: it is possible to chain transformation together.
  • Inversion: the inverse of a transformation is readily available.

Object and sensor poses

In Tri3D, the position and orientation of objects (or sensors) in a coordinate system are stored as geometric transformation. For instance, the pose of a camera in a lidar coordinate system is formulated as the composition of the camera rotation and translation relative to the lidar. Coincidently, this is also the geometric transformation which takes points in the camera coordinate system and returns them in the lidar coordinate system.

For sensors, the sensor poses are accessible via the .poses() method. For object annotations, it is provided by the Box.transform attribute.

For example, if we have the pose of a box in lidar coordinates and the pose of the lidar in camera coordinates, then the position of a point 10 meters in front of that box is given by:

seq = 0
frame = 4

# retrieve poses
box = dataset.boxes(seq, frame, coords="lidar")[0]
box2lidar = box.transform
lidar2cam = dataset.poses(seq, sensor="camera", coords="lidar")[frame]

# compute the position of a point 10m in front of the box, in camera coordinates.
xyz = (lidar2cam @ box2lidar).apply([10., 0, 0])

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

tri3d-0.2.0.tar.gz (670.3 kB view details)

Uploaded Source

Built Distribution

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

tri3d-0.2.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

Details for the file tri3d-0.2.0.tar.gz.

File metadata

  • Download URL: tri3d-0.2.0.tar.gz
  • Upload date:
  • Size: 670.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for tri3d-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd2102d55f01e4b87658239f4bde74b6f4867d6c34e3ea17b7ed313d2fca24a6
MD5 5d7406117d6e5dbe0b070fe588225dce
BLAKE2b-256 072ff1668bbd5ba4b8c97567d2026e9e859ec7d8615c32c7202c3613866d9c84

See more details on using hashes here.

File details

Details for the file tri3d-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tri3d-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for tri3d-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e75ab9d00fdb632c5eec5f2a3c34a4a04f6536db8376de720e064e3d8231c99d
MD5 a87f77a6c9fe25d4bff1bcc3a23e9357
BLAKE2b-256 ebd0a078eaf70c3c7813276d47f7b3d9ce6c9ad5e9168c372ff62d24dc5b06dd

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