geoai-py 0.3.1__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. {geoai_py-0.3.1 → geoai_py-0.3.2}/PKG-INFO +1 -2
  2. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/building_regularization.ipynb +97 -10
  3. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/__init__.py +1 -1
  4. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/extract.py +253 -142
  5. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/utils.py +94 -0
  6. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/PKG-INFO +1 -2
  7. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/requires.txt +0 -1
  8. {geoai_py-0.3.1 → geoai_py-0.3.2}/pyproject.toml +2 -2
  9. {geoai_py-0.3.1 → geoai_py-0.3.2}/requirements.txt +1 -1
  10. {geoai_py-0.3.1 → geoai_py-0.3.2}/.editorconfig +0 -0
  11. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  12. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  13. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  14. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/dependabot.yml +0 -0
  15. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/docs-build.yml +0 -0
  16. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/docs.yml +0 -0
  17. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/macos.yml +0 -0
  18. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/pypi.yml +0 -0
  19. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/ubuntu.yml +0 -0
  20. {geoai_py-0.3.1 → geoai_py-0.3.2}/.github/workflows/windows.yml +0 -0
  21. {geoai_py-0.3.1 → geoai_py-0.3.2}/.gitignore +0 -0
  22. {geoai_py-0.3.1 → geoai_py-0.3.2}/.pre-commit-config.yaml +0 -0
  23. {geoai_py-0.3.1 → geoai_py-0.3.2}/LICENSE +0 -0
  24. {geoai_py-0.3.1 → geoai_py-0.3.2}/MANIFEST.in +0 -0
  25. {geoai_py-0.3.1 → geoai_py-0.3.2}/README.md +0 -0
  26. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/CNAME +0 -0
  27. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/changelog.md +0 -0
  28. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/contributing.md +0 -0
  29. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/download.md +0 -0
  30. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/building_footprints_usa.ipynb +0 -0
  31. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/data_visualization.ipynb +0 -0
  32. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/dataviz/lidar_viz.ipynb +0 -0
  33. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/dataviz/raster_viz.ipynb +0 -0
  34. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/dataviz/vector_viz.ipynb +0 -0
  35. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/download_data.ipynb +0 -0
  36. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/image_chips.ipynb +0 -0
  37. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/jupytext.toml +0 -0
  38. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/rastervision/semantic_segmentation.ipynb +0 -0
  39. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/arcgis.ipynb +0 -0
  40. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/automatic_mask_generator.ipynb +0 -0
  41. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/automatic_mask_generator_hq.ipynb +0 -0
  42. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/box_prompts.ipynb +0 -0
  43. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/fast_sam.ipynb +0 -0
  44. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/input_prompts.ipynb +0 -0
  45. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/input_prompts_hq.ipynb +0 -0
  46. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/maxar_open_data.ipynb +0 -0
  47. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/satellite-predictor.ipynb +0 -0
  48. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/satellite.ipynb +0 -0
  49. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/swimming_pools.ipynb +0 -0
  50. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/text_prompts.ipynb +0 -0
  51. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/samgeo/text_prompts_batch.ipynb +0 -0
  52. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/examples/view_metadata.ipynb +0 -0
  53. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/extract.md +0 -0
  54. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/faq.md +0 -0
  55. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/geoai.md +0 -0
  56. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/index.md +0 -0
  57. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/installation.md +0 -0
  58. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/overrides/main.html +0 -0
  59. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/preprocess.md +0 -0
  60. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/segmentation.md +0 -0
  61. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/usage.md +0 -0
  62. {geoai_py-0.3.1 → geoai_py-0.3.2}/docs/utils.md +0 -0
  63. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/download.py +0 -0
  64. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/geoai.py +0 -0
  65. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/preprocess.py +0 -0
  66. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai/segmentation.py +0 -0
  67. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/SOURCES.txt +0 -0
  68. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/dependency_links.txt +0 -0
  69. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/entry_points.txt +0 -0
  70. {geoai_py-0.3.1 → geoai_py-0.3.2}/geoai_py.egg-info/top_level.txt +0 -0
  71. {geoai_py-0.3.1 → geoai_py-0.3.2}/mkdocs.yml +0 -0
  72. {geoai_py-0.3.1 → geoai_py-0.3.2}/requirements_docs.txt +0 -0
  73. {geoai_py-0.3.1 → geoai_py-0.3.2}/setup.cfg +0 -0
  74. {geoai_py-0.3.1 → geoai_py-0.3.2}/tests/__init__.py +0 -0
  75. {geoai_py-0.3.1 → geoai_py-0.3.2}/tests/test_geoai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: geoai-py
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: A Python package for using Artificial Intelligence (AI) with geospatial data
5
5
  Author-email: Qiusheng Wu <giswqs@gmail.com>
