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

increment_path() robustness improvements #7628

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Apr 28, 2022

Improved robustness to filename edge cases like data/images/zidane.23.jpg that currently fail. May resolve #7432

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Optimization of the path incrementation method in the Ultralytics YOLOv5 codebase.

📊 Key Changes

  • Introduced a new way to increment file/directory names to prevent conflicts.
  • Deprecated the older method that used globbing and regular expression matching.
  • The new method iteratively checks for the existence of a file/directory and only breaks the loop when a non-existent path is found.

🎯 Purpose & Impact

  • Efficiency Improvement: The replaced method is more straightforward and possibly more efficient as it avoids globbing and regex matching over potentially large directories.
  • Code Readability: The new code is more readable, and might reduce the potential for bugs that are difficult to trace.
  • User Experience: Users may expect slightly faster execution when dealing with file operations involving numerous similarly named files, especially in directories with a large number of files.

Improved robustness to filename edge cases like `data/images/zidane.23.jpg` that currently fail. May resolve #7432
@glenn-jocher glenn-jocher self-assigned this Apr 28, 2022
@glenn-jocher glenn-jocher merged commit 1a3ecb8 into master Apr 28, 2022
@glenn-jocher glenn-jocher deleted the update/increment branch April 28, 2022 21:00
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
Improved robustness to filename edge cases like `data/images/zidane.23.jpg` that currently fail. May resolve ultralytics#7432
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
Improved robustness to filename edge cases like `data/images/zidane.23.jpg` that currently fail. May resolve ultralytics#7432
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Improved robustness to filename edge cases like `data/images/zidane.23.jpg` that currently fail. May resolve ultralytics#7432
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.

yolov5 --save-crop unable to save every detection
1 participant