geoai-py 0.22.0__tar.gz → 0.24.0__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.
- {geoai_py-0.22.0 → geoai_py-0.24.0}/.gitignore +2 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/PKG-INFO +3 -1
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/__init__.py +1 -1
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/utils.py +67 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/PKG-INFO +3 -1
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/SOURCES.txt +1 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/requires.txt +2 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/mkdocs.yml +3 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/pyproject.toml +3 -3
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/README.md +182 -42
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/samgeo.py +370 -67
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/segmentation.py +133 -11
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/update_checker.py +4 -3
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/metadata.txt +8 -2
- geoai_py-0.24.0/qgis_plugin/package_plugin.py +296 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/requirements.txt +1 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/.dockerignore +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/.editorconfig +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/.pre-commit-config.yaml +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/CITATION.cff +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/Dockerfile +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/LICENSE +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/MANIFEST.in +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/README.md +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/__init__.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/catalog_models.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/catalog_tools.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/geo_agents.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/map_tools.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/stac_models.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/agents/stac_tools.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/auto.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/change_detection.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/classify.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/detectron2.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/dinov3.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/download.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/extract.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/geoai.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/hf.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/landcover_train.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/landcover_utils.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/map_widgets.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/moondream.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/sam.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/segment.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/segmentation.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/timm_segment.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/timm_train.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/tools/__init__.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/tools/cloudmask.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/tools/multiclean.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/tools/sr.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai/train.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/dependency_links.txt +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/entry_points.txt +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/geoai_py.egg-info/top_level.txt +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/pytest.ini +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/LICENSE +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/__init__.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/_geoai_lib.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/__init__.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/map_tools.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/dialogs/moondream.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/geoai_plugin.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/about.svg +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/gpu.svg +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/icon.png +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/moondream.svg +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/samgeo.png +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/geoai_plugin/icons/segment.svg +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/install.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/qgis_plugin/install.sh +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/requirements_docs.txt +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/setup.cfg +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/__init__.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/create_test_data.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_classify.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_download.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_extract.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_fixtures.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_geoai.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_segment.py +0 -0
- {geoai_py-0.22.0 → geoai_py-0.24.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: geoai-py
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.0
|
|
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
|
|
@@ -38,6 +38,7 @@ Requires-Dist: rasterio
|
|
|
38
38
|
Requires-Dist: rioxarray
|
|
39
39
|
Requires-Dist: scikit-image
|
|
40
40
|
Requires-Dist: scikit-learn
|
|
41
|
+
Requires-Dist: smoothify
|
|
41
42
|
Requires-Dist: timm
|
|
42
43
|
Requires-Dist: tokenizers>=0.22.1
|
|
43
44
|
Requires-Dist: torch
|
|
@@ -51,6 +52,7 @@ Requires-Dist: torchange; extra == "extra"
|
|
|
51
52
|
Requires-Dist: lightly-train; extra == "extra"
|
|
52
53
|
Requires-Dist: multiclean; extra == "extra"
|
|
53
54
|
Requires-Dist: omnicloudmask; extra == "extra"
|
|
55
|
+
Requires-Dist: smoothify; extra == "extra"
|
|
54
56
|
Provides-Extra: agents
|
|
55
57
|
Requires-Dist: strands-agents; extra == "agents"
|
|
56
58
|
Requires-Dist: strands-agents-tools; extra == "agents"
|
|
@@ -7848,3 +7848,70 @@ def empty_cache() -> None:
|
|
|
7848
7848
|
torch.cuda.empty_cache()
|
|
7849
7849
|
elif getattr(torch.backends, "mps", None) and torch.backends.mps.is_available():
|
|
7850
7850
|
torch.mps.empty_cache()
|
|
7851
|
+
|
|
7852
|
+
|
|
7853
|
+
def smooth_vector(
|
|
7854
|
+
vector_data: Union[str, gpd.GeoDataFrame],
|
|
7855
|
+
output_path: str = None,
|
|
7856
|
+
segment_length: float = None,
|
|
7857
|
+
smooth_iterations: int = 3,
|
|
7858
|
+
num_cores: int = 0,
|
|
7859
|
+
merge_collection: bool = True,
|
|
7860
|
+
merge_field: str = None,
|
|
7861
|
+
merge_multipolygons: bool = True,
|
|
7862
|
+
preserve_area: bool = True,
|
|
7863
|
+
area_tolerance: float = 0.01,
|
|
7864
|
+
**kwargs: Any,
|
|
7865
|
+
) -> gpd.GeoDataFrame:
|
|
7866
|
+
"""Smooth a vector data using the smoothify library.
|
|
7867
|
+
See https://github.com/DPIRD-DMA/Smoothify for more details.
|
|
7868
|
+
|
|
7869
|
+
Args:
|
|
7870
|
+
vector_data: The vector data to smooth.
|
|
7871
|
+
output_path: The path to save the smoothed vector data. If None, returns the smoothed vector data.
|
|
7872
|
+
segment_length: Resolution of the original raster data in map units. If None (default), automatically
|
|
7873
|
+
detects by finding the minimum segment length (from a data sample). Recommended to specify explicitly when known.
|
|
7874
|
+
smooth_iterations: The number of iterations to smooth the vector data.
|
|
7875
|
+
num_cores: Number of cores to use for parallel processing. If 0 (default), uses all available cores.
|
|
7876
|
+
merge_collection: Whether to merge/dissolve adjacent geometries in collections before smoothing.
|
|
7877
|
+
merge_field: Column name to use for dissolving geometries. Only valid when merge_collection=True.
|
|
7878
|
+
If None, dissolves all geometries together. If specified, dissolves geometries grouped by the column values.
|
|
7879
|
+
merge_multipolygons: Whether to merge adjacent polygons within MultiPolygons before smoothing
|
|
7880
|
+
preserve_area: Whether to restore original area after smoothing via buffering (applies to Polygons only)
|
|
7881
|
+
area_tolerance: Percentage of original area allowed as error (e.g., 0.01 = 0.01% error = 99.99% preservation).
|
|
7882
|
+
Only affects Polygons when preserve_area=True
|
|
7883
|
+
|
|
7884
|
+
Returns:
|
|
7885
|
+
gpd.GeoDataFrame: The smoothed vector data.
|
|
7886
|
+
|
|
7887
|
+
Examples:
|
|
7888
|
+
>>> import geoai
|
|
7889
|
+
>>> gdf = geoai.read_vector("path/to/vector.geojson")
|
|
7890
|
+
>>> smoothed_gdf = geoai.smooth_vector(gdf, smooth_iterations=3, output_path="path/to/smoothed_vector.geojson")
|
|
7891
|
+
>>> smoothed_gdf.head()
|
|
7892
|
+
>>> smoothed_gdf.explore()
|
|
7893
|
+
"""
|
|
7894
|
+
try:
|
|
7895
|
+
from smoothify import smoothify
|
|
7896
|
+
except ImportError:
|
|
7897
|
+
install_package("smoothify")
|
|
7898
|
+
from smoothify import smoothify
|
|
7899
|
+
|
|
7900
|
+
if isinstance(vector_data, str):
|
|
7901
|
+
vector_data = leafmap.read_vector(vector_data)
|
|
7902
|
+
|
|
7903
|
+
smoothed_vector_data = smoothify(
|
|
7904
|
+
geom=vector_data,
|
|
7905
|
+
segment_length=segment_length,
|
|
7906
|
+
smooth_iterations=smooth_iterations,
|
|
7907
|
+
num_cores=num_cores,
|
|
7908
|
+
merge_collection=merge_collection,
|
|
7909
|
+
merge_field=merge_field,
|
|
7910
|
+
merge_multipolygons=merge_multipolygons,
|
|
7911
|
+
preserve_area=preserve_area,
|
|
7912
|
+
area_tolerance=area_tolerance,
|
|
7913
|
+
**kwargs,
|
|
7914
|
+
)
|
|
7915
|
+
if output_path is not None:
|
|
7916
|
+
smoothed_vector_data.to_file(output_path)
|
|
7917
|
+
return smoothed_vector_data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: geoai-py
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.0
|
|
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
|
|
@@ -38,6 +38,7 @@ Requires-Dist: rasterio
|
|
|
38
38
|
Requires-Dist: rioxarray
|
|
39
39
|
Requires-Dist: scikit-image
|
|
40
40
|
Requires-Dist: scikit-learn
|
|
41
|
+
Requires-Dist: smoothify
|
|
41
42
|
Requires-Dist: timm
|
|
42
43
|
Requires-Dist: tokenizers>=0.22.1
|
|
43
44
|
Requires-Dist: torch
|
|
@@ -51,6 +52,7 @@ Requires-Dist: torchange; extra == "extra"
|
|
|
51
52
|
Requires-Dist: lightly-train; extra == "extra"
|
|
52
53
|
Requires-Dist: multiclean; extra == "extra"
|
|
53
54
|
Requires-Dist: omnicloudmask; extra == "extra"
|
|
55
|
+
Requires-Dist: smoothify; extra == "extra"
|
|
54
56
|
Provides-Extra: agents
|
|
55
57
|
Requires-Dist: strands-agents; extra == "agents"
|
|
56
58
|
Requires-Dist: strands-agents-tools; extra == "agents"
|
|
@@ -136,6 +136,7 @@ nav:
|
|
|
136
136
|
- examples/water_dynamics.ipynb
|
|
137
137
|
- examples/wetland_mapping.ipynb
|
|
138
138
|
- examples/wetland_dynamics.ipynb
|
|
139
|
+
- examples/wetland_sam3.ipynb
|
|
139
140
|
- examples/regularization.ipynb
|
|
140
141
|
- examples/globe_projection.ipynb
|
|
141
142
|
- examples/samgeo.ipynb
|
|
@@ -163,6 +164,8 @@ nav:
|
|
|
163
164
|
- examples/moondream.ipynb
|
|
164
165
|
- examples/moondream_gui.ipynb
|
|
165
166
|
- examples/AutoModel.ipynb
|
|
167
|
+
- examples/smooth_vector.ipynb
|
|
168
|
+
- examples/timelapse.ipynb
|
|
166
169
|
- Workshops:
|
|
167
170
|
- workshops/GeoAI_Workshop_2025.ipynb
|
|
168
171
|
- workshops/AWS_2025.ipynb
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "geoai-py"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.24.0"
|
|
4
4
|
dynamic = [
|
|
5
5
|
"dependencies",
|
|
6
6
|
]
|
|
@@ -36,7 +36,7 @@ exclude = ["docs*"]
|
|
|
36
36
|
dependencies = {file = ["requirements.txt"]}
|
|
37
37
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
|
-
extra = ["overturemaps", "torchange", "lightly-train", "multiclean", "omnicloudmask"]
|
|
39
|
+
extra = ["overturemaps", "torchange", "lightly-train", "multiclean", "omnicloudmask", "smoothify"]
|
|
40
40
|
agents = ["strands-agents", "strands-agents-tools", "strands-agents[ollama]", "strands-agents[anthropic]", "strands-agents[openai]"]
|
|
41
41
|
sr = ["opensr-model"]
|
|
42
42
|
|
|
@@ -45,7 +45,7 @@ universal = true
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
[tool.bumpversion]
|
|
48
|
-
current_version = "0.
|
|
48
|
+
current_version = "0.24.0"
|
|
49
49
|
commit = true
|
|
50
50
|
tag = true
|
|
51
51
|
|
|
@@ -4,21 +4,32 @@ A QGIS plugin that brings the [geoai](https://github.com/opengeos/geoai) models
|
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
7
|
-
- Create a
|
|
8
|
-
- Install the plugin
|
|
9
|
-
-
|
|
7
|
+
- Create a Pixi project and install the dependencies.
|
|
8
|
+
- Install the QGIS plugin from the QGIS Plugin Manager.
|
|
9
|
+
- Enable the GeoAI plugin in QGIS.
|
|
10
|
+
- Restart QGIS.
|
|
10
11
|
- Open a GeoAI toolbar panel and try the sample datasets below.
|
|
11
12
|
|
|
12
13
|
## Video Tutorials
|
|
13
14
|
|
|
15
|
+
### Installation Tutorial
|
|
16
|
+
|
|
17
|
+
You can follow this [video tutorial](https://youtu.be/TJmZQXJK-IU) to install the GeoAI QGIS Plugin on Linux/Windows:
|
|
18
|
+
|
|
19
|
+
[](https://youtu.be/TJmZQXJK-IU)
|
|
20
|
+
|
|
21
|
+
### Usage Tutorial
|
|
22
|
+
|
|
14
23
|
Check out this [short video demo](https://youtu.be/Esr_e6_P1is) and [full video tutorial](https://youtu.be/8-OhlqeoyiY) on how to use the GeoAI plugin in QGIS.
|
|
15
24
|
|
|
16
25
|
[](https://youtu.be/8-OhlqeoyiY)
|
|
17
26
|
|
|
27
|
+
|
|
28
|
+
|
|
18
29
|
## Requirements
|
|
19
30
|
|
|
20
31
|
- QGIS 3.28 or later
|
|
21
|
-
- Python 3.10+ (
|
|
32
|
+
- Python 3.10+ (Pixi recommended)
|
|
22
33
|
- PyTorch (CUDA if you want GPU acceleration)
|
|
23
34
|
- `geoai` and `samgeo` packages
|
|
24
35
|
|
|
@@ -53,70 +64,192 @@ Each tool lives inside a dockable panel that can be attached to either side of t
|
|
|
53
64
|
|
|
54
65
|
## Installation
|
|
55
66
|
|
|
56
|
-
### 1
|
|
67
|
+
### 1. Set up the environment
|
|
57
68
|
|
|
58
|
-
|
|
69
|
+
Installing the GeoAI QGIS plugin on can be challenging due to the complicated pytorch/cuda dependencies. Conda or mamba might take a while to resolve the dependencies, while pip might fail to install the dependencies properly. It is recommended to use [pixi](https://pixi.prefix.dev/latest) to install the dependencies to avoid these issues.
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
#### 1) Install Pixi
|
|
72
|
+
|
|
73
|
+
#### Linux/macOS (bash/zsh)
|
|
61
74
|
|
|
62
75
|
```bash
|
|
63
|
-
|
|
64
|
-
conda activate geo
|
|
76
|
+
curl -fsSL https://pixi.sh/install.sh | sh
|
|
65
77
|
```
|
|
66
78
|
|
|
67
|
-
|
|
79
|
+
Close and re-open your terminal (or reload your shell) so `pixi` is on your `PATH`. Then confirm:
|
|
68
80
|
|
|
69
81
|
```bash
|
|
70
|
-
|
|
71
|
-
python -c "import rasterio; print('rasterio import successful')"
|
|
82
|
+
pixi --version
|
|
72
83
|
```
|
|
73
84
|
|
|
74
|
-
|
|
85
|
+
#### Windows (PowerShell)
|
|
75
86
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
Open **PowerShell** (preferably as a normal user, Admin not required), then run:
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
powershell -ExecutionPolicy Bypass -c "irm -useb https://pixi.sh/install.ps1 | iex"
|
|
79
91
|
```
|
|
80
92
|
|
|
81
|
-
|
|
93
|
+
Close and re-open PowerShell, then confirm:
|
|
82
94
|
|
|
83
|
-
```
|
|
84
|
-
|
|
95
|
+
```powershell
|
|
96
|
+
pixi --version
|
|
85
97
|
```
|
|
86
98
|
|
|
87
|
-
|
|
99
|
+
---
|
|
88
100
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
#### 2) Create a Pixi project
|
|
102
|
+
|
|
103
|
+
Navigate to a directory where you want to create the project and run:
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
pixi init geo
|
|
107
|
+
cd geo
|
|
92
108
|
```
|
|
93
109
|
|
|
94
|
-
|
|
110
|
+
---
|
|
95
111
|
|
|
96
|
-
|
|
112
|
+
#### 3) Configure `pixi.toml`
|
|
97
113
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
Open `pixi.toml` in the `geo` directory and replace its contents with the following depending on your system.
|
|
115
|
+
|
|
116
|
+
If you have a NVIDIA GPU with CUDA, run `nvidia-smi` to check the CUDA version.
|
|
117
|
+
|
|
118
|
+
- For GPU with CUDA 12.x:
|
|
119
|
+
|
|
120
|
+
```toml
|
|
121
|
+
[workspace]
|
|
122
|
+
channels = ["https://prefix.dev/conda-forge"]
|
|
123
|
+
name = "geo"
|
|
124
|
+
platforms = ["linux-64", "win-64"]
|
|
125
|
+
|
|
126
|
+
[system-requirements]
|
|
127
|
+
cuda = "12.0"
|
|
128
|
+
|
|
129
|
+
[dependencies]
|
|
130
|
+
python = "3.12.*"
|
|
131
|
+
pytorch-gpu = ">=2.9.1,<3"
|
|
132
|
+
qgis = ">=3.44.5"
|
|
133
|
+
geoai = ">=0.23.0"
|
|
134
|
+
segment-geospatial = ">=0.10.8"
|
|
135
|
+
sam3 = ">=0.1.0.20251211"
|
|
136
|
+
libopenblas = ">=0.3.30"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- For GPU with CUDA 13.x:
|
|
140
|
+
|
|
141
|
+
```toml
|
|
142
|
+
[workspace]
|
|
143
|
+
channels = ["https://prefix.dev/conda-forge"]
|
|
144
|
+
name = "geo"
|
|
145
|
+
platforms = ["linux-64", "win-64"]
|
|
146
|
+
|
|
147
|
+
[system-requirements]
|
|
148
|
+
cuda = "13.0"
|
|
149
|
+
|
|
150
|
+
[dependencies]
|
|
151
|
+
python = "3.12.*"
|
|
152
|
+
pytorch-gpu = ">=2.9.1,<3"
|
|
153
|
+
qgis = ">=3.44.5"
|
|
154
|
+
geoai = ">=0.23.0"
|
|
155
|
+
segment-geospatial = ">=0.10.8"
|
|
156
|
+
sam3 = ">=0.1.0.20251211"
|
|
157
|
+
libopenblas = ">=0.3.30"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
- For CPU:
|
|
161
|
+
|
|
162
|
+
```toml
|
|
163
|
+
[workspace]
|
|
164
|
+
channels = ["https://prefix.dev/conda-forge"]
|
|
165
|
+
name = "geo"
|
|
166
|
+
platforms = ["linux-64", "win-64"]
|
|
167
|
+
|
|
168
|
+
[dependencies]
|
|
169
|
+
python = "3.12.*"
|
|
170
|
+
pytorch-cpu = ">=2.9.1,<3"
|
|
171
|
+
qgis = ">=3.44.5"
|
|
172
|
+
geoai = ">=0.23.0"
|
|
173
|
+
segment-geospatial = ">=0.10.8"
|
|
174
|
+
sam3 = ">=0.1.0.20251211"
|
|
175
|
+
libopenblas = ">=0.3.30"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
#### 4) Install the environment
|
|
181
|
+
|
|
182
|
+
From the `geo` folder:
|
|
183
|
+
|
|
184
|
+
```powershell
|
|
185
|
+
pixi install
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
This step may take several minutes on first install depending on your internet connection and system.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
#### 5) Upgrade `segment-geospatial` via pip
|
|
193
|
+
|
|
194
|
+
Install the latest `segment-geospatial` release on top of the resolved environment:
|
|
195
|
+
|
|
196
|
+
```powershell
|
|
197
|
+
pixi run pip install -U segment-geospatial
|
|
107
198
|
```
|
|
108
199
|
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
#### 6) Verify PyTorch + CUDA
|
|
203
|
+
|
|
204
|
+
If you have a NVIDIA GPU with CUDA, run the following command to verify the PyTorch + CUDA installation:
|
|
205
|
+
|
|
206
|
+
```powershell
|
|
207
|
+
pixi run python -c "import torch; print('PyTorch:', torch.__version__); print('CUDA available:', torch.cuda.is_available()); print('GPU:', (torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'None'))"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Expected output should be like this:
|
|
211
|
+
|
|
212
|
+
- `PyTorch: 2.9.1`
|
|
213
|
+
- `CUDA available: True`
|
|
214
|
+
- `GPU: NVIDIA RTX 4090`
|
|
215
|
+
|
|
216
|
+
If CUDA is `False`, check:
|
|
217
|
+
|
|
218
|
+
- `nvidia-smi` works in PowerShell
|
|
219
|
+
- NVIDIA driver is up to date
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
|
|
109
224
|
#### Request access to SAM 3
|
|
110
225
|
|
|
111
226
|
To use SAM 3, you will need to request access by filling out this form on Hugging Face at <https://huggingface.co/facebook/sam3>. Once your request has been approved, run the following command in the terminal to authenticate:
|
|
112
227
|
|
|
113
228
|
```bash
|
|
114
|
-
hf auth login
|
|
229
|
+
pixi run hf auth login
|
|
115
230
|
```
|
|
116
231
|
|
|
117
|
-
|
|
232
|
+
After authentication, you can download the SAM 3 model from Hugging Face:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
pixi run hf download facebook/sam3
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Important Note**: SAM 3 currently requires a NVIDIA GPU with CUDA support. You won't be able to use SAM 3 if you have a CPU only system ([source](https://github.com/facebookresearch/sam3/issues/164)). You will get an error message like this: `Failed to load model: Torch not compiled with CUDA enabled`.
|
|
239
|
+
|
|
240
|
+
### 2. Install the QGIS plugin
|
|
241
|
+
|
|
242
|
+
Option A — use QGIS Plugin Manager (recommended):
|
|
118
243
|
|
|
119
|
-
|
|
244
|
+
GeoAI is available as a QGIS plugin in the official [QGIS plugin repository](https://plugins.qgis.org/plugins/geoai). To install:
|
|
245
|
+
|
|
246
|
+
1. Launch QGIS: `pixi run qgis`
|
|
247
|
+
2. Go to `Plugins` → `Manage and Install Plugins...`
|
|
248
|
+
3. Switch to the `All` tab, search for `GeoAI`, select it, and click `Install Plugin`
|
|
249
|
+
|
|
250
|
+

|
|
251
|
+
|
|
252
|
+
Option B — use the helper script:
|
|
120
253
|
|
|
121
254
|
```bash
|
|
122
255
|
git clone https://github.com/opengeos/geoai.git
|
|
@@ -130,19 +263,21 @@ This links/copies the plugin into your active QGIS profile. Re-run after pulling
|
|
|
130
263
|
python install.py --remove
|
|
131
264
|
```
|
|
132
265
|
|
|
133
|
-
Option
|
|
266
|
+
Option C — manual copy:
|
|
134
267
|
|
|
135
268
|
- Copy the `qgis_plugin` folder to your QGIS plugins directory:
|
|
136
269
|
- Linux: `~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/`
|
|
137
270
|
- Windows: `C:\Users\<username>\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\`
|
|
138
271
|
- macOS: `~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/`
|
|
139
272
|
|
|
140
|
-
### 3
|
|
273
|
+
### 3. Enable in QGIS
|
|
141
274
|
|
|
142
|
-
Launch QGIS: `
|
|
275
|
+
Launch QGIS: `pixi run qgis`
|
|
143
276
|
|
|
144
277
|
QGIS → `Plugins` → `Manage and Install Plugins...` → enable `GeoAI`. After updates, toggle the plugin off/on or restart QGIS to reload.
|
|
145
278
|
|
|
279
|
+

|
|
280
|
+
|
|
146
281
|
## Usage
|
|
147
282
|
|
|
148
283
|
### Moondream Vision-Language Model
|
|
@@ -174,7 +309,7 @@ Sample datasets:
|
|
|
174
309
|
|
|
175
310
|
Steps:
|
|
176
311
|
|
|
177
|
-
1. Download the sample datasets (links above) or prepare your own imagery/vector labels. Store them in a folder that is accessible to
|
|
312
|
+
1. Download the sample datasets (links above) or prepare your own imagery/vector labels. Store them in a folder that is accessible to pixi project.
|
|
178
313
|
2. Click the **Segmentation** button in the GeoAI toolbar (or `GeoAI` menu → `Segmentation`)
|
|
179
314
|
3. Use the tabs at the top of the panel to switch between:
|
|
180
315
|
|
|
@@ -243,6 +378,12 @@ Click the **GPU** button in the GeoAI toolbar to release GPU memory from all loa
|
|
|
243
378
|
|
|
244
379
|

|
|
245
380
|
|
|
381
|
+
### Plugin Update Checker
|
|
382
|
+
|
|
383
|
+
Go to `GeoAI` menu → `Check for Updates...` to see if a newer version of the GeoAI plugin is available. Click on the `Check for Updates` button to fetch the latest version info from GitHub. If an update is found, click the `Download and Install Update` button to download and install the latest version automatically. Restart QGIS to apply the update.
|
|
384
|
+
|
|
385
|
+

|
|
386
|
+
|
|
246
387
|
## Supported Model Architectures (Segmentation)
|
|
247
388
|
|
|
248
389
|
The QGIS plugin supports any models supported by [Pytorch Segmentation Models](https://smp.readthedocs.io/en/latest/models.html), including:
|
|
@@ -276,7 +417,6 @@ The QGIS plugin supports any models supported by [Pytorch Segmentation Models](h
|
|
|
276
417
|
## Troubleshooting
|
|
277
418
|
|
|
278
419
|
- Plugin missing after install: confirm the plugin folder exists in your QGIS profile path and that you restarted QGIS.
|
|
279
|
-
- GDAL/rasterio errors: verify you launched QGIS from the conda env (`conda activate geo` then `qgis`) so it picks up the same Python libs.
|
|
280
420
|
- CUDA OOM: use the **GPU** button to clear cache, lower batch sizes, or switch to CPU for smaller runs.
|
|
281
421
|
- Model download failures: check network/firewall, then retry loading models from the panel.
|
|
282
422
|
|