benjaminStreltzin commited on
Commit
84a3fbf
1 Parent(s): 1c3623e
Files changed (1) hide show
  1. dataset_ini.py +7 -9
dataset_ini.py CHANGED
@@ -2,7 +2,7 @@ import pandas as pd
2
  from datasets import Dataset, DatasetDict, concatenate_datasets
3
  import os
4
 
5
- def load_data(csv_file, images_folder):
6
  df = pd.read_csv(csv_file)
7
  # Update the image_path column to include the full path
8
  df['label'] = df['label'].astype(int)
@@ -23,19 +23,17 @@ def load_dataset():
23
  test_csv = 'test_labels.csv'
24
 
25
  # Load datasets
26
- train_dataset_real = load_data(train_csv, training_real)
27
 
28
- train_dataset_fake = load_data(train_csv, training_fake)
29
 
30
- # Combine datasets for training
31
- train_dataset = concatenate_datasets([train_dataset_real, train_dataset_fake])
32
 
33
- test_dataset_real = load_data(test_csv, test_real)
34
- test_dataset_fake = load_data(test_csv, test_fake)
35
 
36
- # Combine datasets for testing
37
- test_dataset = concatenate_datasets([test_dataset_real, test_dataset_fake])
38
 
 
39
  # Create DatasetDict
40
  dataset_dict = DatasetDict({
41
  'train': train_dataset,
 
2
  from datasets import Dataset, DatasetDict, concatenate_datasets
3
  import os
4
 
5
+ def load_data(csv_file):
6
  df = pd.read_csv(csv_file)
7
  # Update the image_path column to include the full path
8
  df['label'] = df['label'].astype(int)
 
23
  test_csv = 'test_labels.csv'
24
 
25
  # Load datasets
26
+ train_dataset = load_data(train_csv)
27
 
 
28
 
 
 
29
 
30
+ # Combine datasets for training
31
+
32
 
33
+ test_dataset = load_data(test_csv)
34
+
35
 
36
+
37
  # Create DatasetDict
38
  dataset_dict = DatasetDict({
39
  'train': train_dataset,