Spaces:
Paused
Paused
giorgio-caparvi
commited on
Commit
·
30eb562
1
Parent(s):
cec32e7
adding print for debug
Browse files- api/app.py +7 -0
- api/model/src/datasets/dresscode.py +3 -1
api/app.py
CHANGED
@@ -75,6 +75,13 @@ def generate_design():
|
|
75 |
print("###################################### DIRECTORY DOVE LO SALVO: ", image_save_dir)
|
76 |
image_save_path = os.path.join(image_save_dir, image_filename)
|
77 |
image.save(image_save_path, format='JPEG')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
#with open(text_file_path, "w") as text_file:
|
80 |
# text_file.write(f"{image_filename} {image_filename}\n")
|
|
|
75 |
print("###################################### DIRECTORY DOVE LO SALVO: ", image_save_dir)
|
76 |
image_save_path = os.path.join(image_save_dir, image_filename)
|
77 |
image.save(image_save_path, format='JPEG')
|
78 |
+
|
79 |
+
# Elenca tutti i file nella directory
|
80 |
+
files_in_directory = os.listdir(image_save_dir)
|
81 |
+
|
82 |
+
# Stampa i file trovati
|
83 |
+
for file_name in files_in_directory:
|
84 |
+
print(file_name)
|
85 |
|
86 |
#with open(text_file_path, "w") as text_file:
|
87 |
# text_file.write(f"{image_filename} {image_filename}\n")
|
api/model/src/datasets/dresscode.py
CHANGED
@@ -4,6 +4,7 @@ import json
|
|
4 |
import pathlib
|
5 |
import random
|
6 |
import sys
|
|
|
7 |
from typing import Tuple
|
8 |
|
9 |
PROJECT_ROOT = pathlib.Path(__file__).absolute().parents[2].absolute()
|
@@ -165,12 +166,13 @@ class DressCodeDataset(data.Dataset):
|
|
165 |
image = self.transform(image) # [-1,1]
|
166 |
|
167 |
if "im_sketch" in self.outputlist:
|
|
|
168 |
|
169 |
if "unpaired" == self.order and self.phase == 'test': # Upper of multigarment is the same of unpaired
|
170 |
im_sketch = Image.open(
|
171 |
dataroot / 'im_sketch_unpaired' / f'{im_name.replace(".jpg", "")}_{c_name.replace(".jpg", ".jpeg")}')
|
172 |
else:
|
173 |
-
im_sketch = Image.open(dataroot
|
174 |
|
175 |
transform = transforms.Grayscale()
|
176 |
# apply the above transform on the image
|
|
|
4 |
import pathlib
|
5 |
import random
|
6 |
import sys
|
7 |
+
import os
|
8 |
from typing import Tuple
|
9 |
|
10 |
PROJECT_ROOT = pathlib.Path(__file__).absolute().parents[2].absolute()
|
|
|
166 |
image = self.transform(image) # [-1,1]
|
167 |
|
168 |
if "im_sketch" in self.outputlist:
|
169 |
+
print("####################################### ", dataroot)
|
170 |
|
171 |
if "unpaired" == self.order and self.phase == 'test': # Upper of multigarment is the same of unpaired
|
172 |
im_sketch = Image.open(
|
173 |
dataroot / 'im_sketch_unpaired' / f'{im_name.replace(".jpg", "")}_{c_name.replace(".jpg", ".jpeg")}')
|
174 |
else:
|
175 |
+
im_sketch = Image.open(os.path.join(dataroot, 'im_sketch', c_name.replace(".jpg", ".jpeg")))
|
176 |
|
177 |
transform = transforms.Grayscale()
|
178 |
# apply the above transform on the image
|