feat(新功能): 新增图层越界控制参数
fix(修复bug): docs(文档变更): refactor(重构): test(增加测试):
This commit is contained in:
@@ -60,6 +60,18 @@ def positioning(all_mask_shape, mask_shape, offset):
|
|||||||
|
|
||||||
# @RunTime
|
# @RunTime
|
||||||
def synthesis(data, size, basic_info):
|
def synthesis(data, size, basic_info):
|
||||||
|
"""
|
||||||
|
|
||||||
|
Args:
|
||||||
|
data:
|
||||||
|
size:
|
||||||
|
basic_info:
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
"""
|
||||||
|
# out_of_bounds_control: 是否允许服装越界 True 允许 False 不允许 默认情况允许
|
||||||
|
out_of_bounds_control = basic_info.get('out_of_bounds_control', True)
|
||||||
# 创建底图
|
# 创建底图
|
||||||
base_image = Image.new('RGBA', size, (0, 0, 0, 0))
|
base_image = Image.new('RGBA', size, (0, 0, 0, 0))
|
||||||
try:
|
try:
|
||||||
@@ -88,7 +100,10 @@ def synthesis(data, size, basic_info):
|
|||||||
while i:
|
while i:
|
||||||
i -= 1
|
i -= 1
|
||||||
if top and data[i]['name'] in ["blouse_front", "outwear_front", "dress_front", "tops_front"]:
|
if top and data[i]['name'] in ["blouse_front", "outwear_front", "dress_front", "tops_front"]:
|
||||||
top = False
|
if out_of_bounds_control:
|
||||||
|
top = True
|
||||||
|
else:
|
||||||
|
top = False
|
||||||
mask_shape = data[i]['mask'].shape
|
mask_shape = data[i]['mask'].shape
|
||||||
y_offset, x_offset = data[i]['adaptive_position']
|
y_offset, x_offset = data[i]['adaptive_position']
|
||||||
# 初始化叠加区域的起始和结束位置
|
# 初始化叠加区域的起始和结束位置
|
||||||
|
|||||||
Reference in New Issue
Block a user