ultralytics / ultralytics

Ultralytics YOLO11 πŸš€
https://docs.ultralytics.com
GNU Affero General Public License v3.0
36.32k stars 7k forks source link

Clarify relative path usage for `path` in dataset `yaml` #18953

Closed Y-T-G closed 1 week ago

Y-T-G commented 1 week ago

Closes https://github.com/ultralytics/ultralytics/issues/18950

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improved clarity in dataset configuration by specifying how relative paths behave. πŸ› οΈ

πŸ“Š Key Changes

🎯 Purpose & Impact

UltralyticsAssistant commented 1 week ago

πŸ‘‹ Hello @Y-T-G, thank you for submitting an ultralytics/ultralytics πŸš€ PR! To ensure a seamless integration of your work, please review the following checklist:

For additional details, be sure to review our Contributing Guide.

It looks like your PR addresses improvements to dataset configuration clarity for path fields in YAML examples for multiple use cases (detect, pose, and segment). This is a great enhancement for ensuring users better understand dataset path definitions. πŸš€βœ¨ Thank you for making it easier for the community to avoid confusion when setting up their datasets!

If there is anything specific you'd like feedback on, do not hesitate to mention it. This is an automated response, but rest assured, an Ultralytics engineer will also review and provide additional assistance soon. Thank you for contributing to Ultralytics! πŸ™Œ

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.12%. Comparing base (dc286c3) to head (e2b0fa5). Report is 4 commits behind head on main.

:exclamation: There is a different number of reports uploaded between BASE (dc286c3) and HEAD (e2b0fa5). Click for more details.

HEAD has 9 uploads less than BASE | Flag | BASE (dc286c3) | HEAD (e2b0fa5) | |------|------|------| |GPU|2|1| |Tests|10|5| |Benchmarks|6|3|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #18953 +/- ## ========================================== - Coverage 78.12% 73.12% -5.01% ========================================== Files 129 129 Lines 17486 17486 ========================================== - Hits 13661 12786 -875 - Misses 3825 4700 +875 ``` | [Flag](https://app.codecov.io/gh/ultralytics/ultralytics/pull/18953/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ultralytics) | Coverage Ξ” | | |---|---|---| | [Benchmarks](https://app.codecov.io/gh/ultralytics/ultralytics/pull/18953/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ultralytics) | `34.12% <ΓΈ> (ΓΈ)` | | | [GPU](https://app.codecov.io/gh/ultralytics/ultralytics/pull/18953/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ultralytics) | `37.95% <ΓΈ> (-2.71%)` | :arrow_down: | | [Tests](https://app.codecov.io/gh/ultralytics/ultralytics/pull/18953/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ultralytics) | `66.91% <ΓΈ> (-5.12%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ultralytics#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

glenn-jocher commented 1 week ago

@Y-T-G ah wait, is it not relative to the current working directory?

Y-T-G commented 1 week ago

@glenn-jocher It isn't. I guess the reason path: ../datasets/coco128 is used instead of path: ./coco128 is because that's used to initialize the settings with default datasets_dir.

https://github.com/ultralytics/ultralytics/blob/46d155aa3b97f0e3a3f211222d8f7efbea632f7a/ultralytics/utils/__init__.py#L1213

Y-T-G commented 1 week ago

Well. Seems like it still works even if you delete the settings and just use path: ./coco128. At least inside docker.

Y-T-G commented 1 week ago

~Or maybe it was intended originally to be relative to current directory and was changed. This will explain why Roboflow's YOLO dataset path: are always broken. Maybe because it works on the old implementation. They have Ultralytics 8.0.196 pinned, where it seems like path works relative to current directory.~

No, it's relative datasets_dir even for that version.

glenn-jocher commented 1 week ago

@Y-T-G ok yeah I see. Hmm, I think our dataset paths are pretty confusing.

The most common sense format we have is for i.e. the zipped datasets where each dataset has an internal YAML that defines relative paths (relative to the YAML), but we've got these in the repo too that add additional directory options, which ultimately makes for a lot of confusion.

I think incorrect dataset paths are our number one sentry issue.

UltralyticsAssistant commented 1 week ago

"✨ Merged with gratitude! ✨

Thank you, @Y-T-G and @glenn-jocher, for your thoughtful contributions to improving dataset clarity and user experience. This is the kind of detail that makes a big difference for our community!

As Albert Einstein once said, 'If you can't explain it simply, you don't understand it well enough.' Your PR embodies this philosophy by making the complexities of dataset configuration accessible and intuitive. πŸ§ πŸ’‘

Your work ensures users can navigate Ultralytics with confidence, and for that, we're all immensely appreciative. πŸš€πŸ‘ Keep up the amazing workβ€”you’re helping pave the way for an even better, user-friendly future!"