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'])