|
22 | 22 | }, |
23 | 23 | { |
24 | 24 | "cell_type": "code", |
25 | | - "execution_count": 1, |
| 25 | + "execution_count": null, |
26 | 26 | "id": "0751accd", |
27 | 27 | "metadata": {}, |
28 | 28 | "outputs": [], |
|
32 | 32 | }, |
33 | 33 | { |
34 | 34 | "cell_type": "code", |
35 | | - "execution_count": 2, |
| 35 | + "execution_count": null, |
36 | 36 | "id": "10662c95", |
37 | 37 | "metadata": {}, |
38 | | - "outputs": [ |
39 | | - { |
40 | | - "data": { |
41 | | - "text/plain": [ |
42 | | - "<Connection to 'http://127.0.0.1:8000/' with BasicBearerAuth>" |
43 | | - ] |
44 | | - }, |
45 | | - "execution_count": 2, |
46 | | - "metadata": {}, |
47 | | - "output_type": "execute_result" |
48 | | - } |
49 | | - ], |
| 38 | + "outputs": [], |
50 | 39 | "source": [ |
51 | 40 | "connection = openeo.connect(\"http://127.0.0.1:8000\")\n", |
52 | 41 | "connection.authenticate_basic(\"user\", \"password\")" |
|
62 | 51 | }, |
63 | 52 | { |
64 | 53 | "cell_type": "code", |
65 | | - "execution_count": 3, |
| 54 | + "execution_count": null, |
66 | 55 | "id": "76f35649", |
67 | 56 | "metadata": {}, |
68 | | - "outputs": [ |
69 | | - { |
70 | | - "name": "stdout", |
71 | | - "output_type": "stream", |
72 | | - "text": [ |
73 | | - "Available collections: ['mpc-landsat-c2-l2', 'mpc-sentinel-2-l2a', 'mpc-sentinel-1-grd', 'mpc-sentinel-1-rtc', 'aws-sentinel-2-l2a', 'aws-landsat-c2-l2', 'cdse-sentinel-2-l2a']\n", |
74 | | - "\n", |
75 | | - "Available processes: ['load_collection', 'mlm_class_random_forest', 'mlm_class_svm', 'mlm_class_xgboost', 'ml_class_mlp', 'mlm_class_tempcnn', 'mlm_class_tae', 'mlm_class_lighttae', 'ml_fit', 'ml_predict', 'ml_validate', 'ml_validate_kfold', 'ml_tune_grid', 'ml_tune_random', 'ml_predict_probabilities', 'ml_uncertainty_class', 'ml_smooth_class', 'ml_label_class', 'cube_regularize', 'ndvi', 'merge_cubes', 'filter_bands', 'save_result', 'load_result', 'export_cube', 'import_cube', 'export_ml_model', 'import_ml_model', 'save_ml_model', 'load_stac_ml', 'load_ml_model']\n" |
76 | | - ] |
77 | | - } |
78 | | - ], |
| 57 | + "outputs": [], |
79 | 58 | "source": [ |
80 | 59 | "print(\"Available collections:\", connection.list_collection_ids())\n", |
81 | 60 | "print(\"\\nAvailable processes:\", [p[\"id\"] for p in connection.list_processes()])" |
|
91 | 70 | }, |
92 | 71 | { |
93 | 72 | "cell_type": "code", |
94 | | - "execution_count": 4, |
| 73 | + "execution_count": null, |
95 | 74 | "id": "24c76f46", |
96 | 75 | "metadata": {}, |
97 | 76 | "outputs": [], |
|
116 | 95 | }, |
117 | 96 | { |
118 | 97 | "cell_type": "code", |
119 | | - "execution_count": 5, |
| 98 | + "execution_count": null, |
120 | 99 | "id": "98ebca43", |
121 | 100 | "metadata": {}, |
122 | 101 | "outputs": [], |
123 | 102 | "source": [ |
124 | 103 | "datacube = connection.load_collection(\n", |
125 | | - " \"aws-sentinel-2-l2a\",\n", |
| 104 | + " \"mpc-sentinel-2-l2a\",\n", |
126 | 105 | " spatial_extent=bbox,\n", |
127 | 106 | " temporal_extent=temporal_extent\n", |
128 | 107 | ")" |
|
138 | 117 | }, |
139 | 118 | { |
140 | 119 | "cell_type": "code", |
141 | | - "execution_count": 6, |
| 120 | + "execution_count": null, |
142 | 121 | "id": "d94d6c9e", |
143 | 122 | "metadata": {}, |
144 | 123 | "outputs": [], |
|
163 | 142 | }, |
164 | 143 | { |
165 | 144 | "cell_type": "code", |
166 | | - "execution_count": 7, |
| 145 | + "execution_count": null, |
167 | 146 | "id": "1fef4727", |
168 | 147 | "metadata": {}, |
169 | 148 | "outputs": [], |
|
181 | 160 | }, |
182 | 161 | { |
183 | 162 | "cell_type": "code", |
184 | | - "execution_count": 8, |
| 163 | + "execution_count": null, |
185 | 164 | "id": "b26c07aa", |
186 | 165 | "metadata": {}, |
187 | 166 | "outputs": [], |
|
199 | 178 | }, |
200 | 179 | { |
201 | 180 | "cell_type": "code", |
202 | | - "execution_count": 9, |
| 181 | + "execution_count": null, |
203 | 182 | "id": "2da13a45", |
204 | 183 | "metadata": {}, |
205 | 184 | "outputs": [], |
|
221 | 200 | }, |
222 | 201 | { |
223 | 202 | "cell_type": "code", |
224 | | - "execution_count": 10, |
| 203 | + "execution_count": null, |
225 | 204 | "id": "31cc072e", |
226 | 205 | "metadata": {}, |
227 | 206 | "outputs": [], |
|
246 | 225 | }, |
247 | 226 | { |
248 | 227 | "cell_type": "code", |
249 | | - "execution_count": 11, |
| 228 | + "execution_count": null, |
250 | 229 | "id": "daa43808", |
251 | 230 | "metadata": {}, |
252 | 231 | "outputs": [], |
|
266 | 245 | }, |
267 | 246 | { |
268 | 247 | "cell_type": "code", |
269 | | - "execution_count": 12, |
| 248 | + "execution_count": null, |
270 | 249 | "id": "13611ba7", |
271 | 250 | "metadata": {}, |
272 | | - "outputs": [ |
273 | | - { |
274 | | - "data": { |
275 | | - "text/html": [ |
276 | | - "\n", |
277 | | - " <script>\n", |
278 | | - " if (!window.customElements || !window.customElements.get('openeo-model-builder')) {\n", |
279 | | - " var el = document.createElement('script');\n", |
280 | | - " el.src = \"https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.min.js\";\n", |
281 | | - " document.head.appendChild(el);\n", |
282 | | - "\n", |
283 | | - " var font = document.createElement('font');\n", |
284 | | - " font.as = \"font\";\n", |
285 | | - " font.type = \"font/woff2\";\n", |
286 | | - " font.crossOrigin = true;\n", |
287 | | - " font.href = \"https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2\"\n", |
288 | | - " document.head.appendChild(font);\n", |
289 | | - " }\n", |
290 | | - " </script>\n", |
291 | | - " <openeo-model-builder>\n", |
292 | | - " <script type=\"application/json\">{\"id\": \"4cc9ca2532094316b844d16ab271de4e\", \"explicit-zoom\": true, \"height\": \"400px\", \"value\": {\"process_graph\": {\"mlmclasstempcnn1\": {\"process_id\": \"mlm_class_tempcnn\", \"arguments\": {\"batch_size\": 64, \"cnn_dropout_rates\": [0.2, 0.2, 0.2], \"cnn_kernels\": [7, 7, 7], \"cnn_layers\": [256, 256, 256], \"dense_layer_dropout_rate\": 0.5, \"dense_layer_nodes\": 256, \"epochs\": 100, \"learning_rate\": 0.0005, \"optimizer\": \"adam\", \"seed\": 42, \"verbose\": false}}, \"mlfit1\": {\"process_id\": \"ml_fit\", \"arguments\": {\"model\": {\"from_node\": \"mlmclasstempcnn1\"}, \"target\": \"label\", \"training_set\": \"https://github.com/Open-Earth-Monitor/openeocraft/raw/main/inst/demo-paper-2025/data/samples_deforestation_rondonia.rds\"}}, \"savemlmodel1\": {\"process_id\": \"save_ml_model\", \"arguments\": {\"data\": {\"from_node\": \"mlfit1\"}, \"name\": \"tempcnn_rondonia\", \"options\": {}}, \"result\": true}}}}</script>\n", |
293 | | - " </openeo-model-builder>\n", |
294 | | - " " |
295 | | - ], |
296 | | - "text/plain": [ |
297 | | - "<openeo.rest.ml_extension.MLModel at 0x114ba1750>" |
298 | | - ] |
299 | | - }, |
300 | | - "execution_count": 12, |
301 | | - "metadata": {}, |
302 | | - "output_type": "execute_result" |
303 | | - } |
304 | | - ], |
| 251 | + "outputs": [], |
305 | 252 | "source": [ |
306 | 253 | "tempcnn_model.save_ml_model(name=\"tempcnn_rondonia\")" |
307 | 254 | ] |
|
318 | 265 | }, |
319 | 266 | { |
320 | 267 | "cell_type": "code", |
321 | | - "execution_count": 13, |
| 268 | + "execution_count": null, |
322 | 269 | "id": "1fb2d7cb", |
323 | 270 | "metadata": {}, |
324 | 271 | "outputs": [], |
|
328 | 275 | }, |
329 | 276 | { |
330 | 277 | "cell_type": "code", |
331 | | - "execution_count": 14, |
| 278 | + "execution_count": null, |
332 | 279 | "id": "d49d7f98", |
333 | 280 | "metadata": {}, |
334 | | - "outputs": [ |
335 | | - { |
336 | | - "data": { |
337 | | - "text/html": [ |
338 | | - "\n", |
339 | | - " <script>\n", |
340 | | - " if (!window.customElements || !window.customElements.get('openeo-model-builder')) {\n", |
341 | | - " var el = document.createElement('script');\n", |
342 | | - " el.src = \"https://cdn.jsdelivr.net/npm/@openeo/vue-components@2/assets/openeo.min.js\";\n", |
343 | | - " document.head.appendChild(el);\n", |
344 | | - "\n", |
345 | | - " var font = document.createElement('font');\n", |
346 | | - " font.as = \"font\";\n", |
347 | | - " font.type = \"font/woff2\";\n", |
348 | | - " font.crossOrigin = true;\n", |
349 | | - " font.href = \"https://use.fontawesome.com/releases/v5.13.0/webfonts/fa-solid-900.woff2\"\n", |
350 | | - " document.head.appendChild(font);\n", |
351 | | - " }\n", |
352 | | - " </script>\n", |
353 | | - " <openeo-model-builder>\n", |
354 | | - " <script type=\"application/json\">{\"id\": \"b1eba19a6b924eea92eeeb74fecfb2f1\", \"explicit-zoom\": true, \"height\": \"400px\", \"value\": {\"process_graph\": {\"loadcollection1\": {\"process_id\": \"load_collection\", \"arguments\": {\"id\": \"aws-sentinel-2-l2a\", \"spatial_extent\": {\"west\": -63.33, \"south\": -12.03, \"east\": -62.43, \"north\": -11.13, \"crs\": 4326}, \"temporal_extent\": [\"2022-01-01\", \"2022-12-31\"]}}, \"cuberegularize1\": {\"process_id\": \"cube_regularize\", \"arguments\": {\"data\": {\"from_node\": \"loadcollection1\"}, \"period\": \"P16D\", \"resolution\": 300}}, \"ndvi1\": {\"process_id\": \"ndvi\", \"arguments\": {\"data\": {\"from_node\": \"cuberegularize1\"}, \"nir\": \"B08\", \"red\": \"B04\", \"target_band\": \"NDVI\"}}, \"mlmclasstempcnn1\": {\"process_id\": \"mlm_class_tempcnn\", \"arguments\": {\"batch_size\": 64, \"cnn_dropout_rates\": [0.2, 0.2, 0.2], \"cnn_kernels\": [7, 7, 7], \"cnn_layers\": [256, 256, 256], \"dense_layer_dropout_rate\": 0.5, \"dense_layer_nodes\": 256, \"epochs\": 100, \"learning_rate\": 0.0005, \"optimizer\": \"adam\", \"seed\": 42, \"verbose\": false}}, \"mlfit1\": {\"process_id\": \"ml_fit\", \"arguments\": {\"model\": {\"from_node\": \"mlmclasstempcnn1\"}, \"target\": \"label\", \"training_set\": \"https://github.com/Open-Earth-Monitor/openeocraft/raw/main/inst/demo-paper-2025/data/samples_deforestation_rondonia.rds\"}}, \"mlpredict1\": {\"process_id\": \"ml_predict\", \"arguments\": {\"data\": {\"from_node\": \"ndvi1\"}, \"model\": {\"from_node\": \"mlfit1\"}}}, \"saveresult1\": {\"process_id\": \"save_result\", \"arguments\": {\"data\": {\"from_node\": \"mlpredict1\"}, \"format\": \"GeoTiff\", \"options\": {}}, \"result\": true}}}}</script>\n", |
355 | | - " </openeo-model-builder>\n", |
356 | | - " " |
357 | | - ], |
358 | | - "text/plain": [ |
359 | | - "<openeo.rest.result.SaveResult at 0x10a230b20>" |
360 | | - ] |
361 | | - }, |
362 | | - "execution_count": 14, |
363 | | - "metadata": {}, |
364 | | - "output_type": "execute_result" |
365 | | - } |
366 | | - ], |
| 281 | + "outputs": [], |
367 | 282 | "source": [ |
368 | 283 | "result" |
369 | 284 | ] |
370 | 285 | }, |
371 | 286 | { |
372 | 287 | "cell_type": "code", |
373 | | - "execution_count": 15, |
| 288 | + "execution_count": null, |
374 | 289 | "id": "e9777398", |
375 | 290 | "metadata": {}, |
376 | 291 | "outputs": [], |
|
383 | 298 | }, |
384 | 299 | { |
385 | 300 | "cell_type": "code", |
386 | | - "execution_count": 16, |
| 301 | + "execution_count": null, |
387 | 302 | "id": "db973d75", |
388 | 303 | "metadata": {}, |
389 | | - "outputs": [ |
390 | | - { |
391 | | - "name": "stdout", |
392 | | - "output_type": "stream", |
393 | | - "text": [ |
394 | | - "0:00:00 Job '444dbf2f651d5451cb0085cd5f7bbd3c': send 'start'\n", |
395 | | - "0:00:03 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
396 | | - "0:00:08 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
397 | | - "0:00:15 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
398 | | - "0:00:23 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
399 | | - "0:00:32 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
400 | | - "0:00:45 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
401 | | - "0:01:00 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
402 | | - "0:01:19 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
403 | | - "0:01:43 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
404 | | - "0:02:13 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
405 | | - "0:02:50 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
406 | | - "0:03:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
407 | | - "0:04:35 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
408 | | - "0:05:35 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
409 | | - "0:06:35 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
410 | | - "0:07:35 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
411 | | - "0:08:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
412 | | - "0:09:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
413 | | - "0:10:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
414 | | - "0:11:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
415 | | - "0:12:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
416 | | - "0:13:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
417 | | - "0:14:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
418 | | - "0:15:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
419 | | - "0:16:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
420 | | - "0:17:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
421 | | - "0:18:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
422 | | - "0:19:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
423 | | - "0:20:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
424 | | - "0:21:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
425 | | - "0:22:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
426 | | - "0:23:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
427 | | - "0:24:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
428 | | - "0:25:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': running (progress N/A)\n", |
429 | | - "0:26:36 Job '444dbf2f651d5451cb0085cd5f7bbd3c': finished (progress N/A)\n" |
430 | | - ] |
431 | | - }, |
432 | | - { |
433 | | - "data": { |
434 | | - "text/plain": [ |
435 | | - "[PosixPath('data/output_month/openeocraft_merged.tif'),\n", |
436 | | - " PosixPath('data/output_month/job-results.json')]" |
437 | | - ] |
438 | | - }, |
439 | | - "execution_count": 16, |
440 | | - "metadata": {}, |
441 | | - "output_type": "execute_result" |
442 | | - } |
443 | | - ], |
| 304 | + "outputs": [], |
444 | 305 | "source": [ |
445 | 306 | "job.start_and_wait()\n", |
446 | 307 | "results = job.get_results()\n", |
|
0 commit comments