chore: sync table definition with tier4_perception_dataset#185
Conversation
…kit into chore/sync_table_definition
There was a problem hiding this comment.
Pull Request Overview
This PR syncs table definitions with tier4_perception_dataset by introducing autolabeling metadata support and category-specific annotation field extensions. The changes enable tracking of ML model information for automatically generated annotations and support specialized fields for traffic light annotations.
- Added
AutolabelModeltype andautolabel_metadatafields to support tracking of autolabeling model information - Extended
Categoryschema withhas_orientationandhas_numberflags to control presence of specialized annotation fields - Added
orientationandnumberfields toObjectAnnfor traffic light arrow directions and numeric displays
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
t4_devkit/schema/tables/autolabel_metadata.py |
New module defining AutolabelModel dataclass for autolabeling metadata |
t4_devkit/schema/tables/__init__.py |
Added import for new autolabel metadata module |
t4_devkit/schema/tables/category.py |
Added has_orientation and has_number optional boolean fields |
t4_devkit/schema/tables/object_ann.py |
Added orientation, number, and autolabel_metadata fields with validation |
t4_devkit/schema/tables/sample_annotation.py |
Added autolabel_metadata field with validation logic |
t4_devkit/schema/tables/sample_data.py |
Added autolabel_metadata field with validation logic |
t4_devkit/schema/tables/surface_ann.py |
Added autolabel_metadata field with validation logic |
docs/schema/table.md |
Updated documentation to describe all new fields and AutolabelModel type |
tests/schema/conftest.py |
Updated test fixtures to include new fields with sample data |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ktro2828
left a comment
There was a problem hiding this comment.
@SamratThapa120 Thank you for following up! I left some comments please take a look.
| converter=lambda x: [ | ||
| AutolabelModel(**model) if isinstance(model, dict) else model for model in x | ||
| ] | ||
| if isinstance(x, list) | ||
| else x, |
There was a problem hiding this comment.
[WANT] Can you define this conversion function in annotation_metadata.py like below?
This function can be reused in the other schema field conversions.
def to_autolabel_model(x) -> AutolabelModel:
// ...|
[MEMO] I encountered errors while running ───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: t4_devkit/schema/tables/autolabel_metadata.py
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
27 │ default=None,
28 │ validator=validators.optional(
29 ~ │ (validators.instance_of(float), validators.ge(0.0), validators.le(1.0))
30 │ ),
31 │ )
... │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 8< ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
48 │
49 │
50 ~ │ @define(slots=False)
51 │ class AutolabelMixin:
52 │ """Mixin class for schema tables that use autolabel metadata with automatic annotation."""
53 │
54 ~ │ automatic_annotation: bool = field(
55 ~ │ default=False, validator=validators.instance_of(bool), kw_only=True
56 ~ │ )
57 │ autolabel_metadata: list[AutolabelModel] | None = field(
58 │ default=None,
... │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 8< ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
61 │ validators.deep_iterable(validators.instance_of(AutolabelModel))
62 │ ),
63 + │ kw_only=True,
64 │ )
65 │
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: tests/schema/conftest.py
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
63 │ "description": "",
64 │ "index": None,
65 ~ │ "has_number": False,
66 ~ │ "has_orientation": False,
67 │ }
68 │
... │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 8< ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
181 │ "next": "7b0ae1dae7531b7b917f403cb22259e6",
182 │ "prev": "",
183 ~ │ "automatic_annotation": True,
184 │ "autolabel_metadata": [{"name": "centerpoint_v1.2", "score": 0.95, "uncertainty": 0.1}],
185 │ }
... │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 8< ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
321 │ "bbox": [0, 408.0529355733727, 1920, 728.1832152454293],
322 │ "mask": {"size": [1920, 1280], "counts": "UFBQWzI='"},
323 ~ │ "automatic_annotation": True,
324 │ "autolabel_metadata": [
325 │ {"name": "yolo_v8_segmentation", "score": 0.87, "uncertainty": 0.15},
───────┴──────────────────────────────────────────────────────────────────────────────────
What are
|
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
|
@ktro2828 Thank you for your detailed comments. I have fixed the tests. |
|
@ktro2828 I have added tests for |
87cf840 to
f6bd11a
Compare
This pull request introduces changes to sync the table definitions in tier4_perception_dataset with t4-devkit. Only remaining sync is for the lidarseg table, which is addressed in PR #184
Autolabeling metadata support
AutolabelModeltype to the schema, including its definition in documentation (docs/schema/table.md) and implementation in code (t4_devkit/schema/tables/autolabel_metadata.py). This type tracks model name, score, and uncertainty for autolabeling. [1] [2] [3]autolabel_metadatafield toSampleAnnotation,SampleData,ObjectAnn, andSurfaceAnntables, allowing storage of autolabeling model information whereverautomatic_annotationis used. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Category and annotation field extensions
has_orientationandhas_numberfields to theCategoryschema and documentation, enabling category-level control over the presence oforientationandnumberfields in object annotations. [1] [2]orientationandnumberfields to theObjectAnnschema and documentation, supporting specialized annotation for traffic light arrows and numeric traffic lights, gated by category settings. [1] [2] [3]Documentation updates
docs/schema/table.mdto document all new fields, types, and their usage, including detailed explanations forAutolabelModel,autolabel_metadata,has_orientation,has_number,orientation, andnumber. [1] [2] [3] [4] [5] [6] [7]Codebase integration
autolabel_metadatamodule in the schema package and importedAutolabelModelinto all affected schema tables to enable type checking and conversion. [1] [2] [3] [4] [5]Validation and conversion logic
AutolabelModelinstances and optional fields. [1] [2] [3] [4] [5]