Views
No views yet
config.json, model.safetensors, preprocessor, and remote code) for feature extraction on FMoW satellite imagery.modeling_satmae_pp.py, processor, pipeline) and load with trust_remote_code=True.| Folder | Dataset | Encoder | Channels | Image | Patch | Legacy file |
|---|---|---|---|---|---|---|
satmae-pp-vit-large-patch16-fmow-rgb-pretrain | FMoW-RGB | vanilla ViT | 3 (BGR) | 224 | 16 | checkpoint_ViT-L_pretrain_fmow_rgb.pth |
satmae-pp-vit-large-patch8-fmow-sentinel-pretrain | FMoW-Sentinel | group-channel ViT | 10 | 96 | 8 | checkpoint_ViT-L_pretrain_fmow_sentinel.pth |
.pth filename mapping is in conversion_manifest.json.do_resize: false. Inputs keep native height and width; FMoW mean/std normalization still applies when enabled.1from transformers import pipeline
2import numpy as np
3
4REPO = "/path/to/SATMAE-PP-transformers"
5SUBFOLDER = "satmae-pp-vit-large-patch8-fmow-sentinel-pretrain"
6
7pipe = pipeline(
8 task="satmae-pp-feature-extraction",
9 model=REPO,
10 trust_remote_code=True,
11 model_kwargs={"subfolder": SUBFOLDER},
12)
13
14# FMoW-Sentinel: 10 bands at native size (e.g. 96×96 or larger)
15image = np.random.randint(0, 255, (128, 128, 10), dtype=np.uint8)
16features = pipe(image, pool=True, return_tensors=True)
17print(features.shape) # [1, 1024]1SUBFOLDER = "satmae-pp-vit-large-patch16-fmow-rgb-pretrain"
2pipe = pipeline(
3 task="satmae-pp-feature-extraction",
4 model=REPO,
5 trust_remote_code=True,
6 model_kwargs={"subfolder": SUBFOLDER},
7)
8image = np.random.randint(0, 255, (384, 384, 3), dtype=np.uint8)
9features = pipe(image, pool=True, return_tensors=True)
10print(features.shape) # [1, 1024]96×96 sentinel / 224×224 RGB):features = pipe(image, pool=True, return_tensors=True, image_processor_kwargs={"do_resize": True})1from transformers import AutoModel, AutoImageProcessor
2
3model = AutoModel.from_pretrained(REPO, subfolder=SUBFOLDER, trust_remote_code=True)
4processor = AutoImageProcessor.from_pretrained(REPO, subfolder=SUBFOLDER, trust_remote_code=True)do_normalize=True). FMoW-RGB models expect BGR channel order; the processor swaps RGB→BGR when channel_order="bgr".transformers, torch, timm, safetensorsopencv-python (multispectral resize with more than 4 channels)1@inproceedings{satmaepp2024rethinking,
2 title={Rethinking Transformers Pre-training for Multi-Spectral Satellite Imagery},
3 author={Mubashir Noman and Muzammal Naseer and Hisham Cholakkal and Rao Muhammad Anwar and Salman Khan and Fahad Shahbaz Khan},
4 year={2024},
5 booktitle={CVPR}
6}