correct import
This commit is contained in:
@@ -276,8 +276,4 @@ def switch_to_backpose(input_keypoints, input_width):
|
|||||||
|
|
||||||
return input_keypoints
|
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
@@ -34,11 +34,17 @@ class TRI3D_SmartBox:
|
|||||||
RETURN_TYPES = ("IMAGE", )
|
RETURN_TYPES = ("IMAGE", )
|
||||||
CATEGORY = "TRI3D"
|
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):
|
def run(self, image, keypoints_json):
|
||||||
from .dwpose import comfy_utils
|
|
||||||
kp_data = json.loads(open(keypoints_json, 'r').read())
|
kp_data = json.loads(open(keypoints_json, 'r').read())
|
||||||
original_height, original_width = kp_data['height'], kp_data['width']
|
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
|
# Convert Torch image to OpenCV format
|
||||||
cv_image = self.from_torch_image(image)
|
cv_image = self.from_torch_image(image)
|
||||||
|
|||||||
Reference in New Issue
Block a user