6
6
  License: MIT License
@@ -31,7 +31,6 @@ Requires-Dist: pystac-client
31
31
  Requires-Dist: rasterio
32
32
  Requires-Dist: rioxarray
33
33
  Requires-Dist: scikit-learn
34
- Requires-Dist: segment-geospatial
35
34
  Requires-Dist: torch
36
35
  Requires-Dist: torchgeo
37
36
  Requires-Dist: tqdm
@@ -50,7 +50,20 @@
50
50
  "metadata": {},
51
51
  "outputs": [],
52
52
  "source": [
53
- "raster_url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_building_masks.tif\""
53
+ "naip_url = (\n",
54
+ " \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_train.tif\"\n",
55
+ ")\n",
56
+ "masks_url = \"https://huggingface.co/datasets/giswqs/geospatial/resolve/main/naip_building_masks.tif\""
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "code",
61
+ "execution_count": null,
62
+ "metadata": {},
63
+ "outputs": [],
64
+ "source": [
65
+ "masks_path = geoai.download_file(masks_url)\n",
66
+ "naip_path = geoai.download_file(naip_url)"
54
67
  ]
55
68
  },
56
69
  {
@@ -59,7 +72,7 @@
59
72
  "metadata": {},
60
73
  "outputs": [],
61
74
  "source": [
62
- "raster_path = geoai.download_file(raster_url)"
75
+ "geoai.view_image(masks_path, figsize=(18, 10))"
63
76
  ]
64
77
  },
65
78
  {
@@ -68,7 +81,17 @@
68
81
  "metadata": {},
69
82
  "outputs": [],
70
83
  "source": [
71
- "geoai.view_image(raster_path, figsize=(18, 10))"
84
+ "geoai.create_split_map(\n",
85
+ " left_layer=masks_url,\n",
86
+ " right_layer=naip_url,\n",
87
+ " left_label=\"Building Masks\",\n",
88
+ " right_label=\"NAIP Imagery\",\n",
89
+ " left_args={\n",
90
+ " \"colormap\": {\"255\": \"#0000ff\"},\n",
91
+ " \"opacity\": 0.5,\n",
92
+ " },\n",
93
+ " basemap=naip_url,\n",
94
+ ")"
72
95
  ]
73
96
  },
74
97
  {
@@ -84,7 +107,7 @@
84
107
  "metadata": {},
85
108
  "outputs": [],
86
109
  "source": [
87
- "gdf = geoai.raster_to_vector(raster_path, output_path=\"naip_building_masks.geojson\")"
110
+ "gdf = geoai.raster_to_vector(masks_path, output_path=\"naip_building_masks.geojson\")"
88
111
  ]
89
112
  },
90
113
  {
@@ -94,7 +117,23 @@
94
117
  "outputs": [],
95
118
  "source": [
96
119
  "geoai.view_vector_interactive(\n",
97
- " gdf, style_kwds={\"color\": \"blue\", \"fillOpacity\": 0}, tiles=\"Satellite\"\n",
120
+ " gdf, style_kwds={\"color\": \"blue\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
121
+ ")"
122
+ ]
123
+ },
124
+ {
125
+ "cell_type": "code",
126
+ "execution_count": null,
127
+ "metadata": {},
128
+ "outputs": [],
129
+ "source": [
130
+ "geoai.create_split_map(\n",
131
+ " left_layer=gdf,\n",
132
+ " right_layer=naip_url,\n",
133
+ " left_label=\"Buildings\",\n",
134
+ " right_label=\"NAIP Imagery\",\n",
135
+ " left_args={\"style\": {\"color\": \"blue\"}, \"fillOpacity\": 0.4},\n",
136
+ " basemap=naip_url,\n",
98
137
  ")"
99
138
  ]
100
139
  },
