Upload A_U_Net_Based_CNN_Autoencoder_for_Preprocessing_Noisy_Images_in_Classification_Tasks.ipynb
Browse files
Notebook/A_U_Net_Based_CNN_Autoencoder_for_Preprocessing_Noisy_Images_in_Classification_Tasks.ipynb
CHANGED
|
@@ -1594,7 +1594,7 @@
|
|
| 1594 |
"# Point to the extracted dataset, not the zip file location\n",
|
| 1595 |
"dataset_root = \"/content/my_data/CroppedYale\"\n",
|
| 1596 |
"\n",
|
| 1597 |
-
"#
|
| 1598 |
"mismatches = []\n",
|
| 1599 |
"for i, row in df.iterrows():\n",
|
| 1600 |
" folder_name = os.path.basename(os.path.dirname(row[\"full_path\"]))\n",
|
|
@@ -1603,7 +1603,7 @@
|
|
| 1603 |
"\n",
|
| 1604 |
"print(f\"Found {len(mismatches)} mislabeled images (class vs folder mismatch).\")\n",
|
| 1605 |
"\n",
|
| 1606 |
-
"#
|
| 1607 |
"classes_in_df = set(df[\"class\"].unique())\n",
|
| 1608 |
"folders_in_fs = {f for f in os.listdir(dataset_root) if os.path.isdir(os.path.join(dataset_root, f))}\n",
|
| 1609 |
"\n",
|
|
|
|
| 1594 |
"# Point to the extracted dataset, not the zip file location\n",
|
| 1595 |
"dataset_root = \"/content/my_data/CroppedYale\"\n",
|
| 1596 |
"\n",
|
| 1597 |
+
"# Check mislabeled images\n",
|
| 1598 |
"mismatches = []\n",
|
| 1599 |
"for i, row in df.iterrows():\n",
|
| 1600 |
" folder_name = os.path.basename(os.path.dirname(row[\"full_path\"]))\n",
|
|
|
|
| 1603 |
"\n",
|
| 1604 |
"print(f\"Found {len(mismatches)} mislabeled images (class vs folder mismatch).\")\n",
|
| 1605 |
"\n",
|
| 1606 |
+
"# Compare classes vs folders\n",
|
| 1607 |
"classes_in_df = set(df[\"class\"].unique())\n",
|
| 1608 |
"folders_in_fs = {f for f in os.listdir(dataset_root) if os.path.isdir(os.path.join(dataset_root, f))}\n",
|
| 1609 |
"\n",
|