Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ class Pix2PixDataset(torch.utils.data.Dataset):
|
|
31 |
# Filter dataset for 'original' and 'target' images
|
32 |
#https://huggingface.co/datasets/K00B404/pix2pix_flux_set/viewer/default/train?f[label][value]=0
|
33 |
#https://huggingface.co/datasets/K00B404/pix2pix_flux_set/viewer/default/train?f[label][value]=1
|
34 |
-
|
35 |
self.originals = [x for x in ds["train"] if x['label'] == 0]
|
36 |
self.targets = [x for x in ds["train"] if x['label'] == 1]
|
37 |
|
@@ -62,7 +62,7 @@ class Pix2PixDataset(torch.utils.data.Dataset):
|
|
62 |
def train_model(epochs):
|
63 |
# Load the dataset
|
64 |
ds = load_dataset(dataset_id)
|
65 |
-
|
66 |
# Transform function to resize and convert to tensor
|
67 |
transform = transforms.Compose([
|
68 |
transforms.Resize((IMG_SIZE, IMG_SIZE)),
|
@@ -71,6 +71,7 @@ def train_model(epochs):
|
|
71 |
|
72 |
|
73 |
dataset = Pix2PixDataset(ds)
|
|
|
74 |
dataloader = DataLoader(dataset, batch_size=BATCH_SIZE, shuffle=True)
|
75 |
|
76 |
# Initialize model, loss function, and optimizer
|
|
|
31 |
# Filter dataset for 'original' and 'target' images
|
32 |
#https://huggingface.co/datasets/K00B404/pix2pix_flux_set/viewer/default/train?f[label][value]=0
|
33 |
#https://huggingface.co/datasets/K00B404/pix2pix_flux_set/viewer/default/train?f[label][value]=1
|
34 |
+
|
35 |
self.originals = [x for x in ds["train"] if x['label'] == 0]
|
36 |
self.targets = [x for x in ds["train"] if x['label'] == 1]
|
37 |
|
|
|
62 |
def train_model(epochs):
|
63 |
# Load the dataset
|
64 |
ds = load_dataset(dataset_id)
|
65 |
+
print(f"ds{ds}")
|
66 |
# Transform function to resize and convert to tensor
|
67 |
transform = transforms.Compose([
|
68 |
transforms.Resize((IMG_SIZE, IMG_SIZE)),
|
|
|
71 |
|
72 |
|
73 |
dataset = Pix2PixDataset(ds)
|
74 |
+
print(f"dataset{dataset}")
|
75 |
dataloader = DataLoader(dataset, batch_size=BATCH_SIZE, shuffle=True)
|
76 |
|
77 |
# Initialize model, loss function, and optimizer
|