feat(新功能):

fix(修复bug):  clothing seg 服务图片缺少3通道逻辑增加
docs(文档变更):
refactor(重构):
test(增加测试):
This commit is contained in:
zchengrong
2025-06-23 15:54:32 +08:00
parent 87daf3b52d
commit 58fbceef97

View File

@@ -62,6 +62,10 @@ class ClothingSeg:
image = data["image"]
clothing_result = []
if image_type == "sketch":
if len(image.shape) == 2:
image = np.stack([image] * 3, axis=-1)
seg_mask = get_seg_result(1, image[:, :, :3])
else:
seg_mask = get_seg_result(1, image[:, :, :3])
temp = seg_mask != 0.0
mask = (255 * (temp + 0).astype(np.uint8))