correct import

This commit is contained in:
Ubuntu
2025-01-08 13:30:05 +00:00
parent 0d6a998eca
commit f19063af5b
2 changed files with 8 additions and 6 deletions
-4
View File
@@ -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]]
+8 -2
View File
@@ -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)