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: update FastLabel merger #178

Merged

Conversation

miursh
Copy link
Collaborator

@miursh miursh commented Dec 16, 2024

Description

This pull request includes several changes to the perception_dataset module and configuration files to improve the handling of labels, annotations, and dataset conversion processes. The most important changes include updating label configurations, modifying dataset conversion logic, and enhancing annotation handling.

Label Configuration Updates:

  • Added new labels such as other_vehicle, train, cone, curb, and many others to the config/label/object.yaml file.
  • Corrected and added variations of existing labels in config/label/surface.yaml.

Dataset Conversion Logic:

  • Updated camera index mappings and added a new make_t4_dataset_dir option in config/update_t4_with_fastlabel_sample.yaml.
  • Modified perception_dataset/convert.py to accommodate the new make_t4_dataset_dir option.
  • Enhanced perception_dataset/fastlabel_to_t4/fastlabel_2d_to_t4_converter.py by adding a label converter and handling instance IDs and category labels more effectively. [1] [2]

Annotation Handling:

  • Introduced a new method _convert_polygon_to_bbox for converting polygons to bounding boxes in perception_dataset/fastlabel_to_t4/fastlabel_2d_to_t4_converter.py.
  • Updated perception_dataset/t4_dataset/annotation_files_generator.py to handle automatic annotations and improve mask handling. [1] [2]

Class Modifications:

  • Added automatic_annotation attribute to the ObjectAnn class in perception_dataset/t4_dataset/classes/object_ann.py to distinguish between automatic and manual annotations. [1] [2]

These changes collectively enhance the flexibility and accuracy of the dataset processing and annotation systems.

@miursh miursh requested a review from ktro2828 December 16, 2024 06:25
@miursh miursh self-assigned this Dec 16, 2024
@miursh miursh changed the title Feat/update fastlabel/add path feat: update FastLabel merger Dec 16, 2024
Copy link
Contributor

@ktro2828 ktro2828 left a comment

Choose a reason for hiding this comment

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

@miursh Thank you for your PR. The code looks good to me.
Could you check the CI errors?

ERROR tests/t4_dataset/classes/test_sample_annotation.py::TestSampleAnnotationRecord::test_to_dict - TypeError: SampleAnnotationRecord.__init__() missing 1 required positional argument: 'automatic_annotation'

@miursh miursh requested a review from ktro2828 December 17, 2024 05:46
@miursh miursh merged commit c77c682 into feat/update-dataset-with-fastlabel Dec 17, 2024
5 checks passed
@miursh miursh deleted the feat/update_fastlabel/add_path branch December 17, 2024 17:14
ktro2828 added a commit that referenced this pull request Jan 2, 2025
…#172)

* feat: add T4 updater from FastLabel annotations

Signed-off-by: ktro2828 <[email protected]>

* fix: update conversion

Signed-off-by: ktro2828 <[email protected]>

* test: update tests

Signed-off-by: ktro2828 <[email protected]>

* feat: update FastLabel merger (#178)

* update configs

Signed-off-by: Shunsuke Miura <[email protected]>

* add label converter to FastLabel2dToT4Converter

Signed-off-by: Shunsuke Miura <[email protected]>

* fix bug in from_json of surface_ann

Signed-off-by: Shunsuke Miura <[email protected]>

* add automatic_annotation key to sample_annotation/object_ann/surface_ann

Signed-off-by: Shunsuke Miura <[email protected]>

* accelerate default object_mask generation

Signed-off-by: Shunsuke Miura <[email protected]>

* feat: improve T4 updater functionality and directory handling

Signed-off-by: Shunsuke Miura <[email protected]>

* feat: support polygon-to-bbox conversion and improve polygon-to-RLE conversion

* update object config

Signed-off-by: Shunsuke Miura <[email protected]>

* feat: update annotation loader

* feat: only convert to bbox for objects labels

Signed-off-by: Shunsuke Miura <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: handling automatic_annotation entry

Signed-off-by: Shunsuke Miura <[email protected]>

* fix: bug fix in rle_from_points

Signed-off-by: Shunsuke Miura <[email protected]>

* fix: add default value for automatic_annotation

Signed-off-by: Shunsuke Miura <[email protected]>

---------

Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: enhance surface category handling in AnnotationFilesGenerator and DeepenToT4Converter (#180)

* feat: enhance surface category handling in AnnotationFilesGenerator and DeepenToT4Converter

Signed-off-by: Shunsuke Miura <[email protected]>

* delete unnecessary import

Signed-off-by: Shunsuke Miura <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* refactor: parallelizate fl annotation processing  (#182)

* feat: enhance surface category handling in AnnotationFilesGenerator and DeepenToT4Converter

Signed-off-by: Shunsuke Miura <[email protected]>

# Conflicts:
#	perception_dataset/deepen/deepen_to_t4_converter.py
#	perception_dataset/fastlabel_to_t4/fastlabel_2d_to_t4_converter.py
#	perception_dataset/t4_dataset/annotation_files_generator.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* refactor: parallelizate fl annotation processing

Signed-off-by: Shunsuke Miura <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* remove duplicate key in object.yaml

Signed-off-by: Shunsuke Miura <[email protected]>

* feat(fastalbel_to_t4dataset): fix keyframe handling (#187)

* merge _load_annotation_jsons function to one

Signed-off-by: Shunsuke Miura <[email protected]>

* add default value for automatic_annotation

Signed-off-by: Shunsuke Miura <[email protected]>

* change to non-keyframe for no-annotation frame

Signed-off-by: Shunsuke Miura <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unused import

Signed-off-by: Shunsuke Miura <[email protected]>

---------

Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* change import path

Signed-off-by: Shunsuke Miura <[email protected]>

* Revert "refactor: parallelizate fl annotation processing  (#182)"

This reverts commit 3872c99.

* refactor: FastLabel annotation processing for parallel execution

Signed-off-by: Shunsuke Miura <[email protected]>

* supress no-3D annotation warning

Signed-off-by: Shunsuke Miura <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: ktro2828 <[email protected]>
Signed-off-by: Shunsuke Miura <[email protected]>
Co-authored-by: Shunsuke Miura <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Shunsuke Miura <[email protected]>
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