From 1f1553eb5489f779f32a4b0a2d7f645d50e8748f Mon Sep 17 00:00:00 2001 From: zhouchengrong Date: Wed, 27 Mar 2024 14:57:57 +0800 Subject: [PATCH] =?UTF-8?q?generate=20outfit=20=E5=A2=9E=E5=8A=A0=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/outfit_matcher/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/service/outfit_matcher/dataset.py b/app/service/outfit_matcher/dataset.py index 6e11983..4718688 100644 --- a/app/service/outfit_matcher/dataset.py +++ b/app/service/outfit_matcher/dataset.py @@ -59,7 +59,7 @@ class FashionDataset(object): if given_cate == 'tops' or given_cate == "bottoms": complementary_cate = "bottoms" if given_cate == "tops" else "tops" # check bottom num - if not self.cate2num[complementary_cate]: + if complementary_cate not in self.cate2num.keys() or not self.cate2num[complementary_cate]: raise ValueError(f"Not enough {complementary_cate} available to generate outfits.") complementary_items = deepcopy(self.cate2item[complementary_cate])