Spaces:
Sleeping
Sleeping
Tanusree88
commited on
Update app.py
Browse files
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 |
-
|
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 |
-
|
64 |
-
|
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):
|