\n",
"
Cropland definition: \n",
@@ -55,9 +56,15 @@
"source": [
"### 1. Define your region of interest\n",
"\n",
- "When running the code snippet below, an interactive map will be visualized. Click the Rectangle button on the left hand side of the map to start drawing your region of interest.\n",
+ "When running the code snippet below, an interactive map will be visualized.\n",
+ "Click the Rectangle button on the left hand side of the map to start drawing your region of interest.\n",
+ "\n",
+ "Currently, there is a maximum size of 250 km² for your area within this demo. Upon exceeding this limit, an error will be shown.\n",
+ "You can bypass this limit by altering the code below to:
\n",
+ "*map = ui_map(area_limit=750)*
\n",
+ "\n",
+ "Processing areas beyond 750 km² are currently not supported.\n",
"\n",
- "In case your region exceeds the 250 km² limit, you will be asked to draw again.\n",
"The widget will automatically store the coordinates of the last rectangle you drew on the map."
]
},
@@ -146,6 +153,7 @@
"from worldcereal.job import PostprocessParameters\n",
"import os\n",
"from pathlib import Path\n",
+ "from utils import get_input\n",
"\n",
"# Choose whether or not you want to spatially clean the classification results\n",
"postprocess_result = True\n",
@@ -153,7 +161,8 @@
"postprocess_parameters = PostprocessParameters(enable=postprocess_result)\n",
"\n",
"# Specify the local directory where the resulting maps should be downloaded to.\n",
- "output_dir = Path(os.getcwd()) / 'CROPLAND_test'\n",
+ "run = get_input('model run')\n",
+ "output_dir = Path(os.getcwd()) / f'CROPLAND_default_{run}'\n",
"print(f\"Output directory: {output_dir}\")"
]
},
diff --git a/notebooks/worldcereal_v1_demo_default_cropland_extended.ipynb b/notebooks/worldcereal_v1_demo_default_cropland_extended.ipynb
index 69ece2fb..da1d6555 100644
--- a/notebooks/worldcereal_v1_demo_default_cropland_extended.ipynb
+++ b/notebooks/worldcereal_v1_demo_default_cropland_extended.ipynb
@@ -16,7 +16,7 @@
"This notebook contains a short demo on how to use the WorldCereal system to generate a cropland extent map for your area and season of interest.
\n",
"The map is generated using a default model trained by the WorldCereal consortium to distinguish cropland from all other land use.\n",
"\n",
- "Please note that for the purpose of this demo, the processing area is currently limited to 250 km² per model run.\n",
+ "Please note that for the purpose of this demo, the processing area is currently limited to 250 km² per model run. On average, one such run consumes xxx credits on the Copernicus Data Space Ecosystem.\n",
"\n",
"
\n",
"Cropland definition: \n",
@@ -55,9 +55,15 @@
"source": [
"### 1. Define your region of interest\n",
"\n",
- "When running the code snippet below, an interactive map will be visualized. Click the Rectangle button on the left hand side of the map to start drawing your region of interest.\n",
+ "When running the code snippet below, an interactive map will be visualized.\n",
+ "Click the Rectangle button on the left hand side of the map to start drawing your region of interest.\n",
+ "\n",
+ "Currently, there is a maximum size of 250 km² for your area within this demo. Upon exceeding this limit, an error will be shown.\n",
+ "You can bypass this limit by altering the code below to:
\n",
+ "*map = ui_map(area_limit=750)*
\n",
+ "\n",
+ "Processing areas beyond 750 km² are currently not supported.\n",
"\n",
- "In case your region exceeds the 250 km² limit, you will be asked to draw again.\n",
"The widget will automatically store the coordinates of the last rectangle you drew on the map."
]
},
@@ -146,17 +152,22 @@
"from worldcereal.job import PostprocessParameters\n",
"import os\n",
"from pathlib import Path\n",
+ "from utils import get_input\n",
"\n",
- "# Choose whether or not you want to spatially clean the classification results (default = True)\n",
+ "# Choose whether or not you want to spatially clean the classification results\n",
"postprocess_result = True\n",
- "# Choose the postprocessing method you want to use [\"smooth_probabilities\", \"majority_vote\"] (default = \"smooth_probabilities\")\n",
+ "# Choose the postprocessing method you want to use [\"smooth_probabilities\", \"majority_vote\"]\n",
+ "# (\"smooth_probabilities will do limited spatial cleaning,\n",
+ "# while \"majority_vote\" will do more aggressive spatial cleaning, depending on the value of kernel_size)\n",
"postprocess_method = \"majority_vote\"\n",
- "# Additiona parameters for the majority vote method:\n",
- "kernel_size = 3 # default = 5\n",
+ "# Additional parameter for the majority vote method \n",
+ "# (the higher the value, the more aggressive the spatial cleaning,\n",
+ "# should be an odd number, not larger than 25, default = 5)\n",
+ "kernel_size = 5\n",
"# Do you want to save the intermediate results (before applying the postprocessing)\n",
- "save_intermediate = True # default is False\n",
+ "save_intermediate = True\n",
"# Do you want to save all class probabilities in the final product? \n",
- "keep_class_probs = True # default is False\n",
+ "keep_class_probs = True\n",
"\n",
"postprocess_parameters = PostprocessParameters(enable=postprocess_result,\n",
" method=postprocess_method,\n",
@@ -165,7 +176,8 @@
" keep_class_probs=keep_class_probs)\n",
"\n",
"# Specify the local directory where the resulting maps should be downloaded to.\n",
- "output_dir = Path(os.getcwd()) / 'CROPLAND_test'\n",
+ "run = get_input('model run')\n",
+ "output_dir = Path(os.getcwd()) / f'CROPLAND_default_{run}'\n",
"print(f\"Output directory: {output_dir}\")"
]
},