Feature Extraction
Transformers
Safetensors
English
remote-sensing
earth-observation
self-supervised-learning
satellite
multispectral
vision
satmae
satmae-pp
vit
mae
Instructions to use BiliSakura/SATMAE-PP-transformers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BiliSakura/SATMAE-PP-transformers with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="BiliSakura/SATMAE-PP-transformers")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BiliSakura/SATMAE-PP-transformers", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Sync updated code and configs (no weight re-upload)
Browse files- README.md +12 -4
- satmae-pp-vit-large-patch16-fmow-rgb-pretrain/__pycache__/modeling_satmae_pp.cpython-311.pyc +0 -0
- satmae-pp-vit-large-patch16-fmow-rgb-pretrain/image_processing_satmae_pp.py +1 -1
- satmae-pp-vit-large-patch16-fmow-rgb-pretrain/preprocessor_config.json +1 -1
- satmae-pp-vit-large-patch8-fmow-sentinel-pretrain/image_processing_satmae_pp.py +1 -1
- satmae-pp-vit-large-patch8-fmow-sentinel-pretrain/preprocessor_config.json +1 -1
README.md
CHANGED
|
@@ -52,11 +52,13 @@ Legacy `.pth` filename mapping is in [`conversion_manifest.json`](conversion_man
|
|
| 52 |
|
| 53 |
## Usage
|
| 54 |
|
|
|
|
|
|
|
| 55 |
```python
|
| 56 |
from transformers import pipeline
|
| 57 |
import numpy as np
|
| 58 |
|
| 59 |
-
REPO = "
|
| 60 |
SUBFOLDER = "satmae-pp-vit-large-patch8-fmow-sentinel-pretrain"
|
| 61 |
|
| 62 |
pipe = pipeline(
|
|
@@ -66,8 +68,8 @@ pipe = pipeline(
|
|
| 66 |
model_kwargs={"subfolder": SUBFOLDER},
|
| 67 |
)
|
| 68 |
|
| 69 |
-
# FMoW-Sentinel: 10 bands
|
| 70 |
-
image = np.random.randint(0, 255, (
|
| 71 |
features = pipe(image, pool=True, return_tensors=True)
|
| 72 |
print(features.shape) # [1, 1024]
|
| 73 |
```
|
|
@@ -82,11 +84,17 @@ pipe = pipeline(
|
|
| 82 |
trust_remote_code=True,
|
| 83 |
model_kwargs={"subfolder": SUBFOLDER},
|
| 84 |
)
|
| 85 |
-
image = np.random.randint(0, 255, (
|
| 86 |
features = pipe(image, pool=True, return_tensors=True)
|
| 87 |
print(features.shape) # [1, 1024]
|
| 88 |
```
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
Load components directly:
|
| 91 |
|
| 92 |
```python
|
|
|
|
| 52 |
|
| 53 |
## Usage
|
| 54 |
|
| 55 |
+
Processors default to **`do_resize: false`**. Inputs keep native height and width; FMoW mean/std normalization still applies when enabled.
|
| 56 |
+
|
| 57 |
```python
|
| 58 |
from transformers import pipeline
|
| 59 |
import numpy as np
|
| 60 |
|
| 61 |
+
REPO = "/path/to/SATMAE-PP-transformers"
|
| 62 |
SUBFOLDER = "satmae-pp-vit-large-patch8-fmow-sentinel-pretrain"
|
| 63 |
|
| 64 |
pipe = pipeline(
|
|
|
|
| 68 |
model_kwargs={"subfolder": SUBFOLDER},
|
| 69 |
)
|
| 70 |
|
| 71 |
+
# FMoW-Sentinel: 10 bands at native size (e.g. 96×96 or larger)
|
| 72 |
+
image = np.random.randint(0, 255, (128, 128, 10), dtype=np.uint8)
|
| 73 |
features = pipe(image, pool=True, return_tensors=True)
|
| 74 |
print(features.shape) # [1, 1024]
|
| 75 |
```
|
|
|
|
| 84 |
trust_remote_code=True,
|
| 85 |
model_kwargs={"subfolder": SUBFOLDER},
|
| 86 |
)
|
| 87 |
+
image = np.random.randint(0, 255, (384, 384, 3), dtype=np.uint8)
|
| 88 |
features = pipe(image, pool=True, return_tensors=True)
|
| 89 |
print(features.shape) # [1, 1024]
|
| 90 |
```
|
| 91 |
|
| 92 |
+
To resize to the pretraining reference (`96×96` sentinel / `224×224` RGB):
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
features = pipe(image, pool=True, return_tensors=True, image_processor_kwargs={"do_resize": True})
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
Load components directly:
|
| 99 |
|
| 100 |
```python
|
satmae-pp-vit-large-patch16-fmow-rgb-pretrain/__pycache__/modeling_satmae_pp.cpython-311.pyc
ADDED
|
Binary file (20.7 kB). View file
|
|
|
satmae-pp-vit-large-patch16-fmow-rgb-pretrain/image_processing_satmae_pp.py
CHANGED
|
@@ -74,7 +74,7 @@ class SatMAEppImageProcessor(BaseImageProcessor):
|
|
| 74 |
|
| 75 |
def __init__(
|
| 76 |
self,
|
| 77 |
-
do_resize: bool =
|
| 78 |
size: Optional[dict[str, int]] = None,
|
| 79 |
resample: PILImageResampling = PILImageResampling.BILINEAR,
|
| 80 |
do_rescale: bool = False,
|
|
|
|
| 74 |
|
| 75 |
def __init__(
|
| 76 |
self,
|
| 77 |
+
do_resize: bool = False,
|
| 78 |
size: Optional[dict[str, int]] = None,
|
| 79 |
resample: PILImageResampling = PILImageResampling.BILINEAR,
|
| 80 |
do_rescale: bool = False,
|
satmae-pp-vit-large-patch16-fmow-rgb-pretrain/preprocessor_config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"height": 224,
|
| 5 |
"width": 224
|
| 6 |
},
|
| 7 |
-
"do_resize":
|
| 8 |
"do_rescale": false,
|
| 9 |
"do_normalize": true,
|
| 10 |
"do_convert_rgb": false,
|
|
|
|
| 4 |
"height": 224,
|
| 5 |
"width": 224
|
| 6 |
},
|
| 7 |
+
"do_resize": false,
|
| 8 |
"do_rescale": false,
|
| 9 |
"do_normalize": true,
|
| 10 |
"do_convert_rgb": false,
|
satmae-pp-vit-large-patch8-fmow-sentinel-pretrain/image_processing_satmae_pp.py
CHANGED
|
@@ -74,7 +74,7 @@ class SatMAEppImageProcessor(BaseImageProcessor):
|
|
| 74 |
|
| 75 |
def __init__(
|
| 76 |
self,
|
| 77 |
-
do_resize: bool =
|
| 78 |
size: Optional[dict[str, int]] = None,
|
| 79 |
resample: PILImageResampling = PILImageResampling.BILINEAR,
|
| 80 |
do_rescale: bool = False,
|
|
|
|
| 74 |
|
| 75 |
def __init__(
|
| 76 |
self,
|
| 77 |
+
do_resize: bool = False,
|
| 78 |
size: Optional[dict[str, int]] = None,
|
| 79 |
resample: PILImageResampling = PILImageResampling.BILINEAR,
|
| 80 |
do_rescale: bool = False,
|
satmae-pp-vit-large-patch8-fmow-sentinel-pretrain/preprocessor_config.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
"height": 96,
|
| 5 |
"width": 96
|
| 6 |
},
|
| 7 |
-
"do_resize":
|
| 8 |
"do_rescale": false,
|
| 9 |
"do_normalize": true,
|
| 10 |
"do_convert_rgb": false,
|
|
|
|
| 4 |
"height": 96,
|
| 5 |
"width": 96
|
| 6 |
},
|
| 7 |
+
"do_resize": false,
|
| 8 |
"do_rescale": false,
|
| 9 |
"do_normalize": true,
|
| 10 |
"do_convert_rgb": false,
|