Spaces:
Paused
Paused
giorgio-caparvi
commited on
Commit
·
e80cf5e
1
Parent(s):
398a873
rewriting file text
Browse files
api/model/src/datasets/vitonhd.py
CHANGED
@@ -82,6 +82,13 @@ class VitonHDDataset(data.Dataset):
|
|
82 |
# Filter captions based on the length requirement (3 or more items)
|
83 |
self.captions_dict = {k: v for k, v in model_data.items() if len(v) >= 3}
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
dataroot = self.dataroot
|
86 |
if phase == 'train':
|
87 |
filename = os.path.join(dataroot, f"{phase}_pairs.txt")
|
|
|
82 |
# Filter captions based on the length requirement (3 or more items)
|
83 |
self.captions_dict = {k: v for k, v in model_data.items() if len(v) >= 3}
|
84 |
|
85 |
+
pairs_file_path = os.path.join(self.dataroot, f"{self.phase}_pairs.txt")
|
86 |
+
|
87 |
+
|
88 |
+
with open(pairs_file_path, 'w') as pairs_file:
|
89 |
+
for key in self.captions_dict.keys():
|
90 |
+
pairs_file.write(f"{key}_00.jpg {key}_00.jpg\n")
|
91 |
+
|
92 |
dataroot = self.dataroot
|
93 |
if phase == 'train':
|
94 |
filename = os.path.join(dataroot, f"{phase}_pairs.txt")
|