Skip to content

Commit 8656f93

Browse files
authored
Fixed notebook typos (#78)
1 parent 9e51251 commit 8656f93

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

docs/examples/text_prompts.ipynb

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
33-
"# %pip install segment-geospatial leafmap localtileserver"
33+
"# %pip install segment-geospatial groundingdino-py leafmap localtileserver"
3434
]
3535
},
3636
{
@@ -56,15 +56,7 @@
5656
"cell_type": "code",
5757
"execution_count": null,
5858
"metadata": {},
59-
"outputs": [
60-
{
61-
"name": "stderr",
62-
"output_type": "stream",
63-
"text": [
64-
"No such comm: 96754273fbc94aabbf75b0f2bebca8cd\n"
65-
]
66-
}
67-
],
59+
"outputs": [],
6860
"source": [
6961
"m = leafmap.Map(center=[-22.17615, -51.253043], zoom=18, height=\"800px\")\n",
7062
"m.add_basemap(\"SATELLITE\")\n",
@@ -98,7 +90,7 @@
9890
"outputs": [],
9991
"source": [
10092
"image = \"Image.tif\"\n",
101-
"tms_to_geotiff(output=image, bbox=bbox, zoom=18, source=\"Satellite\", overwrite=True)"
93+
"tms_to_geotiff(output=image, bbox=bbox, zoom=19, source=\"Satellite\", overwrite=True)"
10294
]
10395
},
10496
{
@@ -139,7 +131,9 @@
139131
"cell_type": "markdown",
140132
"metadata": {},
141133
"source": [
142-
"## Initialize LangSAM class"
134+
"## Initialize LangSAM class\n",
135+
"\n",
136+
"The initialization of the LangSAM class might take a few minutes. The initialization downloads the model weights and sets up the model for inference."
143137
]
144138
},
145139
{
@@ -173,7 +167,7 @@
173167
"source": [
174168
"## Segment the image\n",
175169
"\n",
176-
"Part of the model prediction includes setting appropriate thresholds for object detection and text association with the detected objects. These threshold values range between 0 to 1 and are set while calling the predict method of the LangSAM class.\n",
170+
"Part of the model prediction includes setting appropriate thresholds for object detection and text association with the detected objects. These threshold values range from 0 to 1 and are set while calling the predict method of the LangSAM class.\n",
177171
"\n",
178172
"`box_threshold`: This value is used for object detection in the image. A higher value makes the model more selective, identifying only the most confident object instances, leading to fewer overall detections. A lower value, conversely, makes the model more tolerant, leading to increased detections, including potentially less confident ones.\n",
179173
"\n",
@@ -188,7 +182,7 @@
188182
"metadata": {},
189183
"outputs": [],
190184
"source": [
191-
"sam.predict('trees.tif', text_prompt, box_threshold=0.24, text_threshold=0.24)"
185+
"sam.predict(image, text_prompt, box_threshold=0.24, text_threshold=0.24)"
192186
]
193187
},
194188
{
@@ -208,6 +202,7 @@
208202
" cmap='Greens', \n",
209203
" box_color='red', \n",
210204
" title='Automatic Segmentation of Trees', \n",
205+
" blend=False,\n",
211206
" output='trees.tif'\n",
212207
")"
213208
]
@@ -216,7 +211,7 @@
216211
"cell_type": "markdown",
217212
"metadata": {},
218213
"source": [
219-
"![](https://i.imgur.com/3BAsQj3.png)"
214+
"![](https://i.imgur.com/ytKMTlA.png)"
220215
]
221216
}
222217
],

0 commit comments

Comments
 (0)