Update hand refiner (#219)

This commit is contained in:
Chenlei Hu
2024-02-13 05:59:44 +00:00
committed by GitHub
parent 3cdae09639
commit 4777898a0c

View File

@@ -63,13 +63,18 @@ def install_requirements(req_file):
)
def try_install_from_wheel(pkg_name: str, wheel_url: str):
if get_installed_version(pkg_name) is not None:
return
def try_install_from_wheel(pkg_name: str, wheel_url: str, version: Optional[str] = None):
current_version = get_installed_version(pkg_name)
if current_version is not None:
# No version requirement.
if version is None:
return
# Version requirement already satisfied.
if comparable_version(current_version) >= comparable_version(version):
return
try:
launch.run_pip(
f"install {wheel_url}",
f"install -U {wheel_url}",
f"forge_legacy_preprocessor requirement: {pkg_name}",
)
except Exception as e:
@@ -132,8 +137,9 @@ try_install_from_wheel(
"handrefinerportable",
wheel_url=os.environ.get(
"HANDREFINER_WHEEL",
"https://github.com/huchenlei/HandRefinerPortable/releases/download/v1.0.0/handrefinerportable-2024.1.18.0-py2.py3-none-any.whl",
"https://github.com/huchenlei/HandRefinerPortable/releases/download/v1.0.1/handrefinerportable-2024.2.12.0-py2.py3-none-any.whl",
),
version="2024.2.12.0",
)
try_install_from_wheel(
"depth_anything",