generate outfit 增加逻辑判断
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user