-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Optimize annotations import #8226
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent changes enhance the processing and type consistency of shape annotations within the CVAT dataset management system. By refining the way points are handled—specifically converting them to floats—they improve the clarity and maintainability of the code. Additionally, alterations in initialization logic for task and job annotations streamline the import process, potentially optimizing performance while ensuring reliable data handling. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Importer
participant AnnotationDB
User->>Importer: Start Annotation Import
Importer->>AnnotationDB: Fetch Annotations
AnnotationDB-->>Importer: Return Annotations
Importer->>Importer: Convert Points to Floats
Importer->>User: Complete Import
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- cvat/apps/dataset_manager/bindings.py (2 hunks)
- cvat/apps/dataset_manager/formats/cvat.py (2 hunks)
- cvat/apps/dataset_manager/task.py (2 hunks)
Additional comments not posted (9)
cvat/apps/dataset_manager/task.py (2)
Line range hint
686-686
:
Verify the initialization logic forTaskAnnotation
.The removal of
init_from_db()
suggests a change in howTaskAnnotation
objects are initialized. Ensure that the necessary data is being handled correctly elsewhere.
Line range hint
699-699
:
Verify the initialization logic forJobAnnotation
.The removal of
init_from_db()
suggests a change in howJobAnnotation
objects are initialized. Ensure that the necessary data is being handled correctly elsewhere.cvat/apps/dataset_manager/formats/cvat.py (7)
1226-1229
: Ensure consistent float conversion forbox
shape points.The conversion of
xtl
,ytl
,xbr
, andybr
to floats ensures type consistency.
1231-1234
: Ensure consistent float conversion forellipse
shape points.The conversion of
cx
,cy
,rx
, andry
to floats ensures type consistency.
1236-1252
: Ensure consistent float conversion forcuboid
shape points.The conversion of
xtl1
,ytl1
,xbl1
,ybl1
,xtr1
,ytr1
,xbr1
,ybr1
,xtl2
,ytl2
,xbl2
,ybl2
,xtr2
,ytr2
,xbr2
, andybr2
to floats ensures type consistency.
1285-1288
: Ensure consistent float conversion forbox
shape points.The conversion of
xtl
,ytl
,xbr
, andybr
to floats ensures type consistency.
1290-1293
: Ensure consistent float conversion forellipse
shape points.The conversion of
cx
,cy
,rx
, andry
to floats ensures type consistency.
1295-1299
: Ensure consistent float conversion formask
shape points.The conversion of
rle
,left
,top
,width
, andheight
to floats ensures type consistency.
1301-1317
: Ensure consistent float conversion forcuboid
shape points.The conversion of
xtl1
,ytl1
,xbl1
,ybl1
,xtr1
,ytr1
,xbr1
,ybr1
,xtl2
,ytl2
,xbl2
,ybl2
,xtr2
,ytr2
,xbr2
, andybr2
to floats ensures type consistency.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8226 +/- ##
===========================================
+ Coverage 83.30% 83.33% +0.02%
===========================================
Files 388 388
Lines 41352 41353 +1
Branches 3856 3856
===========================================
+ Hits 34450 34462 +12
+ Misses 6902 6891 -11
|
<!-- Raise an issue to propose your change (https://github.com/cvat-ai/cvat/issues). It helps to avoid duplication of efforts from multiple independent contributors. Discuss your ideas with maintainers to be sure that changes will be approved and merged. Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/). --> <!-- Provide a general summary of your changes in the Title above --> ### Motivation and context Decided to split changes in this PR: #8223 1. Annotations import (#8226) 2. Array fields optimization (#8229) 3. Logging function optimization (this PR) ### How has this been tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> ### Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. If an item isn't applicable for some reason, then ~~explicitly strikethrough~~ the whole line. If you don't do that, GitHub will show incorrect progress for the pull request. If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I submit my changes into the `develop` branch - [ ] I have created a changelog fragment <!-- see top comment in CHANGELOG.md --> - [ ] I have updated the documentation accordingly - [ ] I have added tests to cover my changes - [ ] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) - [ ] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved data integrity by ensuring annotations change handling occurs every time an item is deleted. - **New Features** - Enhanced data filtering logic for annotations, allowing for more efficient processing without unnecessary deep copies. - Introduced a new function for streamlined filtering of track data, simplifying data management. - **Refactor** - Consolidated data filtering into reusable functions for better maintainability and clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Quality Gate passedIssues Measures |
<!-- Raise an issue to propose your change (https://github.com/cvat-ai/cvat/issues). It helps to avoid duplication of efforts from multiple independent contributors. Discuss your ideas with maintainers to be sure that changes will be approved and merged. Read the [Contribution guide](https://docs.cvat.ai/docs/contributing/). --> <!-- Provide a general summary of your changes in the Title above --> ### Motivation and context Decided to split changes in this PR: #8223 1. Annotations import (#8226) 2. Array fields optimization (this PR) 3. Logging function optimization (#8228) ### How has this been tested? <!-- Please describe in detail how you tested your changes. Include details of your testing environment, and the tests you ran to see how your change affects other areas of the code, etc. --> ### Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. If an item isn't applicable for some reason, then ~~explicitly strikethrough~~ the whole line. If you don't do that, GitHub will show incorrect progress for the pull request. If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I submit my changes into the `develop` branch - [ ] I have created a changelog fragment <!-- see top comment in CHANGELOG.md --> - [ ] I have updated the documentation accordingly - [ ] I have added tests to cover my changes - [ ] I have linked related issues (see [GitHub docs]( https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword)) - [ ] I have increased versions of npm packages if it is necessary ([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning), [cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning), [cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and [cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning)) ### License - [x] I submit _my code changes_ under the same [MIT License]( https://github.com/cvat-ai/cvat/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced the `LazyList` class for efficient, on-demand parsing of list elements from strings. - Added support for custom transformations through a converter function. - Enhanced lazy evaluation with new decorators for improved performance on list operations. - **Tests** - Implemented a comprehensive test suite for the `LazyList` class, validating core functionalities and ensuring robustness. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Motivation and context
Decided to split changes in this PR: #8223
How has this been tested?
Checklist
develop
branch(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
Bug Fixes