feat 1.design 取消进度模式测试

2.结果以stream发送到java
3.新增配饰类
fix
This commit is contained in:
zhouchengrong
2024-11-26 16:08:10 +08:00
parent 754c6eff87
commit 7eb9b18f8f
9 changed files with 405 additions and 11 deletions

View File

@@ -79,9 +79,11 @@ def synthesis(data, size, basic_info):
_, binary_body_mask = cv2.threshold(body_mask, 127, 255, cv2.THRESH_BINARY)
top_outer_mask = np.array(binary_body_mask)
bottom_outer_mask = np.array(binary_body_mask)
accessories_outer_mask = np.array(binary_body_mask)
top = True
bottom = True
accessories = True
i = len(data)
while i:
i -= 1
@@ -109,10 +111,23 @@ def synthesis(data, size, basic_info):
background = np.zeros_like(top_outer_mask)
background[all_y_start:all_y_end, all_x_start:all_x_end] = sketch_mask[mask_y_start:mask_y_end, mask_x_start:mask_x_end]
bottom_outer_mask = background + bottom_outer_mask
elif accessories and data[i]['name'] in ['accessories_front']:
mask_shape = data[i]['mask'].shape
y_offset, x_offset = data[i]['adaptive_position']
# 初始化叠加区域的起始和结束位置
all_y_start, all_y_end, mask_y_start, mask_y_end = positioning(all_mask_shape=all_mask_shape[0], mask_shape=mask_shape[0], offset=y_offset)
all_x_start, all_x_end, mask_x_start, mask_x_end = positioning(all_mask_shape=all_mask_shape[1], mask_shape=mask_shape[1], offset=x_offset)
# 将叠加区域赋值为相应的像素值
_, sketch_mask = cv2.threshold(data[i]['mask'], 127, 255, cv2.THRESH_BINARY)
background = np.zeros_like(top_outer_mask)
background[all_y_start:all_y_end, all_x_start:all_x_end] = sketch_mask[mask_y_start:mask_y_end, mask_x_start:mask_x_end]
accessories_outer_mask = background + accessories_outer_mask
pass
elif bottom is False and top is False:
break
all_mask = cv2.bitwise_or(top_outer_mask, bottom_outer_mask)
all_mask = cv2.bitwise_or(all_mask, accessories_outer_mask)
for layer in data:
if layer['image'] is not None: