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

Explicit default arguments #28

Merged
merged 1 commit into from
Aug 30, 2022
Merged

Explicit default arguments #28

merged 1 commit into from
Aug 30, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Aug 30, 2022

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvement to JSON to YOLO conversion script with better configurability for COCO datasets.

πŸ“Š Key Changes

  • Refactoring of the convert_coco_json function parameters to use named arguments for clarity.
  • Introduction of two explicit parameters: use_segments and cls91to80.

🎯 Purpose & Impact

  • 🎨 Enhances readability and maintainability of the code by using more descriptive function arguments.
  • 🧩 Offers users the option to specify whether to use segmentation data (use_segments) and whether to convert COCO's original 91 classes to the 80 commonly used classes (cls91to80).
  • πŸ”„ Potentially affects users who utilize the script for COCO dataset conversions, providing more tailored usage aligned with their specific needs.

@glenn-jocher glenn-jocher self-assigned this Aug 30, 2022
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 30, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.03%.

Quality metrics Before After Change
Complexity 26.34 😞 26.34 😞 0.00
Method Length 216.12 β›” 216.62 β›” 0.50 πŸ‘Ž
Working memory 17.08 β›” 17.08 β›” 0.00
Quality 25.70% 😞 25.67% 😞 -0.03% πŸ‘Ž
Other metrics Before After Change
Lines 324 326 2
Changed files Quality Before Quality After Quality Change
general_json2yolo.py 25.70% 😞 25.67% 😞 -0.03% πŸ‘Ž

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
general_json2yolo.py convert_ath_json 46 β›” 523 β›” 22 β›” 7.40% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
general_json2yolo.py convert_vott_json 21 😞 413 β›” 20 β›” 20.02% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
general_json2yolo.py merge_multi_segment 25 😞 259 β›” 11 😞 31.77% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
general_json2yolo.py convert_infolks_json 9 πŸ™‚ 362 β›” 14 😞 36.25% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • πŸ™‚ good
  • 😞 poor
  • β›” very poor

The πŸ‘ and πŸ‘Ž indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@glenn-jocher glenn-jocher merged commit e6b0a25 into master Aug 30, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch August 30, 2022 15:16
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.

1 participant