From 525bf8dabd75384951abdf677789d84db70e0676 Mon Sep 17 00:00:00 2001 From: xsl Date: Tue, 19 Aug 2025 21:49:16 +0800 Subject: [PATCH] save code --- node_wrappers/pose_keypoint_postprocess.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/node_wrappers/pose_keypoint_postprocess.py b/node_wrappers/pose_keypoint_postprocess.py index 664ca3f..330d127 100644 --- a/node_wrappers/pose_keypoint_postprocess.py +++ b/node_wrappers/pose_keypoint_postprocess.py @@ -340,7 +340,7 @@ class RenderPeopleKpsMask: "default": 2.5 }), "more_clip": ("FLOAT", { - "default": 0.2 + "default": 0. }), } } @@ -354,11 +354,11 @@ class RenderPeopleKpsMask: if isinstance(kps, list): kps = kps[0] - poses, _, height, width = decode_json_as_poses(kps) + poses, _, dh, dw = decode_json_as_poses(kps) mask, neck_y, Head2YaoTimes, Left, Right, head_y, head2yao_base = draw_poses_mask( poses, - height, - width, + dh, + dw, cloth_len, line_len, cloth_short, @@ -366,11 +366,18 @@ class RenderPeopleKpsMask: height, left_right_line_width ) + y = 0 w = Right - Left x = Left - h = head2yao_base * human_head2_yao_times + head_y - (more_clip*head2yao_base) - y = 0 - print(f"RenderPeopleKpsMask w:{w} h{h} x{x} y{y}") + first_h = head2yao_base * human_head2_yao_times + head_y + to_bottom_h = height - first_h + to_bottom_rate = to_bottom_h / (head2yao_base*0.8) + max_offset = more_clip*head2yao_base + offset = to_bottom_rate * max_offset + if offset > max_offset: + offset = max_offset + h = first_h - offset + print(f"RenderPeopleKpsMask w:{w} h{h} x{x} y{y} width:{width} height:{height} first_h:{first_h} to_bottom_h:{to_bottom_h} to_bottom_rate:{to_bottom_rate} max_offset:{max_offset} offset:{offset}") return (mask, int(neck_y), float(Head2YaoTimes), int(Left), int(Right), int(w), int(h), int(x), int(y)) class RenderPeopleKps: