From 571a84ac6882bb99485149e9eb55512623945f21 Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Fri, 4 Oct 2024 17:37:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=20fix=20=20=20=20=20=20seg=20=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=80=BB=E8=BE=91=E6=96=B0=E5=A2=9E=20size=E5=88=A4?= =?UTF-8?q?=E6=96=AD=20=E9=81=BF=E5=85=8D=E5=87=BA=E7=8E=B0seg=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=B8=8E=E5=9B=BE=E7=89=87=E5=A4=A7=E5=B0=8F=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/design_fast/pipeline/segmentation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/service/design_fast/pipeline/segmentation.py b/app/service/design_fast/pipeline/segmentation.py index 3884a48..8447514 100644 --- a/app/service/design_fast/pipeline/segmentation.py +++ b/app/service/design_fast/pipeline/segmentation.py @@ -36,7 +36,8 @@ class Segmentation: # 本地查询seg 缓存是否存在 _, seg_result = self.load_seg_result(result["image_id"]) result['seg_result'] = seg_result - if not _: + # 判断缓存和实际图片size是否相同 + if not _ or result["image"].shape[:2] != seg_result.shape: # 推理获得seg 结果 seg_result = get_seg_result(result["image_id"], result['image'])[0] self.save_seg_result(seg_result, result['image_id'])