Leacb4 commited on
Commit
f1c37b0
·
verified ·
1 Parent(s): a347824

Upload color_model.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. color_model.py +3 -1
color_model.py CHANGED
@@ -69,7 +69,9 @@ class ColorDataset(Dataset):
69
  Tuple of (image_tensor, token_tensor)
70
  """
71
  row = self.df.iloc[idx]
72
- img = Image.open(config.column_local_image_path).convert("RGB")
 
 
73
  img = self.transform(img)
74
  tokens = torch.tensor(self.tokenizer(row[config.text_column]), dtype=torch.long)
75
  return img, tokens
 
69
  Tuple of (image_tensor, token_tensor)
70
  """
71
  row = self.df.iloc[idx]
72
+ # Fix: Get the image path from the row, not the column name
73
+ img_path = row[config.column_local_image_path]
74
+ img = Image.open(img_path).convert("RGB")
75
  img = self.transform(img)
76
  tokens = torch.tensor(self.tokenizer(row[config.text_column]), dtype=torch.long)
77
  return img, tokens