From 2c15f511837455cb99ba9ae612d8a2049a1924fc Mon Sep 17 00:00:00 2001 From: huchenlei Date: Fri, 4 Aug 2023 18:48:34 -0400 Subject: [PATCH] :bug: Delay import of mmpose --- annotator/openpose/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/annotator/openpose/__init__.py b/annotator/openpose/__init__.py index 9f2fd77a0..7970c6ba2 100644 --- a/annotator/openpose/__init__.py +++ b/annotator/openpose/__init__.py @@ -17,7 +17,6 @@ from .body import Body, BodyResult, Keypoint from .hand import Hand from .face import Face -from .wholebody import Wholebody # DW Pose from .types import PoseResult, HandResult, FaceResult from modules import devices from annotator.annotator_path import models_path @@ -201,6 +200,8 @@ def load_model(self): self.face_estimation = Face(face_modelpath) def load_dw_model(self): + from .wholebody import Wholebody # DW Pose + dw_modelpath = os.path.join(self.model_dir, "dw-ll_ucoco_384.pth") if not os.path.exists(dw_modelpath): from basicsr.utils.download_util import load_file_from_url @@ -323,6 +324,8 @@ def detect_poses_dw(self, oriImg) -> List[PoseResult]: Returns: List[PoseResult]: A list of PoseResult objects containing the detected poses. """ + from .wholebody import Wholebody # DW Pose + if self.dw_pose_estimation is None: self.load_dw_model()