-
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
YOLOv8 classification format #8475
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 changes introduce support for the "YOLOv8 Classification" format across various components of the CVAT application. The Changes
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 using PR comments)
Other keywords and placeholders
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: 0
🧹 Outside diff range and nitpick comments (8)
site/content/en/docs/manual/advanced/formats/format-yolov8-classification.md (3)
8-11
: LGTM: Useful references provided. Consider adding brief descriptions.The links to the format specification and dataset examples are valuable. To enhance user understanding, consider adding a brief description of what each link contains.
Example improvement:
- [Format specification](https://docs.ultralytics.com/datasets/classify/) - Detailed YOLOv8 Classification format guidelines - [Dataset examples](https://github.com/cvat-ai/datumaro/tree/develop/tests/assets/yolo_dataset/yolov8_classification) - Sample datasets in YOLOv8 Classification format
13-20
: LGTM: Export details are clear. Consider adding import information.The export details are well-explained, clearly stating what is and isn't supported.
Consider adding a brief section about import support, if applicable. For example:
## YOLOv8 Classification import - Supported annotations: Tags. - Attributes: Not supported. - Tracks: Not supported.This would provide a complete picture of both export and import capabilities for this format.
21-39
: LGTM: Archive structure is well-documented. Consider adding a note about multiple labels.The archive structure is clearly explained and visualized. The inclusion of information about the optional
labels.json
file is helpful.Consider adding a note to clarify how images with multiple labels are handled. For example:
Note: If an image has multiple labels, it will be duplicated and placed in each corresponding label directory.This would help users understand how the export handles more complex annotation scenarios.
cvat/apps/dataset_manager/formats/yolo.py (2)
105-107
: LGTM! Consider adding a brief docstring.The implementation of
_export_yolov8_classification
is consistent with other YOLO export functions in the file. It correctly uses the@exporter
decorator and calls_export_common
with the appropriate format name.Consider adding a brief docstring to explain the purpose of this function and any specific details about the YOLOv8 classification format. For example:
@exporter(name='YOLOv8 Classification', ext='ZIP', version='1.0') def _export_yolov8_classification(*args, **kwargs): """ Export annotations in YOLOv8 classification format. This format is used for image classification tasks in YOLOv8. """ _export_common(*args, format_name='yolov8_classification', **kwargs)
144-146
: LGTM! Consider adding a brief docstring.The implementation of
_import_yolov8_classification
is consistent with other YOLO import functions in the file. It correctly uses the@importer
decorator and calls_import_common
with the appropriate format name.Consider adding a brief docstring to explain the purpose of this function and any specific details about importing the YOLOv8 classification format. For example:
@importer(name='YOLOv8 Classification', ext="ZIP", version="1.0") def _import_yolov8_classification(*args, **kwargs): """ Import annotations from YOLOv8 classification format. This function handles the import of image classification data used in YOLOv8. """ _import_common(*args, format_name="yolov8_classification", **kwargs)site/content/en/docs/manual/advanced/formats/_index.md (1)
53-53
: LGTM! Consider adding a link to the YOLOv8 Classification documentation.The new entry for YOLOv8 Classification 1.0 is correctly formatted and consistent with other entries in the table. It provides appropriate information for a classification format.
Consider adding a link to the YOLOv8 Classification documentation in the format name, similar to other entries in the table. This would improve consistency and user experience. You can do this by wrapping the format name in a link, like this:
| [YOLOv8 Classification 1.0](format-yolov8-classification) | .jpg | Classification | YOLOv8 | Tags | No attributes | Not supported |README.md (1)
179-182
: LGTM! Consider adding a changelog entry.The addition of the YOLOv8 Classification format to the supported annotation formats table is consistent with the existing entries and enhances the comprehensiveness of the list. The provided link is correct and the import/export support is clearly indicated.
Consider adding an entry to the changelog (if not already done) to highlight this new supported format for users upgrading or looking for recent changes.
cvat/apps/dataset_manager/tests/test_formats.py (1)
384-384
: LGTM: YOLOv8 Classification format added to empty image export testThe addition of ('YOLOv8 Classification 1.0', 'yolov8_classification') to the test cases for empty image export is appropriate and consistent with other format tests.
Consider adding a comment explaining the purpose of this test case, similar to the comments for other formats (e.g., "# ('KITTI 1.0', 'kitti') format does not support empty annotations"). This would improve code readability and maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (9)
- README.md (1 hunks)
- cvat/apps/dataset_manager/formats/yolo.py (2 hunks)
- cvat/apps/dataset_manager/tests/assets/annotations.json (1 hunks)
- cvat/apps/dataset_manager/tests/test_formats.py (3 hunks)
- cvat/apps/dataset_manager/tests/test_rest_api_formats.py (5 hunks)
- cvat/requirements/base.in (1 hunks)
- cvat/requirements/base.txt (1 hunks)
- site/content/en/docs/manual/advanced/formats/_index.md (2 hunks)
- site/content/en/docs/manual/advanced/formats/format-yolov8-classification.md (1 hunks)
🔇 Additional comments (14)
site/content/en/docs/manual/advanced/formats/format-yolov8-classification.md (2)
1-6
: LGTM: Metadata section is well-structured and informative.The metadata section provides clear and accurate information about the document's content and purpose.
1-39
: Overall, excellent documentation for YOLOv8 Classification format.This new file provides clear, concise, and well-structured documentation for the YOLOv8 Classification format in CVAT. It covers the essential aspects of export functionality and archive structure, making it easier for users to understand and work with this format.
The suggested improvements are minor and aim to enhance clarity and completeness:
- Adding brief descriptions to the reference links
- Including import information if applicable
- Clarifying how images with multiple labels are handled in the export
Great job on creating this comprehensive documentation!
cvat/requirements/base.in (1)
15-15
: Verify the purpose and impact of updating the datumaro package.The commit hash for the
datumaro
package has been updated. This change might introduce new features, bug fixes, or changes in behavior that could affect the project.
- Could you please clarify if this update is related to supporting the YOLOv8 classification format?
- Have you tested this new version of
datumaro
with the rest of the project to ensure compatibility?To ensure that this change doesn't introduce any unexpected issues, please run the following commands:
These commands will help identify any significant changes, particularly those related to YOLOv8 or classification, as well as any updates in documentation that might be relevant to this PR.
✅ Verification successful
Update to datumaro package introduces YOLOv8 Classification support.
The change in commit
e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577
adds support for the YOLOv8 Classification format, aligning with the PR's objective.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any breaking changes or new features in the datumaro package # Test: Compare the difference between the old and new versions git clone https://github.com/cvat-ai/datumaro.git cd datumaro git diff 393cb666529067060ff57e30cb6e448669274f35 e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577 -- '*.py' # Test: Check if there are any changes related to YOLOv8 or classification git diff 393cb666529067060ff57e30cb6e448669274f35 e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577 | grep -i "yolo\|classif" # Test: Look for any updates in the package's documentation or changelog git diff 393cb666529067060ff57e30cb6e448669274f35 e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577 -- '*.md' 'docs/*'Length of output: 46359
cvat/apps/dataset_manager/formats/yolo.py (1)
105-107
: Verify testing and documentation for YOLOv8 classification support.The additions for YOLOv8 classification support are well-integrated and consistent with the existing code structure. However, to ensure the robustness of this new feature:
- Confirm that appropriate unit tests have been added or updated to cover the new YOLOv8 classification format.
- Ensure that the project's documentation (e.g., user guides, API docs) has been updated to reflect the addition of YOLOv8 classification support.
- Verify that any relevant examples or tutorials have been created or updated to demonstrate the use of this new format.
To help verify the testing coverage, you can run the following command:
This will help identify if there are any test files that include references to YOLOv8 classification. If no results are found, it might indicate a need for additional test coverage.
Also applies to: 144-146
✅ Verification successful
Testing and documentation for YOLOv8 Classification support are properly implemented.
The additions for YOLOv8 Classification support include comprehensive unit tests and necessary documentation updates, ensuring the feature is well-supported and documented.
Unit Tests:
cvat/apps/dataset_manager/tests/test_formats.py
cvat/apps/dataset_manager/tests/test_rest_api_formats.py
Documentation:
README.md
site/content/en/docs/manual/advanced/formats/format-yolov8-classification.md
site/content/en/docs/manual/advanced/formats/_index.md
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for test files related to YOLO formats rg -t python --glob '**/test_*.py' -i 'yolo.*classification'Length of output: 93
Script:
#!/bin/bash # Search for test files related to YOLOv8 classification rg --glob 'test_*.py' -i 'yolo.*classification'Length of output: 893
Script:
#!/bin/bash # Search for documentation updates related to YOLOv8 classification rg --glob '*.md' -i 'YOLOv8 Classification'Length of output: 1028
cvat/requirements/base.txt (1)
59-59
: Verify the impact of the datumaro package update.The update of the
datumaro
package to a newer commit (e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577
) is noted. This change likely introduces new features, bug fixes, or improvements that could be relevant to supporting the YOLOv8 classification format as mentioned in the PR objectives.To ensure this update aligns with the PR objectives and doesn't introduce any unintended consequences, please:
- Review the changes between the old commit (
393cb666529067060ff57e30cb6e448669274f35
) and the new one (e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577
) in the datumaro repository.- Verify that these changes support the YOLOv8 classification format or are otherwise beneficial to the project.
- Run the test suite to ensure no regressions are introduced by this update.
Would you like me to fetch and summarize the changes between these two commits in the datumaro repository?
✅ Verification successful
Verified: Update to datumaro package adds support for YOLOv8 Classification format.
The changes to the
datumaro
package successfully introduce support for the YOLOv8 Classification format. This includes necessary converters, extractors, importers, and comprehensive documentation updates. Additionally, new tests have been added to ensure the functionality and reliability of the new features.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Fetch the commit messages and changed files between the two versions git clone https://github.com/cvat-ai/datumaro.git cd datumaro git log --oneline --name-status 393cb666529067060ff57e30cb6e448669274f35..e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577Length of output: 2277
Script:
#!/bin/bash # Navigate to the existing datumaro repository cd datumaro # Fetch the latest changes to ensure all commits are available git fetch origin # Show the differences between the two specified commits git diff 393cb666529067060ff57e30cb6e448669274f35 e1f3c7eb62ebf76ce881b1a7143de5fb3e7d9577Length of output: 38509
cvat/apps/dataset_manager/tests/test_formats.py (3)
293-293
: LGTM: YOLOv8 Classification format added to export formatsThe addition of 'YOLOv8 Classification 1.0' to the list of export formats is consistent with the PR objective and follows the existing naming convention.
330-330
: LGTM: YOLOv8 Classification format added to import formatsThe addition of 'YOLOv8 Classification 1.0' to the list of import formats is consistent with the PR objective and maintains consistency with the export formats.
293-293
: Summary: YOLOv8 Classification format successfully integrated into test suiteThe changes in this file successfully add support for the YOLOv8 Classification format to the test suite. The new format has been added to:
- Export formats query test
- Import formats query test
- Empty images export test
These additions ensure that the new format is properly tested for various scenarios, maintaining consistency with other supported formats.
Also applies to: 330-330, 384-384
cvat/apps/dataset_manager/tests/assets/annotations.json (1)
979-992
: LGTM: New YOLOv8 Classification format added correctlyThe new "YOLOv8 Classification 1.0" entry has been added successfully to the annotations.json file. The structure is consistent with other entries in the file, including:
- Correct version number (0)
- A tags array with a single tag object
- Empty shapes and tracks arrays
This addition aligns well with the PR objective of supporting the YOLOv8 classification format in CVAT.
cvat/apps/dataset_manager/tests/test_rest_api_formats.py (5)
412-413
: LGTM: Addition of YOLOv8 Classification formatThe addition of "YOLOv8 Classification 1.0" to the list of formats is appropriate for this test method. It ensures that the new format will be tested for dumping and uploading annotations with shape objects.
521-522
: LGTM: YOLOv8 Classification format added to track object testThe addition of "YOLOv8 Classification 1.0" to the list of formats in the
test_api_v2_dump_annotations_with_objects_type_is_track
method is appropriate. This ensures that the new format will be tested for dumping annotations with track objects.
963-964
: LGTM: YOLOv8 Classification format included in annotation rewriting testThe addition of "YOLOv8 Classification 1.0" to the list of formats in the
test_api_v2_rewriting_annotations
method is appropriate. This ensures that the new format will be tested for the ability to rewrite annotations correctly.
1081-1082
: LGTM: YOLOv8 Classification format added to Datumaro dump and upload testThe addition of "YOLOv8 Classification 1.0" to the list of formats in the
test_api_v2_tasks_annotations_dump_and_upload_with_datumaro
method is appropriate. This ensures that the new format will be tested for compatibility with Datumaro dump and upload operations.
2113-2114
: LGTM: YOLOv8 Classification format included in dataset export/import testThe addition of "YOLOv8 Classification 1.0" to the list of formats in the
test_api_v2_export_import_dataset
method is appropriate. This ensures that the new format will be tested for dataset export and import operations.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8475 +/- ##
===========================================
- Coverage 74.09% 74.09% -0.01%
===========================================
Files 396 396
Lines 42768 42774 +6
Branches 3897 3897
===========================================
+ Hits 31691 31694 +3
- Misses 11077 11080 +3
|
site/content/en/docs/manual/advanced/formats/format-yolov8-classification.md
Outdated
Show resolved
Hide resolved
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.
SonarCloud Code Analysis is failing, could you make it green?
made it green |
✔️ All checks completed successfully |
Quality Gate passedIssues Measures |
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.
LGTM as well
Motivation and context
Supporting YOLOv8 classification format
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
Documentation