{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceType":"competition","sourceId":13836,"databundleVersionId":1718836,"isSourceIdPinned":false}],"dockerImageVersionId":31329,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# Required Inputs\nimport os\nimport json\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport cv2\nfrom PIL import Image\nimport hashlib","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true,"execution":{"iopub.status.busy":"2026-04-02T08:37:04.050902Z","iopub.execute_input":"2026-04-02T08:37:04.051128Z","iopub.status.idle":"2026-04-02T08:37:07.438653Z","shell.execute_reply.started":"2026-04-02T08:37:04.051105Z","shell.execute_reply":"2026-04-02T08:37:07.437807Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"BASE_DIR= '/kaggle/input/competitions/cassava-leaf-disease-classification'","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-02T08:38:09.296869Z","iopub.execute_input":"2026-04-02T08:38:09.297706Z","iopub.status.idle":"2026-04-02T08:38:09.301128Z","shell.execute_reply.started":"2026-04-02T08:38:09.297672Z","shell.execute_reply":"2026-04-02T08:38:09.300548Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"with open('/kaggle/input/competitions/cassava-leaf-disease-classification/label_num_to_disease_map.json') as file:\n    print(\"yes\")","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-02T08:39:14.692807Z","iopub.execute_input":"2026-04-02T08:39:14.693591Z","iopub.status.idle":"2026-04-02T08:39:14.702023Z","shell.execute_reply.started":"2026-04-02T08:39:14.693560Z","shell.execute_reply":"2026-04-02T08:39:14.701263Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"# Step 1: Load and inspect label map (mapping from numerical labels to disease names)\nlabel_map_path = os.path.join(BASE_DIR, \"label_num_to_disease_map.json\")\n\nwith open(label_map_path, \"r\") as file:\n    map_classes = json.load(file)\n\n# Convert keys to integers (JSON stores keys as strings)\nmap_classes = {int(k): v for k, v in map_classes.items()}\n\n# Display the mapping\nprint(\"Class Mapping:\")\nprint(json.dumps(map_classes, indent=4))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-02T08:40:54.389544Z","iopub.execute_input":"2026-04-02T08:40:54.390370Z","iopub.status.idle":"2026-04-02T08:40:54.404144Z","shell.execute_reply.started":"2026-04-02T08:40:54.390339Z","shell.execute_reply":"2026-04-02T08:40:54.403587Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"os.listdir(os.path.join(BASE_DIR, 'train_images'))","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-04-02T08:42:21.068469Z","iopub.execute_input":"2026-04-02T08:42:21.069156Z","iopub.status.idle":"2026-04-02T08:42:21.307607Z","shell.execute_reply.started":"2026-04-02T08:42:21.069124Z","shell.execute_reply":"2026-04-02T08:42:21.306980Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}