From c77540678b0a4a6511e68b0a87c20f63df7e4ada Mon Sep 17 00:00:00 2001 From: zchengrong Date: Tue, 24 Jun 2025 11:12:02 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=88=E6=96=B0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=89:=20fix=EF=BC=88=E4=BF=AE=E5=A4=8Dbug=EF=BC=89:=20=20c?= =?UTF-8?q?lothing=20seg=20=E6=9C=8D=E5=8A=A1=E5=9B=BE=E7=89=87=E7=BC=BA?= =?UTF-8?q?=E5=B0=913=E9=80=9A=E9=81=93=E9=80=BB=E8=BE=91=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20docs=EF=BC=88=E6=96=87=E6=A1=A3=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=EF=BC=89:=20refactor=EF=BC=88=E9=87=8D=E6=9E=84=EF=BC=89:=20te?= =?UTF-8?q?st(=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/clothing_seg/service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/service/clothing_seg/service.py b/app/service/clothing_seg/service.py index 6d2b4d0..34ea7ee 100644 --- a/app/service/clothing_seg/service.py +++ b/app/service/clothing_seg/service.py @@ -63,7 +63,7 @@ class ClothingSeg: clothing_result = [] if image_type == "sketch": if len(image.shape) == 2: - image = np.stack([image] * 3, axis=-1) + image = cv2.cvtColor(image, cv2.COLOR_GRAY2RGB) seg_mask = get_seg_result(1, image[:, :, :3]) else: seg_mask = get_seg_result(1, image[:, :, :3]) @@ -150,8 +150,8 @@ if __name__ == "__main__": # "image_type": "sketch" # }, { - "image_url": "test/clothing_seg/10144613.jpg", - "image_type": "product" + "image_url": "aida-collection-element/87/Sketchboard/ab40e035-547a-48c5-9f97-1db7bf56ad77.jpg", + "image_type": "sketch" } ] )