ultralytics 8.0.150 new Apple *.mlpackage export format (#4043)
Co-authored-by: MLBoy_DaisukeMajima <rockyshikoku@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Louis Lac <lac.louis5@gmail.com>
This commit is contained in:
parent
f5fc807fa7
commit
7dfdb63cde
22 changed files with 95 additions and 59 deletions
|
|
@ -265,20 +265,21 @@ def check_requirements(requirements=ROOT.parent / 'requirements.txt', exclude=()
|
|||
elif isinstance(requirements, str):
|
||||
requirements = [requirements]
|
||||
|
||||
s = '' # console string
|
||||
pkgs = []
|
||||
for r in requirements:
|
||||
r_stripped = r.split('/')[-1].replace('.git', '') # replace git+https://org/repo.git -> 'repo'
|
||||
try:
|
||||
pkg.require(r_stripped)
|
||||
except (pkg.VersionConflict, pkg.DistributionNotFound): # exception if requirements not met
|
||||
pkg.require(r_stripped) # exception if requirements not met
|
||||
except pkg.DistributionNotFound:
|
||||
try: # attempt to import (slower but more accurate)
|
||||
import importlib
|
||||
importlib.import_module(next(pkg.parse_requirements(r_stripped)).name)
|
||||
except ImportError:
|
||||
s += f'"{r}" '
|
||||
pkgs.append(r)
|
||||
except pkg.VersionConflict:
|
||||
pkgs.append(r)
|
||||
|
||||
s = ' '.join(f'"{x}"' for x in pkgs) # console string
|
||||
if s:
|
||||
if install and AUTOINSTALL: # check environment variable
|
||||
n = len(pkgs) # number of packages updates
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue