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