refine: simplify onnx provider detection flow

Agent-Logs-Url: https://github.com/IBB666/IBB_POSE/sessions/4a0abc4a-e2ce-442d-9e6f-7710a104d736

Co-authored-by: kukulu00 <1170651+kukulu00@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-22 06:10:44 +00:00
committed by GitHub
co-authored by kukulu00
parent 0dd2dab1d2
commit 8e8554e0b3
+4 -4
View File
@@ -162,8 +162,10 @@ YOLO_DET_URL = f"https://github.com/ultralytics/assets/releases/download/v8.3.
DWPOSE_HF_REPO = "yzd-v/DWPose"
DWPOSE_POSE_FILE = "dw-ll_ucoco_384.onnx"
DWPOSE_DET_FILE = "yolox_l.onnx"
# Direct resolve URLs keep install-time dependencies minimal. If the upstream Hub
# layout changes, users can still place the same filenames into IBB_POSE_MODEL_DIR.
# Direct resolve URLs with HuggingFace's `?download=true` parameter keep
# install-time dependencies minimal by avoiding the `huggingface_hub` SDK. If the
# upstream Hub layout changes, users can still place the same filenames into
# IBB_POSE_MODEL_DIR.
DWPOSE_MODEL_URLS = {
DWPOSE_POSE_FILE: f"https://huggingface.co/{DWPOSE_HF_REPO}/resolve/main/{DWPOSE_POSE_FILE}?download=true",
DWPOSE_DET_FILE: f"https://huggingface.co/{DWPOSE_HF_REPO}/resolve/main/{DWPOSE_DET_FILE}?download=true",
@@ -730,8 +732,6 @@ class IBBLoadPoseModel:
raise RuntimeError("CUDAExecutionProvider unavailable")
except Exception:
print("IBB_POSE: ONNX CUDAExecutionProvider unavailable – using CPU.")
else:
providers = cuda_prov
print(f"IBB_POSE: Loading DWPose ONNX | providers: {providers}")
det_session = ort.InferenceSession(det_path, providers=providers)