From 4bc79e62ca95087d19b24dda338eb816a8b2e678 Mon Sep 17 00:00:00 2001 From: zhh Date: Thu, 25 Sep 2025 16:01:28 +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:design=20=E6=96=B0=E5=A2=9E=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E4=B8=AD=E9=97=B4=E7=BB=93=E6=9E=9C(=E6=9C=AA=E5=88=86?= =?UTF-8?q?=E5=89=B2=E5=9B=BE=E5=B1=82)=201.color=20+=20overall=5Fprint=20?= =?UTF-8?q?=202.color=20+=20overall=5Fprint=20+=20print=20fix=EF=BC=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=89:=20refactor=EF=BC=88=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=89:=20test(=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/design_fast/pipeline/color.py | 4 ++-- app/service/design_fast/pipeline/no_seg_print_painting.py | 4 ++-- app/service/design_fast/pipeline/split.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/service/design_fast/pipeline/color.py b/app/service/design_fast/pipeline/color.py index e554063..32e550b 100644 --- a/app/service/design_fast/pipeline/color.py +++ b/app/service/design_fast/pipeline/color.py @@ -22,7 +22,7 @@ class Color: resize_pattern = cv2.resize(pattern, (dim_image_w, dim_image_h), interpolation=cv2.INTER_AREA) # 无色 elif "color" not in result.keys() or result['color'] == "": - result['no_seg_sketch'] = result['final_image'] = result['pattern_image'] = result['single_image'] = result['image'] + result['no_seg_sketch_overall'] = result['no_seg_sketch_print'] = result['final_image'] = result['pattern_image'] = result['single_image'] = result['image'] result['alpha'] = 100 / 255.0 return result # 正常颜色 @@ -60,7 +60,7 @@ class Color: result['single_image'] = cv2.add(tmp1, tmp2) result['alpha'] = 100 / 255.0 - result['no_seg_sketch'] = result['no_seg_sketch_print'] = result['final_image'].copy() + result['no_seg_sketch_overall'] = result['no_seg_sketch_print'] = result['final_image'].copy() return result def get_gradient(self, bucket_name, object_name): diff --git a/app/service/design_fast/pipeline/no_seg_print_painting.py b/app/service/design_fast/pipeline/no_seg_print_painting.py index 492968a..145dd41 100644 --- a/app/service/design_fast/pipeline/no_seg_print_painting.py +++ b/app/service/design_fast/pipeline/no_seg_print_painting.py @@ -30,8 +30,8 @@ class NoSegPrintPainting: painting_dict['mask_inv_print'] = self.resize_and_crop(img=painting_dict['mask_inv_print'], target_width=painting_dict['dim_image_w'], target_height=painting_dict['dim_image_h']) else: painting_dict = self.painting_collection(painting_dict, overall_print, print_trigger=True, is_single=False) - result['no_seg_sketch_print'] = self.printpaint(result, painting_dict, print_=True) - result['pattern_image'] = result['no_seg_sketch_print'] + result['no_seg_sketch_overall'] = self.printpaint(result, painting_dict, print_=True) + result['pattern_image'] = result['no_seg_sketch_overall'] if single_print['print_path_list']: print_background = np.zeros((result['pattern_image'].shape[0], result['pattern_image'].shape[1], 3), dtype=np.uint8) diff --git a/app/service/design_fast/pipeline/split.py b/app/service/design_fast/pipeline/split.py index 5b0184f..d0d7511 100644 --- a/app/service/design_fast/pipeline/split.py +++ b/app/service/design_fast/pipeline/split.py @@ -122,7 +122,7 @@ class Split(object): result['mask_url'] = req.bucket_name + "/" + req.object_name # 创建中间图层(未分割图层) 1.color + overall_print 2.color + overall_print + print - result_pattern_overall_image_pil = Image.fromarray(cvtColor(rgb_to_rgba(result['no_seg_sketch'], ori_front_mask + ori_back_mask), COLOR_BGR2RGBA)) + result_pattern_overall_image_pil = Image.fromarray(cvtColor(rgb_to_rgba(result['no_seg_sketch_overall'], ori_front_mask + ori_back_mask), COLOR_BGR2RGBA)) result['pattern_overall_image'], result['pattern_overall_image_url'], _ = upload_png_mask(self.minio_client, result_pattern_overall_image_pil, f'{generate_uuid()}') result_pattern_print_image_pil = Image.fromarray(cvtColor(rgb_to_rgba(result['no_seg_sketch_print'], ori_front_mask + ori_back_mask), COLOR_BGR2RGBA))