Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(t4-devkit): remove SensorChannel and replace it by str #132

Merged
merged 4 commits into from
Jul 26, 2024

Conversation

ktro2828
Copy link
Contributor

Description

In order to support any kind of sensor channels, this PR removed SensorChannel class and replaced it by str.

How to review

Please confirm whether all variables that referred to SensorChannel previously are replaced by str.

How to test

Please check if tutorials work.

test data

test command

# Example
from t4_devkit import Tier4

t4 = Tier4("annotation", <DATA_ROOT>)
t4.render_scene(t4.scene[0].token)

Reference

Notes for reviewer

ktro2828 added 3 commits July 18, 2024 10:26
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
@ktro2828 ktro2828 requested a review from Shin-kyoto July 18, 2024 06:17
Copy link
Contributor

@Shin-kyoto Shin-kyoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I confirmed that this PR works well. I checked with this dataset(TIER IV INTERNAL LINK)


Before this PR(commit hash: 8e46d0a6ee8968c9803317e7f3f7198b73d501f4)

Loading T4 tables in `annotation`...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/tier4.py", line 123, in __init__
    self.sensor: list[Sensor] = self.__load_table__(SchemaName.SENSOR)
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/tier4.py", line 155, in __load_table__
    return build_schema(schema, filepath)
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/schema/builder.py", line 24, in build_schema
    return SCHEMAS.build_from_json(name, filepath)
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/schema/tables/registry.py", line 77, in build_from_json
    return schema.from_json(filepath)
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/schema/tables/base.py", line 37, in from_json
    return [cls.from_dict(data) for data in records]
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/schema/tables/base.py", line 37, in <listcomp>
    return [cls.from_dict(data) for data in records]
  File "/tier4_perception_dataset_tools/pcd_type_updater/lib/tier4_perception_dataset/t4-devkit/t4_devkit/schema/tables/sensor.py", line 109, in from_dict
    channel = SensorChannel(data["channel"])
  File "/usr/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: 'CAM_FRONT_LOWER' is not a valid SensorChannel

After this PR

Loading T4 tables in `annotation`...
Reverse indexing...
Done reverse indexing in 0.003 seconds.
======
8 attribute
8 calibrated_sensor
3 category
1601 ego_pose
51 instance
1 log
1 map
40 sample
1502 sample_annotation
1568 sample_data
3 visibility
8 sensor
1 scene
0 object_ann
0 surface_ann
0 keypoint
Done loading in 0.040 seconds.
======

NOTE: This PR introduces the following CONS:

  • It becomes difficult to clearly manage sensors; any type of name will be permissible.

  • This PR disables clearer information management such as quick modality checking. e.g. this code

  • Managed as strings, which can lead to unintended inclusions and, being non-const, there's a possibility of modifications in code.

@ktro2828 ktro2828 enabled auto-merge (squash) July 26, 2024 02:05
@ktro2828 ktro2828 merged commit 2698f8f into main Jul 26, 2024
5 checks passed
@ktro2828 ktro2828 deleted the feat/t4-devkit/sensor-channel branch July 26, 2024 02:13
nanoshimarobot pushed a commit to nanoshimarobot/tier4_perception_dataset that referenced this pull request Nov 24, 2024
…4#132)

* feat: remove `SensorChannel` and replace it with `str`

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* docs: update documents

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

* fix: invalid method access

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>

---------

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants