From 5e3a57060a2fd04a67b2a0350a7741053fa03ef2 Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Fri, 18 Oct 2024 15:53:40 +0800 Subject: [PATCH] =?UTF-8?q?feat=20fix=20=20=20=20=20=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E4=BC=9A=E9=BB=98=E8=AE=A4=E6=A8=A1?= =?UTF-8?q?=E7=89=B9=E9=AB=98=E5=BA=A6=E4=B8=BA700=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=9B=BE=E9=AB=98=E5=BA=A6=E9=94=81=E5=AE=9A?= =?UTF-8?q?=E5=9C=A8700=20=E4=BF=AE=E5=A4=8Dbug=20=E7=8E=B0=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E7=94=B1=E6=A8=A1=E7=89=B9=E9=AB=98=E5=BA=A6=E6=9D=A5?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/api_image2sketch.py | 2 +- app/service/design_fast/utils/synthesis_item.py | 4 +++- app/service/utils/oss_client.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/api/api_image2sketch.py b/app/api/api_image2sketch.py index 8a9b4d9..cac7652 100644 --- a/app/api/api_image2sketch.py +++ b/app/api/api_image2sketch.py @@ -25,7 +25,7 @@ def image2sketch(request_item: Image2SketchModel): "image_url": "test/image2sketch/real_Dress_3200fecdc83d0c556c2bd96aedbd7fbf.jpg_Img.jpg", "default_style": 0, "sketch_bucket": "test", - "sketch_name": "image2sketch/test.png" + "sketch_name": "image2sketch/area_fill_img.png" } """ try: diff --git a/app/service/design_fast/utils/synthesis_item.py b/app/service/design_fast/utils/synthesis_item.py index 272ab23..08bf4ec 100644 --- a/app/service/design_fast/utils/synthesis_item.py +++ b/app/service/design_fast/utils/synthesis_item.py @@ -185,12 +185,14 @@ def update_base_size_priority(layers, size): # 计算透明背景图片的宽度 min_x = min(info['position'][1] for info in layers) x_list = [] + new_height = 700 for info in layers: if info['image'] is not None: x_list.append(info['position'][1] + info['image'].width) + if info['name'] == 'mannequin': + new_height = info['image'].height max_x = max(x_list) new_width = max_x - min_x - new_height = 700 # 更新坐标 for info in layers: info['adaptive_position'] = (info['position'][0], info['position'][1] - min_x) diff --git a/app/service/utils/oss_client.py b/app/service/utils/oss_client.py index 5704ced..0bd9853 100644 --- a/app/service/utils/oss_client.py +++ b/app/service/utils/oss_client.py @@ -78,7 +78,7 @@ if __name__ == '__main__': # url = "aida-users/89/sketchboard/female/Dress/e6724ab7-8d3f-4677-abe0-c3e42ab7af85.jpeg" # url = "aida-users/87/print/956614a2-7e75-4fbe-9ed0-c1831e37a2c9-4-87.png" # url = "aida-users/89/single_logo/123-89.png" - url = "aida-clothing/mask/mask_f354afb5-6423-11ef-8b08-0826ae3ad6b3.png" + url = "aida-results/result_e2673d92-8d25-11ef-be24-0826ae3ad6b3.png" # url = "aida-collection-element/12148/Sketchboard/95ea577b-305b-4a62-b30a-39c0dd3ddb3f.png" read_type = "cv2" if read_type == "cv2":