Skip to content

Conversation

@CristiFati
Copy link
Contributor

@CristiFati CristiFati commented May 11, 2022

Sometimes, one would need to download the assets for a previously released version. Instead of doing it manually (either from browser, either changing the URL), it's possible to make use of attempt_download's newly added parameter (and a small change in data/scripts/download_weights.sh):

The release can be specified in 2 ways:

  • attempt_download(..., release='v5.0')

  • attempt_download(..., release='tags/v5.0')

Of course, current existing behavior is the default.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced attempt_download function to support specific GitHub release assets.

📊 Key Changes

  • attempt_download now accepts an additional release parameter to specify the GitHub release version.
  • Default behavior targets the latest release if no other is specified.
  • Constructed the URL to fetch from GitHub API now includes the specified release.
  • Added a check to prepend "tags/" to the release string if it is not the latest and does not already start with "tags/".

🎯 Purpose & Impact

  • Users can now download model weights or other assets from a specific release, providing greater control over the version of files used.
  • Enhances reproducibility and flexibility for developers and researchers who need specific versions of code or data.
  • Reduces potential issues from always pulling the latest version which might not be compatible with certain codebases or project requirements.

@glenn-jocher glenn-jocher merged commit 4870064 into ultralytics:master May 11, 2022
@glenn-jocher glenn-jocher changed the title Ability to dowlnoad older assets Ability to download older assets May 11, 2022
@glenn-jocher
Copy link
Member

@CristiFati PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐

@CristiFati CristiFati deleted the cfati_dev00 branch May 11, 2022 20:52
tdhooghe pushed a commit to tdhooghe/yolov5 that referenced this pull request Jun 10, 2022
* Ability to dowlnoad older assets

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cleanup

* Cleanup2

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
* Ability to dowlnoad older assets

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cleanup

* Cleanup2

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Ability to dowlnoad older assets

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Cleanup

* Cleanup2

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <[email protected]>
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.

2 participants