geoai-py 0.3.6__py2.py3-none-any.whl → 0.4.0__py2.py3-none-any.whl
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/__init__.py +1 -1
- geoai/download.py +9 -8
- geoai/extract.py +65 -24
- geoai/geoai.py +3 -1
- geoai/hf.py +447 -0
- geoai/segment.py +4 -3
- geoai/segmentation.py +8 -7
- geoai/train.py +1039 -0
- geoai/utils.py +12 -15
- {geoai_py-0.3.6.dist-info → geoai_py-0.4.0.dist-info}/METADATA +1 -1
- geoai_py-0.4.0.dist-info/RECORD +15 -0
- geoai_py-0.3.6.dist-info/RECORD +0 -13
- {geoai_py-0.3.6.dist-info → geoai_py-0.4.0.dist-info}/LICENSE +0 -0
- {geoai_py-0.3.6.dist-info → geoai_py-0.4.0.dist-info}/WHEEL +0 -0
- {geoai_py-0.3.6.dist-info → geoai_py-0.4.0.dist-info}/entry_points.txt +0 -0
- {geoai_py-0.3.6.dist-info → geoai_py-0.4.0.dist-info}/top_level.txt +0 -0
geoai/segment.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"""This module provides functionality for segmenting high-resolution satellite imagery using vision-language models."""
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
|
|
4
5
|
import numpy as np
|
|
6
|
+
import rasterio
|
|
5
7
|
import torch
|
|
6
|
-
from tqdm import tqdm
|
|
7
8
|
from PIL import Image
|
|
8
|
-
import rasterio
|
|
9
9
|
from rasterio.windows import Window
|
|
10
|
-
from
|
|
10
|
+
from tqdm import tqdm
|
|
11
|
+
from transformers import CLIPSegForImageSegmentation, CLIPSegProcessor
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class CLIPSegmentation:
|
geoai/segmentation.py
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import os
|
|
2
|
+
|
|
3
|
+
import albumentations as A
|
|
4
|
+
import matplotlib.pyplot as plt
|
|
2
5
|
import numpy as np
|
|
3
|
-
from PIL import Image
|
|
4
6
|
import torch
|
|
5
|
-
import matplotlib.pyplot as plt
|
|
6
|
-
from torch.utils.data import Dataset, Subset
|
|
7
7
|
import torch.nn.functional as F
|
|
8
|
-
from sklearn.model_selection import train_test_split
|
|
9
|
-
import albumentations as A
|
|
10
8
|
from albumentations.pytorch import ToTensorV2
|
|
9
|
+
from PIL import Image
|
|
10
|
+
from sklearn.model_selection import train_test_split
|
|
11
|
+
from torch.utils.data import Dataset, Subset
|
|
11
12
|
from transformers import (
|
|
13
|
+
DefaultDataCollator,
|
|
14
|
+
SegformerForSemanticSegmentation,
|
|
12
15
|
Trainer,
|
|
13
16
|
TrainingArguments,
|
|
14
|
-
SegformerForSemanticSegmentation,
|
|
15
|
-
DefaultDataCollator,
|
|
16
17
|
)
|
|
17
18
|
|
|
18
19
|
|