generate outfit 增加逻辑判断

This commit is contained in:
zhouchengrong
2024-03-27 14:57:57 +08:00
parent d4be7b8053
commit 1f1553eb54

View File

@@ -59,7 +59,7 @@ class FashionDataset(object):
if given_cate == 'tops' or given_cate == "bottoms": if given_cate == 'tops' or given_cate == "bottoms":
complementary_cate = "bottoms" if given_cate == "tops" else "tops" complementary_cate = "bottoms" if given_cate == "tops" else "tops"
# check bottom num # 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.") raise ValueError(f"Not enough {complementary_cate} available to generate outfits.")
complementary_items = deepcopy(self.cate2item[complementary_cate]) complementary_items = deepcopy(self.cate2item[complementary_cate])