geoai-py 0.25.0__tar.gz → 0.27.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.25.0 → geoai_py-0.27.0}/.gitignore +3 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/.pre-commit-config.yaml +2 -2
- {geoai_py-0.25.0 → geoai_py-0.27.0}/PKG-INFO +4 -4
- {geoai_py-0.25.0 → geoai_py-0.27.0}/README.md +3 -3
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/__init__.py +38 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/auto.py +4 -2
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/change_detection.py +2 -2
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/detectron2.py +4 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/extract.py +4 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/moondream.py +0 -1
- geoai_py-0.27.0/geoai/prithvi.py +1338 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/sam.py +2 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/segment.py +10 -1
- geoai_py-0.27.0/geoai/timm_regress.py +1652 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/utils.py +3 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/PKG-INFO +4 -4
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/SOURCES.txt +2 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/mkdocs.yml +3 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/pyproject.toml +2 -2
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/README.md +3 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/_geoai_lib.py +0 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/moondream.py +241 -42
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/samgeo.py +288 -80
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/segmentation.py +23 -4
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/update_checker.py +0 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/metadata.txt +4 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/package_plugin.py +0 -1
- {geoai_py-0.25.0 → geoai_py-0.27.0}/.dockerignore +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/.editorconfig +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/CITATION.cff +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/Dockerfile +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/LICENSE +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/MANIFEST.in +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/__init__.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/catalog_models.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/catalog_tools.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/geo_agents.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/map_tools.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/stac_models.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/agents/stac_tools.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/classify.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/dinov3.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/download.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/geoai.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/hf.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/landcover_train.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/landcover_utils.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/map_widgets.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/segmentation.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/timm_segment.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/timm_train.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/tools/__init__.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/tools/cloudmask.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/tools/multiclean.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/tools/sr.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai/train.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/dependency_links.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/entry_points.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/requires.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/geoai_py.egg-info/top_level.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/pytest.ini +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/LICENSE +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/__init__.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/__init__.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/dialogs/map_tools.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/geoai_plugin.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/about.svg +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/gpu.svg +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/icon.png +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/moondream.svg +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/samgeo.png +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/geoai_plugin/icons/segment.svg +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/install.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/qgis_plugin/install.sh +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/requirements.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/requirements_docs.txt +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/setup.cfg +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/__init__.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/create_test_data.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_classify.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_download.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_extract.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_fixtures.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_geoai.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_moondream.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_segment.py +0 -0
- {geoai_py-0.25.0 → geoai_py-0.27.0}/tests/test_utils.py +0 -0
|
@@ -12,7 +12,7 @@ repos:
|
|
|
12
12
|
args: ["--maxkb=500"]
|
|
13
13
|
|
|
14
14
|
- repo: https://github.com/psf/black-pre-commit-mirror
|
|
15
|
-
rev:
|
|
15
|
+
rev: 26.1.0
|
|
16
16
|
hooks:
|
|
17
17
|
- id: black-jupyter
|
|
18
18
|
|
|
@@ -27,6 +27,6 @@ repos:
|
|
|
27
27
|
]
|
|
28
28
|
|
|
29
29
|
- repo: https://github.com/kynan/nbstripout
|
|
30
|
-
rev: 0.
|
|
30
|
+
rev: 0.9.0
|
|
31
31
|
hooks:
|
|
32
32
|
- id: nbstripout
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: geoai-py
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.27.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
|
|
@@ -71,7 +71,7 @@ Dynamic: license-file
|
|
|
71
71
|
[](https://anaconda.org/conda-forge/geoai)
|
|
72
72
|
[](https://github.com/conda-forge/geoai-py-feedstock)
|
|
73
73
|
[](https://opensource.org/licenses/MIT)
|
|
74
|
-
[](https://
|
|
74
|
+
[](https://www.youtube.com/playlist?list=PLAxJ4-o7ZoPcvENqwaPa_QwbbkZ5sctZE)
|
|
75
75
|
[](https://opengeoai.org/qgis_plugin)
|
|
76
76
|
|
|
77
77
|
[](https://github.com/opengeos/geoai/blob/master/docs/assets/logo.png)
|
|
@@ -91,7 +91,7 @@ The package provides five core capabilities:
|
|
|
91
91
|
5. Interactive visualization through integration with [Leafmap](https://github.com/opengeos/leafmap/) and [MapLibre](https://github.com/eoda-dev/py-maplibregl).
|
|
92
92
|
6. Seamless QGIS integration via a dedicated GeoAI plugin, enabling users to run AI-powered geospatial workflows directly within the QGIS desktop environment, without writing code.
|
|
93
93
|
|
|
94
|
-
GeoAI addresses the growing demand for accessible AI tools in geospatial research by providing high-level APIs that abstract complex machine learning workflows while maintaining flexibility for advanced users. The package supports multiple data formats (GeoTIFF, JPEG2000,GeoJSON, Shapefile, GeoPackage) and includes automatic device management for GPU acceleration when available. With over 10 modules and extensive notebook examples, GeoAI serves as both a research tool and educational resource for the geospatial AI community.
|
|
94
|
+
GeoAI addresses the growing demand for accessible AI tools in geospatial research by providing high-level APIs that abstract complex machine learning workflows while maintaining flexibility for advanced users. The package supports multiple data formats (GeoTIFF, JPEG2000, GeoJSON, Shapefile, GeoPackage) and includes automatic device management for GPU acceleration when available. With over 10 modules and extensive notebook examples, GeoAI serves as both a research tool and educational resource for the geospatial AI community.
|
|
95
95
|
|
|
96
96
|
## 📝 Statement of Need
|
|
97
97
|
|
|
@@ -130,7 +130,7 @@ If you find GeoAI useful in your research, please consider citing the following
|
|
|
130
130
|
|
|
131
131
|
- Integration with [PyTorch Segmentation Models](https://github.com/qubvel-org/segmentation_models.pytorch) for automatic feature extraction
|
|
132
132
|
- Specialized segmentation algorithms optimized for satellite and aerial imagery
|
|
133
|
-
- Streamlined workflows for segmenting buildings, water bodies, wetlands,solar panels, etc.
|
|
133
|
+
- Streamlined workflows for segmenting buildings, water bodies, wetlands, solar panels, etc.
|
|
134
134
|
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage, GeoParquet)
|
|
135
135
|
|
|
136
136
|
### 🔍 Image Classification
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://anaconda.org/conda-forge/geoai)
|
|
7
7
|
[](https://github.com/conda-forge/geoai-py-feedstock)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
[](https://
|
|
9
|
+
[](https://www.youtube.com/playlist?list=PLAxJ4-o7ZoPcvENqwaPa_QwbbkZ5sctZE)
|
|
10
10
|
[](https://opengeoai.org/qgis_plugin)
|
|
11
11
|
|
|
12
12
|
[](https://github.com/opengeos/geoai/blob/master/docs/assets/logo.png)
|
|
@@ -26,7 +26,7 @@ The package provides five core capabilities:
|
|
|
26
26
|
5. Interactive visualization through integration with [Leafmap](https://github.com/opengeos/leafmap/) and [MapLibre](https://github.com/eoda-dev/py-maplibregl).
|
|
27
27
|
6. Seamless QGIS integration via a dedicated GeoAI plugin, enabling users to run AI-powered geospatial workflows directly within the QGIS desktop environment, without writing code.
|
|
28
28
|
|
|
29
|
-
GeoAI addresses the growing demand for accessible AI tools in geospatial research by providing high-level APIs that abstract complex machine learning workflows while maintaining flexibility for advanced users. The package supports multiple data formats (GeoTIFF, JPEG2000,GeoJSON, Shapefile, GeoPackage) and includes automatic device management for GPU acceleration when available. With over 10 modules and extensive notebook examples, GeoAI serves as both a research tool and educational resource for the geospatial AI community.
|
|
29
|
+
GeoAI addresses the growing demand for accessible AI tools in geospatial research by providing high-level APIs that abstract complex machine learning workflows while maintaining flexibility for advanced users. The package supports multiple data formats (GeoTIFF, JPEG2000, GeoJSON, Shapefile, GeoPackage) and includes automatic device management for GPU acceleration when available. With over 10 modules and extensive notebook examples, GeoAI serves as both a research tool and educational resource for the geospatial AI community.
|
|
30
30
|
|
|
31
31
|
## 📝 Statement of Need
|
|
32
32
|
|
|
@@ -65,7 +65,7 @@ If you find GeoAI useful in your research, please consider citing the following
|
|
|
65
65
|
|
|
66
66
|
- Integration with [PyTorch Segmentation Models](https://github.com/qubvel-org/segmentation_models.pytorch) for automatic feature extraction
|
|
67
67
|
- Specialized segmentation algorithms optimized for satellite and aerial imagery
|
|
68
|
-
- Streamlined workflows for segmenting buildings, water bodies, wetlands,solar panels, etc.
|
|
68
|
+
- Streamlined workflows for segmenting buildings, water bodies, wetlands, solar panels, etc.
|
|
69
69
|
- Export capabilities to standard geospatial formats (GeoJSON, Shapefile, GeoPackage, GeoParquet)
|
|
70
70
|
|
|
71
71
|
### 🔍 Image Classification
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
__author__ = """Qiusheng Wu"""
|
|
4
4
|
__email__ = "giswqs@gmail.com"
|
|
5
|
-
__version__ = "0.
|
|
5
|
+
__version__ = "0.27.0"
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
import os
|
|
@@ -101,6 +101,12 @@ def set_proj_lib_path(verbose=False):
|
|
|
101
101
|
|
|
102
102
|
from .dinov3 import DINOv3GeoProcessor, analyze_image_patches, create_similarity_map
|
|
103
103
|
from .geoai import *
|
|
104
|
+
from .utils import (
|
|
105
|
+
orthogonalize,
|
|
106
|
+
regularization,
|
|
107
|
+
hybrid_regularization,
|
|
108
|
+
adaptive_regularization,
|
|
109
|
+
)
|
|
104
110
|
|
|
105
111
|
from .timm_train import (
|
|
106
112
|
get_timm_model,
|
|
@@ -122,6 +128,25 @@ from .timm_segment import (
|
|
|
122
128
|
push_timm_model_to_hub,
|
|
123
129
|
)
|
|
124
130
|
|
|
131
|
+
from .timm_regress import (
|
|
132
|
+
PixelRegressionModel,
|
|
133
|
+
PixelRegressionDataset,
|
|
134
|
+
create_regression_tiles,
|
|
135
|
+
train_pixel_regressor,
|
|
136
|
+
predict_raster,
|
|
137
|
+
evaluate_regression,
|
|
138
|
+
plot_regression_comparison,
|
|
139
|
+
plot_scatter,
|
|
140
|
+
plot_training_history,
|
|
141
|
+
visualize_prediction,
|
|
142
|
+
plot_regression_results,
|
|
143
|
+
# Backward compatibility aliases
|
|
144
|
+
TimmRegressor,
|
|
145
|
+
RegressionDataset,
|
|
146
|
+
train_timm_regressor,
|
|
147
|
+
create_regression_patches,
|
|
148
|
+
)
|
|
149
|
+
|
|
125
150
|
# Import tools subpackage
|
|
126
151
|
from . import tools
|
|
127
152
|
|
|
@@ -162,3 +187,15 @@ try:
|
|
|
162
187
|
except ImportError:
|
|
163
188
|
# Moondream not available (missing dependency)
|
|
164
189
|
pass
|
|
190
|
+
|
|
191
|
+
# Prithvi EO 2.0 Geospatial Foundation Model
|
|
192
|
+
try:
|
|
193
|
+
from .prithvi import (
|
|
194
|
+
PrithviProcessor,
|
|
195
|
+
get_available_prithvi_models,
|
|
196
|
+
load_prithvi_model,
|
|
197
|
+
prithvi_inference,
|
|
198
|
+
)
|
|
199
|
+
except ImportError:
|
|
200
|
+
# Prithvi not available (missing dependency)
|
|
201
|
+
pass
|
|
@@ -24,7 +24,6 @@ Example:
|
|
|
24
24
|
import os
|
|
25
25
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
26
26
|
|
|
27
|
-
import cv2
|
|
28
27
|
import geopandas as gpd
|
|
29
28
|
import numpy as np
|
|
30
29
|
import rasterio
|
|
@@ -54,7 +53,6 @@ from transformers.utils import logging as hf_logging
|
|
|
54
53
|
|
|
55
54
|
from .utils import get_device
|
|
56
55
|
|
|
57
|
-
|
|
58
56
|
hf_logging.set_verbosity_error() # silence HF load reports
|
|
59
57
|
|
|
60
58
|
|
|
@@ -878,6 +876,8 @@ class AutoGeoModel:
|
|
|
878
876
|
**kwargs: Any,
|
|
879
877
|
) -> Dict[str, Any]:
|
|
880
878
|
"""Run tiled inference for large images."""
|
|
879
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
880
|
+
|
|
881
881
|
if data.ndim == 3:
|
|
882
882
|
_, height, width = data.shape
|
|
883
883
|
else:
|
|
@@ -1873,6 +1873,7 @@ def show_segmentation(
|
|
|
1873
1873
|
>>> result = geoai.auto.semantic_segmentation("aerial.tif", output_path="seg.tif")
|
|
1874
1874
|
>>> fig = show_segmentation("aerial.tif", result["mask"])
|
|
1875
1875
|
"""
|
|
1876
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
1876
1877
|
import matplotlib.pyplot as plt
|
|
1877
1878
|
|
|
1878
1879
|
img, _ = _load_image_for_display(source)
|
|
@@ -1942,6 +1943,7 @@ def show_depth(
|
|
|
1942
1943
|
>>> result = geoai.auto.depth_estimation("aerial.tif", output_path="depth.tif")
|
|
1943
1944
|
>>> fig = show_depth("aerial.tif", result["depth"])
|
|
1944
1945
|
"""
|
|
1946
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
1945
1947
|
import matplotlib.pyplot as plt
|
|
1946
1948
|
|
|
1947
1949
|
img, _ = _load_image_for_display(source)
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import os
|
|
4
4
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
5
5
|
|
|
6
|
-
import cv2
|
|
7
6
|
import matplotlib.pyplot as plt
|
|
8
7
|
import numpy as np
|
|
9
8
|
import rasterio
|
|
@@ -249,7 +248,7 @@ class ChangeDetection:
|
|
|
249
248
|
dict: Detailed results if return_detailed_results=True
|
|
250
249
|
"""
|
|
251
250
|
# Read and align images
|
|
252
|
-
|
|
251
|
+
img1, img2, transform, crs, original_shape = self._read_and_align_images(
|
|
253
252
|
image1_path, image2_path, target_size
|
|
254
253
|
)
|
|
255
254
|
|
|
@@ -736,6 +735,7 @@ class ChangeDetection:
|
|
|
736
735
|
output_path="split_comparison.png",
|
|
737
736
|
):
|
|
738
737
|
"""Create a split comparison visualization showing before/after with change overlay."""
|
|
738
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
739
739
|
|
|
740
740
|
# Load data
|
|
741
741
|
with rasterio.open(image1_path) as src:
|
|
@@ -6,7 +6,6 @@ import os
|
|
|
6
6
|
import warnings
|
|
7
7
|
from typing import Dict, List, Optional, Tuple, Union
|
|
8
8
|
|
|
9
|
-
import cv2
|
|
10
9
|
import numpy as np
|
|
11
10
|
import rasterio
|
|
12
11
|
import torch
|
|
@@ -135,6 +134,8 @@ def detectron2_segment(
|
|
|
135
134
|
Returns:
|
|
136
135
|
Dict containing segmentation results and output file paths
|
|
137
136
|
"""
|
|
137
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
138
|
+
|
|
138
139
|
check_detectron2()
|
|
139
140
|
|
|
140
141
|
# Load the model
|
|
@@ -315,6 +316,8 @@ def visualize_detectron2_results(
|
|
|
315
316
|
Returns:
|
|
316
317
|
Visualization image as numpy array
|
|
317
318
|
"""
|
|
319
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
320
|
+
|
|
318
321
|
check_detectron2()
|
|
319
322
|
|
|
320
323
|
# Load the image
|
|
@@ -6,7 +6,6 @@ import time
|
|
|
6
6
|
from typing import Any, Dict, Generator, List, Optional, Tuple, Union
|
|
7
7
|
|
|
8
8
|
# Third-Party Libraries
|
|
9
|
-
import cv2
|
|
10
9
|
import geopandas as gpd
|
|
11
10
|
import matplotlib.pyplot as plt
|
|
12
11
|
import numpy as np
|
|
@@ -440,6 +439,7 @@ class ObjectDetector:
|
|
|
440
439
|
Returns:
|
|
441
440
|
List of polygons as lists of (x, y) coordinates
|
|
442
441
|
"""
|
|
442
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
443
443
|
|
|
444
444
|
# Get parameters from kwargs or use instance defaults
|
|
445
445
|
simplify_tolerance = kwargs.get("simplify_tolerance", self.simplify_tolerance)
|
|
@@ -637,6 +637,8 @@ class ObjectDetector:
|
|
|
637
637
|
Returns:
|
|
638
638
|
GeoDataFrame with objects
|
|
639
639
|
"""
|
|
640
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
641
|
+
|
|
640
642
|
# Use class defaults if parameters not provided
|
|
641
643
|
simplify_tolerance = (
|
|
642
644
|
simplify_tolerance
|
|
@@ -2165,6 +2167,7 @@ class ObjectDetector:
|
|
|
2165
2167
|
Returns:
|
|
2166
2168
|
GeoDataFrame with car detections and confidence values
|
|
2167
2169
|
"""
|
|
2170
|
+
import cv2 # Lazy import to avoid QGIS opencv conflicts
|
|
2168
2171
|
|
|
2169
2172
|
def _process_single_component(
|
|
2170
2173
|
component_mask: np.ndarray,
|