diff --git a/Machine_Learning/notebook.ipynb b/Machine_Learning/notebook.ipynb index d863e0a..02538b6 100644 --- a/Machine_Learning/notebook.ipynb +++ b/Machine_Learning/notebook.ipynb @@ -170,7 +170,7 @@ "outputId": "30228ce8-1b64-47f5-93f7-30632b2af1c5" }, "outputs": [], - "source": "if IS_COLAB:\n drive.mount('/content/drive')\n archive_path = '/content/drive/MyDrive/jagung/dataset_jagung.zip'\n destination_path = '/content/dataset_jagung.zip'\n extract_path = '/content/dataset'\nelse:\n import gdown\n base = os.getcwd()\n archive_path = os.path.join(base, 'dataset_jagung.zip')\n destination_path = archive_path\n extract_path = os.path.join(base, 'dataset')\n # If dataset doesn't exist locally, download from Google Drive\n DRIVE_FILE_ID = \"1iP1J5o-wJZXslI21TF0H9txNvFgV0tFZ\"\n if not os.path.exists(archive_path):\n print(\"Dataset not found locally. Downloading from Google Drive...\")\n try:\n gdown.download(f\"https://drive.google.com/uc?id={DRIVE_FILE_ID}\", archive_path, quiet=False)\n except Exception as e:\n print(f\"Download failed: {e}\")\n\nif os.path.exists(destination_path):\n if not os.path.exists(extract_path) or len(os.listdir(extract_path)) == 0:\n os.makedirs(extract_path, exist_ok=True)\n print(\"Extracting dataset...\")\n try:\n with zipfile.ZipFile(destination_path, 'r') as zip_ref:\n zip_ref.extractall(path=extract_path)\n print(\"Extraction completed!\")\n except Exception as e:\n print(f\"Extraction failed: {e}\")\n else:\n print(\"Dataset is already extracted and ready for use.\")" + "source": "if IS_COLAB:\n drive.mount('/content/drive')\n archive_path = '/content/drive/MyDrive/jagung/dataset_jagung.zip'\n destination_path = '/content/dataset_jagung.zip'\n extract_path = '/content/dataset'\nelse:\n import gdown\n base = os.getcwd()\n archive_path = os.path.join(base, 'dataset_jagung.zip')\n destination_path = archive_path\n extract_path = os.path.join(base, 'dataset')\n # If dataset doesn't exist locally, download from Google Drive\n DRIVE_FILE_ID = \"1s0H2lDOQVCixywk5eZXJz2i9jj4JihxJ\"\n if not os.path.exists(archive_path):\n print(\"Dataset not found locally. Downloading from Google Drive...\")\n try:\n gdown.download(f\"https://drive.google.com/uc?id={DRIVE_FILE_ID}\", archive_path, quiet=False)\n except Exception as e:\n print(f\"Download failed: {e}\")\n\nif os.path.exists(destination_path):\n if not os.path.exists(extract_path) or len(os.listdir(extract_path)) == 0:\n os.makedirs(extract_path, exist_ok=True)\n print(\"Extracting dataset...\")\n try:\n with zipfile.ZipFile(destination_path, 'r') as zip_ref:\n zip_ref.extractall(path=extract_path)\n print(\"Extraction completed!\")\n except Exception as e:\n print(f\"Extraction failed: {e}\")\n else:\n print(\"Dataset is already extracted and ready for use.\")" }, { "cell_type": "markdown",