From f19063af5bb1675d4f99b5f786a4e29ade243db4 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Wed, 8 Jan 2025 13:30:05 +0000 Subject: [PATCH] correct import --- dwpose/comfy_utils.py | 4 ---- smart_box.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dwpose/comfy_utils.py b/dwpose/comfy_utils.py index c75be41..2e39562 100644 --- a/dwpose/comfy_utils.py +++ b/dwpose/comfy_utils.py @@ -276,8 +276,4 @@ def switch_to_backpose(input_keypoints, input_width): return input_keypoints -def extract_torso_keypoints(keypoints): - # Indices for torso-related keypoints - torso_indices = [8, 9, 10, 11, 12, 13] - return [keypoints[i] for i in torso_indices if keypoints[i] != [-1, -1]] diff --git a/smart_box.py b/smart_box.py index 97890e0..a984a38 100644 --- a/smart_box.py +++ b/smart_box.py @@ -34,11 +34,17 @@ class TRI3D_SmartBox: RETURN_TYPES = ("IMAGE", ) CATEGORY = "TRI3D" + def extract_torso_keypoints(self, keypoints): + # Indices for torso-related keypoints + torso_indices = [8, 9, 10, 11, 12, 13] + return [keypoints[i] for i in torso_indices if keypoints[i] != [-1, -1]] + + def run(self, image, keypoints_json): - from .dwpose import comfy_utils + kp_data = json.loads(open(keypoints_json, 'r').read()) original_height, original_width = kp_data['height'], kp_data['width'] - torso_keypoints = comfy_utils.extract_torso_keypoints(kp_data['keypoints']) + torso_keypoints = self.extract_torso_keypoints(kp_data['keypoints']) # Convert Torch image to OpenCV format cv_image = self.from_torch_image(image)