|
39 | 39 | "cell_type": "markdown", |
40 | 40 | "metadata": {}, |
41 | 41 | "source": [ |
42 | | - "## Load NAIP imagery for Maimi Airport\n", |
| 42 | + "## Load NAIP imagery for Miami Airport\n", |
43 | 43 | "\n", |
44 | | - "We will use the native raster reader to load Geotiffs as out-of-database or \"out-db\" rasters and perform dyanamic tiling on read.\n", |
| 44 | + "We will use the native raster reader to load GeoTIFFs as out-of-database or \"out-db\" rasters and perform dyanamic tiling on read.\n", |
45 | 45 | "Spliting the large GeoTIFF into small tiles improves the distribution of workload across the cluster." |
46 | 46 | ] |
47 | 47 | }, |
|
72 | 72 | "Before running inference, it’s useful to explore the imagery itself. \n", |
73 | 73 | "We’ll visualize the footprints of the raster tiles with SedonaKepler and preview a few raw images using SedonaUtils. This gives us confidence that the data is being read correctly and aligned spatially before applying any models.\n", |
74 | 74 | "\n", |
75 | | - "Tip: You can also save the Kepler map as an interactive HTML file with `kepler_map.save_to_html()`." |
| 75 | + "> Tip: You can also save the Kepler map as an interactive HTML file with `kepler_map.save_to_html()`." |
76 | 76 | ] |
77 | 77 | }, |
78 | 78 | { |
|
102 | 102 | "cell_type": "markdown", |
103 | 103 | "metadata": {}, |
104 | 104 | "source": [ |
105 | | - "## Running Segementation using SAM2 model\n", |
| 105 | + "## Running segementation using SAM2 model\n", |
106 | 106 | "\n", |
107 | | - "Now we’ll run inference over the raster tiles using Wherobots’ SQL function `RS_Text_to_Segments()`.\n", |
| 107 | + "Now we’ll run inference over the raster tiles using Wherobots SQL function `RS_Text_to_Segments()`.\n", |
108 | 108 | "\n", |
109 | | - "For this example, we specify the follwing parameters -\n", |
| 109 | + "For this example, we specify the following parameters -\n", |
110 | 110 | "- Model: `\"sam2\"`\n", |
111 | 111 | "- Text prompt: `\"airplanes\"`\n", |
112 | 112 | "- Confidence threshold: `0.5`\n", |
113 | 113 | "\n", |
114 | | - "The function returns predicted segments for each raster in our region of interest.\n", |
| 114 | + "The confidence threshold controls which detections are returned (scores range from 0 to 1). \n", |
| 115 | + "For this particular model, most positives have confidence scores of at most ~0.7, so we start with `0.5` to favor **recall** on this model/dataset. This helps us understand how the model performs before tightening the threshold later.\n", |
115 | 116 | "\n", |
| 117 | + "The function returns predicted segments for each raster in our region of interest.\n", |
116 | 118 | "We’ll cache the results for efficiency and register them as a temporary view so we can explore them further." |
117 | 119 | ] |
118 | 120 | }, |
|
343 | 345 | "preds_filtered.show()" |
344 | 346 | ] |
345 | 347 | }, |
| 348 | + { |
| 349 | + "cell_type": "markdown", |
| 350 | + "metadata": {}, |
| 351 | + "source": [ |
| 352 | + "Each raster tile returns multiple predictions as arrays. \n", |
| 353 | + "We use `explode` to flatten these arrays so every detected object becomes its own row for easier mapping and analysis." |
| 354 | + ] |
| 355 | + }, |
346 | 356 | { |
347 | 357 | "cell_type": "code", |
348 | 358 | "execution_count": null, |
|
442 | 452 | "cell_type": "markdown", |
443 | 453 | "metadata": {}, |
444 | 454 | "source": [ |
445 | | - "## <span style=\"color: #7b73e2;\">Next Steps with Raster Inference</span>\n", |
| 455 | + "## Next Steps with Raster Inference\n", |
446 | 456 | "\n", |
447 | 457 | "With access to general-purpose, text-promptable models, what will you predict and georeference next?\n", |
448 | 458 | "\n", |
|
454 | 464 | "\n", |
455 | 465 | "We're excited to hear about what you're doing with SAM2 and OWLv2! " |
456 | 466 | ] |
| 467 | + }, |
| 468 | + { |
| 469 | + "cell_type": "markdown", |
| 470 | + "metadata": {}, |
| 471 | + "source": [] |
457 | 472 | } |
458 | 473 | ], |
459 | 474 | "metadata": { |
|
0 commit comments