Tier4 class expects both following dataset directly structure with or without <VERSION> directory:
-
With
<VERSION>directory:data/tier4/ └── <VERSION> ...version number ├── annotation ...contains `*.json` files ├── data │ ├── CAM_BACK │ ├── CAM_BACK_LEFT │ ├── CAM_BACK_RIGHT │ ├── CAM_FRONT │ ├── CAM_FRONT_LEFT │ ├── CAM_FRONT_RIGHT │ ├── LIDAR_CONCAT │ └── ...Other sensor channels ...
-
Without
<VERSION>directory:data/tier4/ ├── annotation ...contains `*.json` files ├── data │ ├── CAM_BACK │ ├── CAM_BACK_LEFT │ ├── CAM_BACK_RIGHT │ ├── CAM_FRONT │ ├── CAM_FRONT_LEFT │ ├── CAM_FRONT_RIGHT │ ├── LIDAR_CONCAT │ └── ...Other sensor channels ...
You can initialize a Tier4 instance as follows:
>>> from t4_devkit import Tier4
>>> t4 = Tier4("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
72 sample
2390 sample_annotation
2524 sample_data
4 visibility
7 sensor
1 scene
1326 object_ann
0 surface_ann
0 keypoint
Done loading in 0.061 seconds.
======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.
>>> t4 = Tier4("data/tier4/", revision="2", verbose=True)>>> my_scene = t4.scene[0]sample is an annotated keyframe of a scene at a given timestamp.
>>> first_sample_token = my_scene.first_sample_token
>>> my_sample = t4.get("sample", first_sample_token)You can access the sample_data associated with this sample.
sample.data returns a dict object consists of {str: <SAMPLE_DATA_TOKEN (str)>}.
>>> my_sample.datasample_data is references to a family of data that is collected from specific sensors.
>>> sensor = "CAM_FRONT"
>>> t4.get("sample_data", my_sample.data[sensor])sample_annotation refers to any 3D bounding box in a corresponding sample.
All location data is given with respect to the global coordinate system.
You can access the list of sample_annotation tokens with sample.ann_3ds: list[str].
>>> my_annotation_token = my_sample.ann_3ds[0]
>>> t4.get("sample_annotation", my_annotation_token)Each annotated object is instanced to be tracked.
>>> t4.instanceA category is the object assignment of an annotation.
>>> t4.categoryAn attribute is a property of an instance that may change throughout different parts of a scene while category remains the same.
>>> t4.attributevisibility is defined as the fraction of pixels of a particular annotation that are visible over the 6 camera feeds.
>>> t4.visibility!!! WARNING
Expected level values in visibility are as below:
<!-- markdownlint-disable MD046 -->
```yaml
- full : No occlusion for the object.
- most : Object is occluded, but by less than 50%.
- partial : Object is occluded, but by more than 50%.
- none : Object is 90-100% occluded and no points/pixels are visible.
```
Following old formats are also supported but deprecated:
<!-- markdownlint-disable MD046 -->
```yaml
- v80-100 : full
- v60-80 : most
- v40-60 : partial
- v0-40 : none
```
If input level does not satisfy any above cases, `VisibilityLevel.UNAVAILABLE` will be assigned.
T4 dataset consists of several type of sensors.
The supported sensor modalities and channels are defined in t4_devkit/schema/tables/sensor.py.
>>> t4.sensorcalibrated_sensor consists of the definition of a calibration of a particular sensor based on a vehicle.
>>> t4.calibrated_sensorNote that the translation and rotation parameters are given with respect to the ego vehicle body frame.
ego_pose contains information about the translation and rotation of the ego vehicle, with respect to the global coordinate system.
>>> t4.ego_pose