Tanusree88 commited on
Commit
d9f180c
·
verified ·
1 Parent(s): d83e907

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -50,8 +50,9 @@ def prepare_dataset(extracted_folder):
50
  folder_path = os.path.join(neuronii_path, disease_folder)
51
 
52
  # Check if the subfolder exists
53
- if not os.path.exists(folder_path):
54
  print(f"Folder not found: {folder_path}")
 
55
  label = {'alzheimers_dataset': 0, 'parkinsons_dataset': 1, 'MSjpg': 2}[disease_folder]
56
 
57
  for img_file in os.listdir(folder_path):
@@ -60,8 +61,8 @@ def prepare_dataset(extracted_folder):
60
  labels.append(label)
61
  else:
62
  print(f"Unsuported file:{img_file}")
63
- print(f"Total images loaded :{len(image_paths)}")
64
- return image_paths, labels
65
 
66
  # Custom Dataset class
67
  class CustomImageDataset(Dataset):
 
50
  folder_path = os.path.join(neuronii_path, disease_folder)
51
 
52
  # Check if the subfolder exists
53
+ if not os.path.exists(folder_path):
54
  print(f"Folder not found: {folder_path}")
55
+ continue # Skip this folder if it's not foun
56
  label = {'alzheimers_dataset': 0, 'parkinsons_dataset': 1, 'MSjpg': 2}[disease_folder]
57
 
58
  for img_file in os.listdir(folder_path):
 
61
  labels.append(label)
62
  else:
63
  print(f"Unsuported file:{img_file}")
64
+ print(f"Total images loaded :{len(image_paths)}")
65
+ return image_paths, labels
66
 
67
  # Custom Dataset class
68
  class CustomImageDataset(Dataset):