Fix ROOT as relative path#5129
Merged
glenn-jocher merged 7 commits intoultralytics:masterfrom Oct 11, 2021
Merged
Conversation
Contributor
There was a problem hiding this comment.
👋 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
Member
|
@maltelorbach thanks for the PR! I'm curious if there's any benefit to |
Member
|
@maltelorbach PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐ |
Merged
Contributor
Author
Ah, no, not really. It's my tendency to make imports as explicit as possible. But simply |
BjarneKuehl
pushed a commit
to fhkiel-mlaip/yolov5
that referenced
this pull request
Aug 26, 2022
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
osmodule import for enhanced path operations.ROOTdirectory is determined to be relative to the current working directory by usingos.path.relpathinstead 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.