-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Improve mask import and export performance #8049
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 in the Changes
Sequence Diagram(s)sequenceDiagram
participant DatasetManager
participant MaskConverter
DatasetManager->>MaskConverter: cvat_rle_to_dm_rle(mask)
MaskConverter-->>DatasetManager: Converted RLE data
DatasetManager->>MaskConverter: dm_mask_to_cvat_rle(mask)
MaskConverter-->>DatasetManager: Converted mask points
Poem
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 Configration 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: 0
Outside diff range and nitpick comments (1)
cvat/apps/dataset_manager/formats/transformations.py (1)
90-101
: Consider adding a comment to credit the original source of the RLE computation method adapted from StackOverflow.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- cvat/apps/dataset_manager/bindings.py (3 hunks)
- cvat/apps/dataset_manager/formats/transformations.py (3 hunks)
Additional comments not posted (5)
cvat/apps/dataset_manager/formats/transformations.py (2)
40-64
: The methodcvat_rle_to_dm_rle
is well-implemented and uses efficient libraries for RLE operations.
67-88
: The methoddm_mask_to_cvat_rle
is correctly implemented and ensures RLE consistency.cvat/apps/dataset_manager/bindings.py (3)
41-41
: Update import statement to reflect renamed class and new methods.This correctly updates the import to use the new
MaskConverter
class instead of the oldCVATRleToCOCORle
.
1818-1818
: Ensure correct usage of the renamed method for mask conversion.The method
cvat_rle_to_dm_rle
is correctly being used here as part of theMaskConverter
class to handle mask conversion, aligning with the changes made in the transformation module.
2044-2044
: Ensure correct usage of the renamed method for mask conversion.The method
dm_mask_to_cvat_rle
is correctly being used here as part of theMaskConverter
class to handle the reverse conversion of masks, which is consistent with the modifications described in the PR.
Co-authored-by: Roman Donchenko <roman@cvat.ai>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8049 +/- ##
==========================================
Coverage ? 83.63%
==========================================
Files ? 383
Lines ? 40440
Branches ? 3815
==========================================
Hits ? 33820
Misses ? 6620
Partials ? 0
|
Quality Gate passedIssues Measures |
Motivation and context
CVAT uses correct, but suboptimal algorithms for RLE enconding and decoding. This results in bad import and export performance for masks. Quality reports are also affected, as they use the same code to represent datasets.
In tests, the average speedup is:
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
rle
method to theMaskConverter
class, enhancing functionality for mask-related operations.