geoai-py 0.3.0__tar.gz → 0.3.1__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.3.0 → geoai_py-0.3.1}/PKG-INFO +1 -1
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/installation.md +8 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/__init__.py +1 -1
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/extract.py +7 -1
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/preprocess.py +7 -1
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/utils.py +44 -3
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/PKG-INFO +1 -1
- {geoai_py-0.3.0 → geoai_py-0.3.1}/pyproject.toml +2 -2
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.editorconfig +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/dependabot.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/docs-build.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/docs.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/macos.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/pypi.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/ubuntu.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.github/workflows/windows.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.gitignore +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/.pre-commit-config.yaml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/LICENSE +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/MANIFEST.in +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/README.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/CNAME +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/changelog.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/contributing.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/download.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/building_footprints_usa.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/building_regularization.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/data_visualization.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/dataviz/lidar_viz.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/dataviz/raster_viz.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/dataviz/vector_viz.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/download_data.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/image_chips.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/jupytext.toml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/rastervision/semantic_segmentation.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/arcgis.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/automatic_mask_generator.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/automatic_mask_generator_hq.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/box_prompts.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/fast_sam.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/input_prompts.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/input_prompts_hq.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/maxar_open_data.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/satellite-predictor.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/satellite.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/swimming_pools.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/text_prompts.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/samgeo/text_prompts_batch.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/examples/view_metadata.ipynb +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/extract.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/faq.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/geoai.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/index.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/overrides/main.html +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/preprocess.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/segmentation.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/usage.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/docs/utils.md +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/download.py +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/geoai.py +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai/segmentation.py +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/SOURCES.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/dependency_links.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/entry_points.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/requires.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/geoai_py.egg-info/top_level.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/mkdocs.yml +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/requirements.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/requirements_docs.txt +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/setup.cfg +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/tests/__init__.py +0 -0
- {geoai_py-0.3.0 → geoai_py-0.3.1}/tests/test_geoai.py +0 -0
|
@@ -76,6 +76,14 @@ If you encounter issues with the sqlite package, you can update it using the fol
|
|
|
76
76
|
mamba update -c conda-forge sqlite
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
+
### Notes for Windows Users
|
|
80
|
+
|
|
81
|
+
If you use mamba to install geoai, you may not have the latest version of torchgeo, which may cause issues when importing geoai. To fix this, you can install the latest version of torchgeo using the following command:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install -U torchgeo
|
|
85
|
+
```
|
|
86
|
+
|
|
79
87
|
### 👩💻 Development Installation
|
|
80
88
|
|
|
81
89
|
For contributing to GeoAI development, install directly from the source repository:
|
|
@@ -7,7 +7,6 @@ import geopandas as gpd
|
|
|
7
7
|
from tqdm import tqdm
|
|
8
8
|
|
|
9
9
|
import cv2
|
|
10
|
-
from torchgeo.datasets import NonGeoDataset
|
|
11
10
|
from torchvision.models.detection import maskrcnn_resnet50_fpn
|
|
12
11
|
import torchvision.transforms as T
|
|
13
12
|
import rasterio
|
|
@@ -16,6 +15,13 @@ from rasterio.features import shapes
|
|
|
16
15
|
from huggingface_hub import hf_hub_download
|
|
17
16
|
from .preprocess import get_raster_stats
|
|
18
17
|
|
|
18
|
+
try:
|
|
19
|
+
from torchgeo.datasets import NonGeoDataset
|
|
20
|
+
except ImportError as e:
|
|
21
|
+
raise ImportError(
|
|
22
|
+
"Your torchgeo version is too old. Please upgrade to the latest version using 'pip install -U torchgeo'."
|
|
23
|
+
)
|
|
24
|
+
|
|
19
25
|
|
|
20
26
|
class BuildingFootprintDataset(NonGeoDataset):
|
|
21
27
|
"""
|
|
@@ -18,10 +18,16 @@ import matplotlib.pyplot as plt
|
|
|
18
18
|
from tqdm import tqdm
|
|
19
19
|
from torchvision.transforms import RandomRotation
|
|
20
20
|
from shapely.affinity import rotate
|
|
21
|
-
import torchgeo
|
|
22
21
|
import torch
|
|
23
22
|
import cv2
|
|
24
23
|
|
|
24
|
+
try:
|
|
25
|
+
import torchgeo
|
|
26
|
+
except ImportError as e:
|
|
27
|
+
raise ImportError(
|
|
28
|
+
"Your torchgeo version is too old. Please upgrade to the latest version using 'pip install -U torchgeo'."
|
|
29
|
+
)
|
|
30
|
+
|
|
25
31
|
|
|
26
32
|
def download_file(url, output_path=None, overwrite=False):
|
|
27
33
|
"""
|
|
@@ -12,9 +12,15 @@ import xarray as xr
|
|
|
12
12
|
import rioxarray
|
|
13
13
|
import rasterio as rio
|
|
14
14
|
from torch.utils.data import DataLoader
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
from torchgeo.
|
|
15
|
+
|
|
16
|
+
try:
|
|
17
|
+
from torchgeo.datasets import RasterDataset, stack_samples, unbind_samples, utils
|
|
18
|
+
from torchgeo.samplers import RandomGeoSampler, Units
|
|
19
|
+
from torchgeo.transforms import indices
|
|
20
|
+
except ImportError as e:
|
|
21
|
+
raise ImportError(
|
|
22
|
+
"Your torchgeo version is too old. Please upgrade to the latest version using 'pip install -U torchgeo'."
|
|
23
|
+
)
|
|
18
24
|
|
|
19
25
|
|
|
20
26
|
def view_raster(
|
|
@@ -1039,3 +1045,38 @@ def adaptive_regularization(
|
|
|
1039
1045
|
return gpd.GeoDataFrame(geometry=results, crs=building_polygons.crs)
|
|
1040
1046
|
else:
|
|
1041
1047
|
return results
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
def install_package(package):
|
|
1051
|
+
"""Install a Python package.
|
|
1052
|
+
|
|
1053
|
+
Args:
|
|
1054
|
+
package (str | list): The package name or a GitHub URL or a list of package names or GitHub URLs.
|
|
1055
|
+
"""
|
|
1056
|
+
import subprocess
|
|
1057
|
+
|
|
1058
|
+
if isinstance(package, str):
|
|
1059
|
+
packages = [package]
|
|
1060
|
+
elif isinstance(package, list):
|
|
1061
|
+
packages = package
|
|
1062
|
+
else:
|
|
1063
|
+
raise ValueError("The package argument must be a string or a list of strings.")
|
|
1064
|
+
|
|
1065
|
+
for package in packages:
|
|
1066
|
+
if package.startswith("https"):
|
|
1067
|
+
package = f"git+{package}"
|
|
1068
|
+
|
|
1069
|
+
# Execute pip install command and show output in real-time
|
|
1070
|
+
command = f"pip install {package}"
|
|
1071
|
+
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
|
|
1072
|
+
|
|
1073
|
+
# Print output in real-time
|
|
1074
|
+
while True:
|
|
1075
|
+
output = process.stdout.readline()
|
|
1076
|
+
if output == b"" and process.poll() is not None:
|
|
1077
|
+
break
|
|
1078
|
+
if output:
|
|
1079
|
+
print(output.decode("utf-8").strip())
|
|
1080
|
+
|
|
1081
|
+
# Wait for process to complete
|
|
1082
|
+
process.wait()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "geoai-py"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
dynamic = [
|
|
5
5
|
"dependencies",
|
|
6
6
|
]
|
|
@@ -47,7 +47,7 @@ universal = true
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
[tool.bumpversion]
|
|
50
|
-
current_version = "0.3.
|
|
50
|
+
current_version = "0.3.1"
|
|
51
51
|
commit = true
|
|
52
52
|
tag = true
|
|
53
53
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|