修复 dataset outerwear出现的key error问题
This commit is contained in:
@@ -80,12 +80,12 @@ class FashionDataset(object):
|
||||
used_items.add(item["item_name"])
|
||||
outfit = [query_item, item]
|
||||
outfit_list.append(tuple(outfit))
|
||||
|
||||
# 20% chance to include an outerwear
|
||||
if self.cate2num['outerwear'] > 0 and random.random() < 0.2:
|
||||
outerwear = random.choice(self.cate2item['outerwear'])
|
||||
outfit.append(outerwear)
|
||||
outfit_list.append(tuple(outfit))
|
||||
if "outerwear" in self.cate2item.keys():
|
||||
# 20% chance to include an outerwear
|
||||
if self.cate2num['outerwear'] > 0 and random.random() < 0.2:
|
||||
outerwear = random.choice(self.cate2item['outerwear'])
|
||||
outfit.append(outerwear)
|
||||
outfit_list.append(tuple(outfit))
|
||||
if len(outfit_list) < topk:
|
||||
raise ValueError(f"Cannot generate more than {topk} outfits!")
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"topk": 5,
|
||||
"max_outfits": 100,
|
||||
"topk": 1,
|
||||
"max_outfits": 10,
|
||||
"is_best": true,
|
||||
"query": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user