-
Notifications
You must be signed in to change notification settings - Fork 150
Format conversions #1919
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
base: develop
Are you sure you want to change the base?
Format conversions #1919
Conversation
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive format conversion support for various data types in the experimental converters module. It introduces enum-based format specifications for better type safety and implements converters to transform between different coordinate formats and image color spaces.
- Introduces enum classes for format specifications (BBoxFormat, RotatedBBoxFormat, ImageFormat, PolygonFormat)
- Adds new format converters for bbox, rotated bbox, polygon, and image data transformations
- Updates existing code to use enum-based format specifications instead of string literals
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/experimental/test_converters.py | Adds comprehensive test coverage for new format converters and updates existing tests to use enum formats |
| src/datumaro/experimental/fields.py | Introduces format enum classes and updates field classes to use enum-based format specifications |
| src/datumaro/experimental/converters.py | Implements new format converter classes and updates existing converters to use enum formats |
| .github/workflows/docs_stable.yml | Adds --system flag to pip install command for documentation builds |
| .github/workflows/docs_latest.yml | Adds --system flag to pip install command for documentation builds |
Comments suppressed due to low confidence (1)
tests/unit/experimental/test_converters.py:1
- These removed imports (
mask_callable_field,mask_field,rotated_bbox_field) appear to be unused after the refactoring. If they are indeed unused throughout the file, this cleanup is appropriate.
"""
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
into albert/bbox-formats Signed-off-by: Albert van Houten <[email protected]> # Conflicts: # src/datumaro/experimental/converters.py # src/datumaro/experimental/fields.py
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
Signed-off-by: Albert van Houten <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Albert van Houten <[email protected]>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Jort Bergfeld <[email protected]>
Signed-off-by: Jort Bergfeld <[email protected]>
Signed-off-by: Jort Bergfeld <[email protected]>
Signed-off-by: Jort Bergfeld <[email protected]>
into albert/bbox-formats Signed-off-by: Albert van Houten <[email protected]> # Conflicts: # tests/unit/experimental/test_converters.py
This pull request introduces a new set of strongly-typed enumerations for coordinate and image formats, and refactors the codebase to use these enums instead of string literals for format specification. It also adds new converters for bounding box, rotated bounding box, and polygon format conversions, improving type safety and extensibility in the annotation conversion pipeline. Additionally, there are minor improvements to documentation and workflow commands.
Core type system improvements:
BBoxFormat,RotatedBBoxFormat,PolygonFormat, andImageFormatinfields.py, replacing string-based format specifications for bounding boxes, rotated bounding boxes, polygons, and images. All relevant field classes and helper functions have been updated to use these enums, improving type safety and code clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]New format converters:
BBoxFormatConverter,RotatedBBoxFormatConverter, andPolygonFormatConverterclasses toconverters.py, enabling conversion between different formats (e.g., x1y1x2y2 ↔ xywh for bounding boxes, radians ↔ degrees for rotated bounding boxes, and (x, y) ↔ (y, x) for polygons). These converters leverage the new enums and provide robust, type-checked format transformations. [1] [2] [3] [4]Documentation and developer experience:
converter_registry.pyfor clarity regarding converter application.Workflow enhancements:
docs_latest.yml,docs_stable.yml) to useuv pip install ... --systemfor installing requirements, ensuring correct environment handling. [1] [2]Checklist