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

Add URL file download to check_file() #3330

Merged
merged 3 commits into from
May 26, 2021
Merged

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented May 25, 2021

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced file check utility with download support for remote URLs.

πŸ“Š Key Changes

  • πŸ“ Extended check_file function to handle remote URLs by downloading the file if it doesn't exist locally.
  • πŸ› οΈ Added an assertion to ensure the downloaded file exists and is non-empty, to prevent downstream errors.
  • ✨ Improved error messages, clarifying when a file isn't found or when multiple files match the search pattern.

🎯 Purpose & Impact

  • πŸš€ Users can now reference files hosted remotely with ease, as they will be automatically downloaded when not present locally.
  • β˜‘οΈ Robustness of file handling is improved, with checks to avoid incomplete downloads leading to smoother user experiences.
  • πŸ“ Clearer error messages aid users in debugging path issues, reducing confusion and support requests.

@glenn-jocher
Copy link
Member Author

/rebase

@glenn-jocher
Copy link
Member Author

glenn-jocher commented May 26, 2021

@kalenmike this PR now implements direct from URL commands for --data, --cfg, --hyp training arguments, i.e.:

python train.py --data https://url/to/data.yaml

I'll handle --weights later today.

@glenn-jocher
Copy link
Member Author

Example usage / test result:
Screenshot 2021-05-26 at 15 49 39

@glenn-jocher glenn-jocher self-assigned this May 26, 2021
@glenn-jocher glenn-jocher merged commit 2435bfe into master May 26, 2021
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-2 branch May 26, 2021 13:51
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
* Add URL file download to check_file()

* cleanup

* pathlib bug fix

(cherry picked from commit 2435bfe)
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Add URL file download to check_file()

* cleanup

* pathlib bug fix
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.

None yet

1 participant