diff --git a/pyproject.toml b/pyproject.toml index fa91d79..3ef7a1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ dependencies = [ "thop>=0.1.1", # FLOPs computation "pandas>=1.1.4", "seaborn>=0.11.0", # plotting + "packaging", # general utilities "ultralytics>=8.2.64" ] diff --git a/requirements.txt b/requirements.txt index af57089..715b36d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,6 +39,7 @@ seaborn>=0.11.0 # openvino-dev>=2023.0 # OpenVINO export # Deploy ---------------------------------------------------------------------- +packaging # Migration of deprecated pkg_resources packages setuptools>=70.0.0 # Snyk vulnerability fix # tritonclient[all]~=2.24.0 diff --git a/utils/general.py b/utils/general.py index efc0112..67839eb 100644 --- a/utils/general.py +++ b/utils/general.py @@ -28,8 +28,8 @@ from zipfile import ZipFile, is_zipfile import cv2 import numpy as np +import packaging import pandas as pd -import pkg_resources as pkg import torch import torchvision import yaml @@ -425,7 +425,7 @@ def check_python(minimum="3.8.0"): def check_version(current="0.0.0", minimum="0.0.0", name="version ", pinned=False, hard=False, verbose=False): """Checks if the current version meets the minimum required version, exits or warns based on parameters.""" - current, minimum = (pkg.parse_version(x) for x in (current, minimum)) + current, minimum = (packaging.version.parse(x) for x in (current, minimum)) result = (current == minimum) if pinned else (current >= minimum) # bool s = f"WARNING ⚠️ {name}{minimum} is required by YOLOv5, but {name}{current} is currently installed" # string if hard: