Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cli/t4viz.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ t4viz instance <DATA_ROOT> <INSTANCE_TOKEN1> <INSTANCE_TOKEN2> ... [OPTIONS]

This command performs the same behavior with [`T4Devkit.render_pointcloud(...)`](../tutorials/render.md#rendering-pointcloud).

If a pointcloud `sample_data` record has `info_filename`, `t4viz pointcloud` loads the metainfo JSON automatically and uses `num_pts_feats` to parse extended point layouts. Without that file, it falls back to the standard 5-feature layout.
The point layout comes from the file (Parquet, BIN, PCD) or from `sensor.lidar.fields` (`.bin`; for 0.x datasets it is taken from the `.info` files when loading).

For options, run `t4viz pointcloud -h`.

Expand Down
6 changes: 4 additions & 2 deletions docs/tutorials/customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ from __future__ import annotations

from attrs import define, field

from t4_devkit.schema import SCHEMAS, SchemaName, SchemaBase
from t4_devkit.common import load_json
from t4_devkit.schema import SchemaBase
from t4_devkit.schema.v1 import SCHEMAS, SchemaName

__all__ = ["CustomAttribute"]

Expand All @@ -77,6 +77,8 @@ class CustomAttribute(SchemaBase):
description: str | None = field(default=None)
```

`T4Devkit` builds every table with the T4Dataset 1.0 registry (`t4_devkit.schema.v1.SCHEMAS`), for 1.0 datasets and for 0.x datasets (converted to 1.0 records when loading), so a custom class receives 1.0 records.

Note that `CustomAttribute` should be imported before instantiating `T4Devkit` class.
Then modify `__init__.py` in order to import it automatically:

Expand Down
45 changes: 19 additions & 26 deletions docs/tutorials/initialize.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,33 @@ You can initialize a `T4Devkit` instance as follows:

>>> t4 = T4Devkit("data/tier4/", verbose=True)
======
Loading T4 tables in `annotation`...
Reverse indexing...
Done reverse indexing in 0.007 seconds.
======
13 attribute
7 calibrated_sensor
8 category
2524 ego_pose
106 instance
1 log
1 map
Loading T4 tables...
72 sample
2390 sample_annotation
2524 sample_data
4 visibility
2524 ego_pose
7 sensor
1 scene
1 log
1 vehicle
1 map
0 vehicle_state
8 category
13 attribute
4 visibility
106 instance
2390 sample_annotation
1326 object_ann
0 surface_ann
0 keypoint
0 traffic_light
0 route
0 scenario
0 caption
Done loading in 0.061 seconds.
======
```

Both T4Dataset 1.0 datasets (with `manifest.json`) and 0.x datasets load, as 1.0 records: 0.x tables are converted when loading (see [Loading 0.x Datasets](../schema/v1/index.md#loading-0x-datasets)).

Note that if you doesn't specify `revision` parameter in construction, it searches the latest version of the dataset.
By specifying `revision=<VERSION>`, you can load the specific version of the dataset.

Expand All @@ -90,7 +93,7 @@ By specifying `revision=<VERSION>`, you can load the specific version of the dat

### `sample`

`sample` is an annotated keyframe of a scene at a given timestamp.
`sample` is one frame of a scene: the observations of all channels at that moment. Every frame is a sample; `sample.has_key_frame` marks the annotated ones (key frames), which carry the labels.

```python
>>> first_sample_token = my_scene.first_sample_token
Expand Down Expand Up @@ -184,22 +187,12 @@ An `attribute` is a property of an instance that may change throughout different
### `sensor`

T4 dataset consists of several type of sensors.
The supported sensor modalities and channels are defined in `t4_devkit/schema/tables/sensor.py`.
Each `sensor` row is one sensor with its calibration: `translation` and `rotation` with respect to the ego vehicle body frame, and a block for its modality (`camera` with intrinsics and image size, or `lidar` with its point fields).

```python
>>> t4.sensor
```

### `calibrated_sensor`

`calibrated_sensor` consists of the definition of a calibration of a particular sensor based on a vehicle.

```python
>>> t4.calibrated_sensor
```

Note that the `translation` and `rotation` parameters are given with respect to the ego vehicle body frame.

### `ego_pose`

`ego_pose` contains information about the `translation` and `rotation` of the ego vehicle, with respect to the global coordinate system.
Expand Down
12 changes: 7 additions & 5 deletions docs/tutorials/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ If you want to visualize annotation results, `T4Devkit` supports some rendering
>>> t4.render_pointcloud()
```

If `SampleData.info_filename` points to a pointcloud metainfo JSON file, `T4Devkit.render_pointcloud()` loads it automatically. This allows rendering pointclouds with extended per-point features such as `return_type` or `timestamp`. When no metainfo file is available, the standard 5-feature layout is assumed.
Frames are read by their own format: point layouts come from the file (Parquet, PCD) or from `sensor.lidar.fields` (`.bin`; for 0.x datasets it is taken from the `.info` files when loading), and camera frames from per-frame images or from the channel's AV1 video (`sample_data.frame_index`).

0.x LiDAR segmentation (`lidarseg`) is not rendered by `T4Devkit`.

![Render PointCloud GIF](../assets/render_pointcloud.gif)

Expand Down Expand Up @@ -129,11 +131,11 @@ from t4_devkit.dataclass import LidarPointCloud
from t4_devkit.viewer import PointCloudColorMode
# Point cloud channel name
>>> lidar_channel = "LIDAR_TOP"
# Load point cloud from file.
# Pass metainfo_filepath when the binary stores more than 5 float32 values per point.
# Load point cloud from file: one frame of a Parquet file, or a .pcd / .bin file.
# A .bin file has no header: pass its layout, e.g. from `sensor.lidar.fields`.
>>> pointcloud = LidarPointCloud.from_file(
... <PATH_TO_POINTCLOUD.pcd.bin>,
... metainfo_filepath=<PATH_TO_POINTCLOUD_INFO.json>,
... <PATH_TO_LIDAR.parquet>,
... frame_index=<FRAME_INDEX>,
... )
>>> color_mode = PointCloudColorMode.DISTANCE
>>> viewer.render_pointcloud(seconds, lidar_channel, pointcloud, color_mode)
Expand Down
Loading
Loading