save code
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user