save code
This commit is contained in:
@@ -340,7 +340,7 @@ class RenderPeopleKpsMask:
|
|||||||
"default": 2.5
|
"default": 2.5
|
||||||
}),
|
}),
|
||||||
"more_clip": ("FLOAT", {
|
"more_clip": ("FLOAT", {
|
||||||
"default": 0.2
|
"default": 0.
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,11 +354,11 @@ class RenderPeopleKpsMask:
|
|||||||
if isinstance(kps, list):
|
if isinstance(kps, list):
|
||||||
kps = kps[0]
|
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(
|
mask, neck_y, Head2YaoTimes, Left, Right, head_y, head2yao_base = draw_poses_mask(
|
||||||
poses,
|
poses,
|
||||||
height,
|
dh,
|
||||||
width,
|
dw,
|
||||||
cloth_len,
|
cloth_len,
|
||||||
line_len,
|
line_len,
|
||||||
cloth_short,
|
cloth_short,
|
||||||
@@ -366,11 +366,18 @@ class RenderPeopleKpsMask:
|
|||||||
height,
|
height,
|
||||||
left_right_line_width
|
left_right_line_width
|
||||||
)
|
)
|
||||||
|
y = 0
|
||||||
w = Right - Left
|
w = Right - Left
|
||||||
x = Left
|
x = Left
|
||||||
h = head2yao_base * human_head2_yao_times + head_y - (more_clip*head2yao_base)
|
first_h = head2yao_base * human_head2_yao_times + head_y
|
||||||
y = 0
|
to_bottom_h = height - first_h
|
||||||
print(f"RenderPeopleKpsMask w:{w} h{h} x{x} y{y}")
|
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))
|
return (mask, int(neck_y), float(Head2YaoTimes), int(Left), int(Right), int(w), int(h), int(x), int(y))
|
||||||
|
|
||||||
class RenderPeopleKps:
|
class RenderPeopleKps:
|
||||||
|
|||||||
Reference in New Issue
Block a user