-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
Fix ROOT
as relative path
#5129
Fix ROOT
as relative path
#5129
Conversation
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.
👋 Hello @maltelorbach, thank you for submitting a 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:
- ✅ Verify your PR is up-to-date with origin/master. If your PR is behind origin/master an automatic GitHub actions rebase may be attempted by including the /rebase command in a comment body, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
git checkout feature # <----- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
- ✅ Verify all Continuous Integration (CI) checks are passing.
- ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee
@maltelorbach thanks for the PR! I'm curious if there's any benefit to |
@maltelorbach PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
Ah, no, not really. It's my tendency to make imports as explicit as possible. But simply |
* use os.path.relpath instead of relative_to * use os.path.relpath instead of relative_to * Remove os.path from val.py * Remove os.path from train.py * Update detect.py import to os * Update export.py import to os Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Make it possible again to run yolo code from outside the yolo root directory.
Closes #5065
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Improvement in path handling across YOLOv5 scripts.
📊 Key Changes
os
module import for enhanced path operations.ROOT
directory is determined to be relative to the current working directory by usingos.path.relpath
instead of the previously usedPath.relative_to
.🎯 Purpose & Impact
os.path.relpath
, there is an increased likelihood of cross-platform compatibility, preventing potential path-related issues when running on different systems. 💻🌍This update is mainly behind-the-scenes and should be seamless to users, but it will contribute to making the software more stable and dependable.