From ba39cf4cbd5a39dd416124edd604ab51795239f8 Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Wed, 27 Nov 2024 11:15:48 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=20=201.design=20=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=A8=A1=E5=BC=8F=E6=B5=8B=E8=AF=95=202.?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=BB=A5stream=E5=8F=91=E9=80=81=E5=88=B0jav?= =?UTF-8?q?a=203.=E6=96=B0=E5=A2=9E=E9=85=8D=E9=A5=B0=E7=B1=BB=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/design_fast/pipeline/scale.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/service/design_fast/pipeline/scale.py b/app/service/design_fast/pipeline/scale.py index c901aa7..d1c7a36 100644 --- a/app/service/design_fast/pipeline/scale.py +++ b/app/service/design_fast/pipeline/scale.py @@ -46,6 +46,16 @@ class Scaling: result['scale'] = result['scale_bag'] elif result['keypoint'] == 'ear_point': result['scale'] = result['scale_earrings'] + elif result['keypoint'] == 'accessories': + # 由于没有识别配饰keypoint的模型 所以统一将配饰的两个关键点设定为 (0,0) (0,img.width) + # 模特的关键点设定为(0,0) (0,320/2) 距离比例简写为 160 / img.width + distance_clo = result['img_shape'][1] + distance_bdy = 320 / 2 + + if distance_clo == 0: + result['scale'] = 1 + else: + result['scale'] = distance_bdy / distance_clo else: result['scale'] = 1 return result