Skip to content

Commit 6a479c0

Browse files
committed
Address comments
1 parent c7fd2df commit 6a479c0

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

Analyzing_Data/Raster_Text_To_Segments.ipynb

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
"cell_type": "markdown",
4040
"metadata": {},
4141
"source": [
42-
"## Load NAIP imagery for Maimi Airport\n",
42+
"## Load NAIP imagery for Miami Airport\n",
4343
"\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",
4545
"Spliting the large GeoTIFF into small tiles improves the distribution of workload across the cluster."
4646
]
4747
},
@@ -72,7 +72,7 @@
7272
"Before running inference, it’s useful to explore the imagery itself. \n",
7373
"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",
7474
"\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()`."
7676
]
7777
},
7878
{
@@ -102,17 +102,19 @@
102102
"cell_type": "markdown",
103103
"metadata": {},
104104
"source": [
105-
"## Running Segementation using SAM2 model\n",
105+
"## Running segementation using SAM2 model\n",
106106
"\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",
108108
"\n",
109-
"For this example, we specify the follwing parameters -\n",
109+
"For this example, we specify the following parameters -\n",
110110
"- Model: `\"sam2\"`\n",
111111
"- Text prompt: `\"airplanes\"`\n",
112112
"- Confidence threshold: `0.5`\n",
113113
"\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",
115116
"\n",
117+
"The function returns predicted segments for each raster in our region of interest.\n",
116118
"We’ll cache the results for efficiency and register them as a temporary view so we can explore them further."
117119
]
118120
},
@@ -343,6 +345,14 @@
343345
"preds_filtered.show()"
344346
]
345347
},
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+
},
346356
{
347357
"cell_type": "code",
348358
"execution_count": null,
@@ -442,7 +452,7 @@
442452
"cell_type": "markdown",
443453
"metadata": {},
444454
"source": [
445-
"## <span style=\"color: #7b73e2;\">Next Steps with Raster Inference</span>\n",
455+
"## Next Steps with Raster Inference\n",
446456
"\n",
447457
"With access to general-purpose, text-promptable models, what will you predict and georeference next?\n",
448458
"\n",
@@ -454,6 +464,11 @@
454464
"\n",
455465
"We're excited to hear about what you're doing with SAM2 and OWLv2! "
456466
]
467+
},
468+
{
469+
"cell_type": "markdown",
470+
"metadata": {},
471+
"source": []
457472
}
458473
],
459474
"metadata": {

0 commit comments

Comments
 (0)