Update check_requirements()
ROOT
#11557
Merged
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.
🤖 Generated by Copilot at f677495
Summary
📁,🐛,🧹,
This pull request updates the
check_requirements
function calls in various scripts to use theROOT / 'requirements.txt'
file from the project root directory, instead of the defaultrequirements.txt
file in the current working directory. This ensures that the correct dependencies are installed for different tasks and datasets. It also fixes some minor syntax and code style issues in the function arguments.Walkthrough
check_requirements
function calls to useROOT / 'requirements.txt'
file as source of required packages inclassify/predict.py
,classify/val.py
,detect.py
,hubconf.py
,segment/predict.py
, andval.py
scripts (link, link, link, link, link, link)ROOT
variable fromutils.general
inhubconf.py
script to construct relative path torequirements.txt
file (link)check_requirements
function call indata/Objects365.yaml
file by using string argument instead of tuple argument (link)requirements
keyword argument incheck_requirements
function call insegment/val.py
script (link)🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Refinement of dependency checks across YOLOv5 scripts to enforce consistency with project requirements.
📊 Key Changes
check_requirements
function call to referencerequirements.txt
directly in various Python files (predict.py
,val.py
,detect.py
,hubconf.py
, etc.).check_requirements
from a tuple to a single string where applicable (e.g.,('pycocotools>=2.0',)
to'pycocotools>=2.0'
).🎯 Purpose & Impact
requirements.txt
file, the project ensures consistency in the environment setup for all users.requirements.txt
propagate to all scripts, eliminating the need to update each script individually for requirements changes.