feat(新功能): 新增图层越界控制参数
fix(修复bug): docs(文档变更): refactor(重构): test(增加测试):
This commit is contained in:
@@ -60,6 +60,18 @@ def positioning(all_mask_shape, mask_shape, offset):
|
||||
|
||||
# @RunTime
|
||||
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))
|
||||
try:
|
||||
@@ -88,6 +100,9 @@ def synthesis(data, size, basic_info):
|
||||
while i:
|
||||
i -= 1
|
||||
if top and data[i]['name'] in ["blouse_front", "outwear_front", "dress_front", "tops_front"]:
|
||||
if out_of_bounds_control:
|
||||
top = True
|
||||
else:
|
||||
top = False
|
||||
mask_shape = data[i]['mask'].shape
|
||||
y_offset, x_offset = data[i]['adaptive_position']
|
||||
|
||||
Reference in New Issue
Block a user