From aec4d213cfac225422ade79276a552d633e4c0b8 Mon Sep 17 00:00:00 2001 From: hienp Date: Fri, 3 Apr 2026 14:40:58 +0700 Subject: [PATCH] =?UTF-8?q?=C4=91=C3=A3=20ch=E1=BA=A1y=20=C4=91=C6=B0?= =?UTF-8?q?=E1=BB=A3c=20Mic=20supplyer=20tr=C3=AAn=20ODC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .stfolder/syncthing-folder-a35f20.txt | 5 +++++ 01.train_ODC_local_with_Mic_supplyer.ipynb | 24 ++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .stfolder/syncthing-folder-a35f20.txt diff --git a/.stfolder/syncthing-folder-a35f20.txt b/.stfolder/syncthing-folder-a35f20.txt new file mode 100644 index 0000000..b8b42f9 --- /dev/null +++ b/.stfolder/syncthing-folder-a35f20.txt @@ -0,0 +1,5 @@ +# This directory is a Syncthing folder marker. +# Do not delete. + +folderID: rs-data +created: 2026-04-03T11:35:19+07:00 diff --git a/01.train_ODC_local_with_Mic_supplyer.ipynb b/01.train_ODC_local_with_Mic_supplyer.ipynb index 4ddb4b2..6e59c33 100644 --- a/01.train_ODC_local_with_Mic_supplyer.ipynb +++ b/01.train_ODC_local_with_Mic_supplyer.ipynb @@ -135,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "3cd69645", "metadata": {}, "outputs": [ @@ -830,34 +830,36 @@ " date = item.datetime.strftime(\"%Y-%m-%d\")\n", " cloud = item.properties.get(\"eo:cloud_cover\", \"N/A\")\n", " print(f\" [{i+1}] {date} - Cloud: {cloud}%\")\n", - " \n", + "\n", " # Re-sign items to ensure fresh URLs (keep as pystac objects)\n", " print(f\"\\n🔑 Signing STAC items...\")\n", " items_s2 = [planetary_computer.sign(item) for item in items_s2]\n", - " \n", - " # Load Sentinel-2 data (without Dask chunks)\n", - " print(f\"\\n⏳ Loading Sentinel-2 data...\")\n", + "\n", + " # Load Sentinel-2 data with 6 spectral bands for better classification\n", + " print(f\"\\n⏳ Loading Sentinel-2 data (6 bands for improved accuracy)...\")\n", " ds_s2 = stac_load(\n", " items_s2,\n", - " bands=[\"B04\", \"B08\", \"SCL\"], # Red (B04), NIR (B08), Scene Classification (SCL)\n", + " bands=[\"B02\", \"B03\", \"B04\", \"B08\", \"B11\", \"B12\", \"SCL\"], # Blue, Green, Red, NIR, SWIR1, SWIR2, SCL\n", " crs=\"EPSG:32648\",\n", " resolution=20, # 20m resolution (4x smaller data than 10m)\n", " bbox=bbox,\n", " patch_url=planetary_computer.sign, # Re-sign URLs during loading\n", " fail_on_error=False, # Skip problematic tiles instead of crashing\n", " )\n", - " \n", + "\n", " # Rename bands to simpler names\n", - " ds_s2 = ds_s2.rename({\"B04\": \"red\", \"B08\": \"nir\", \"SCL\": \"scl\"})\n", - " \n", + " ds_s2 = ds_s2.rename({\"B02\": \"blue\", \"B03\": \"green\", \"B04\": \"red\",\n", + " \"B08\": \"nir\", \"B11\": \"swir1\", \"B12\": \"swir2\", \"SCL\": \"scl\"})\n", + "\n", " print(f\"\\n✅ Sentinel-2 loaded!\")\n", " print(f\" Shape: {dict(ds_s2.dims)}\")\n", " print(f\" Variables: {list(ds_s2.data_vars)}\")\n", + " print(f\" Bands: blue, green, red, nir, swir1, swir2, scl\")\n", " display(ds_s2)\n", "else:\n", " print(f\"❌ No Sentinel-2 scenes found\")\n", - "\n", - " ds_s2 = Noneprint(\"=\"*70)\n" + " ds_s2 = None\n", + "print(\"=\"*70)\n" ] }, {