@@ -127,7 +166,23 @@
127
166
  "outputs": [],
128
167
  "source": [
129
168
  "geoai.view_vector_interactive(\n",
130
- " gdf_regularized, style_kwds={\"color\": \"red\", \"fillOpacity\": 0}, tiles=\"Satellite\"\n",
169
+ " gdf_regularized, style_kwds={\"color\": \"red\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
170
+ ")"
171
+ ]
172
+ },
173
+ {
174
+ "cell_type": "code",
175
+ "execution_count": null,
176
+ "metadata": {},
177
+ "outputs": [],
178
+ "source": [
179
+ "geoai.create_split_map(\n",
180
+ " left_layer=gdf_regularized,\n",
181
+ " right_layer=naip_url,\n",
182
+ " left_label=\"Regularized Buildings\",\n",
183
+ " right_label=\"NAIP Imagery\",\n",
184
+ " left_args={\"style\": {\"color\": \"red\"}, \"fillOpacity\": 0.4},\n",
185
+ " basemap=naip_url,\n",
131
186
  ")"
132
187
  ]
133
188
  },
@@ -154,7 +209,23 @@
154
209
  "outputs": [],
155
210
  "source": [
156
211
  "geoai.view_vector_interactive(\n",
157
- " gdf_hybrid, style_kwds={\"color\": \"green\", \"fillOpacity\": 0}, tiles=\"Satellite\"\n",
212
+ " gdf_hybrid, style_kwds={\"color\": \"green\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
213
+ ")"
214
+ ]
215
+ },
216
+ {
217
+ "cell_type": "code",
218
+ "execution_count": null,
219
+ "metadata": {},
220
+ "outputs": [],
221
+ "source": [
222
+ "geoai.create_split_map(\n",
223
+ " left_layer=gdf_regularized,\n",
224
+ " right_layer=naip_url,\n",
225
+ " left_label=\"Regularized Buildings\",\n",
226
+ " right_label=\"NAIP Imagery\",\n",
227
+ " left_args={\"style\": {\"color\": \"green\", \"fillOpacity\": 0.4}},\n",
228
+ " basemap=naip_url,\n",
158
229
  ")"
159
230
  ]
160
231
  },
@@ -186,7 +257,23 @@
186
257
  "outputs": [],
187
258
  "source": [
188
259
  "geoai.view_vector_interactive(\n",
189
- " gdf_adaptive, style_kwds={\"color\": \"yellow\", \"fillOpacity\": 0}, tiles=\"Satellite\"\n",
260
+ " gdf_adaptive, style_kwds={\"color\": \"yellow\", \"fillOpacity\": 0.4}, tiles=naip_url\n",
261
+ ")"
262
+ ]
263
+ },
264
+ {
265
+ "cell_type": "code",
266
+ "execution_count": null,
267
+ "metadata": {},
268
+ "outputs": [],
269
+ "source": [
270
+ "geoai.create_split_map(\n",
271
+ " left_layer=gdf_adaptive,\n",
272
+ " right_layer=naip_url,\n",
273
+ " left_label=\"Adaptive Regularization Buildings\",\n",
274
+ " right_label=\"NAIP Imagery\",\n",
275
+ " left_args={\"style\": {\"color\": \"yellow\", \"fillOpacity\": 0.4}},\n",
276
+ " basemap=naip_url,\n",
190
277
  ")"
191
278
  ]
192
279
  },
@@ -235,7 +322,7 @@
235
322
  ],
236
323
  "metadata": {
237
324
  "kernelspec": {
238
- "display_name": "torch",
325
+ "display_name": "geo",
239
326
  "language": "python",
240
327
  "name": "python3"
241
328
  },
@@ -249,7 +336,7 @@
249
336
  "name": "python",
250
337
  "nbconvert_exporter": "python",
251
338
  "pygments_lexer": "ipython3",
252
- "version": "3.11.8"
339
+ "version": "3.12.2"
253
340
  }
254
341
  },
255
342
  "nbformat": 4,
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = """Qiusheng Wu"""
4
4
  __email__ = "giswqs@gmail.com"
5
- __version__ = "0.3.1"
5
+ __version__ = "0.3.2"
6
6
 
7
7
 
8
8
  import os