Image Feature Extraction
Transformers
Safetensors
English
vision
sar
remote-sensing
synthetic-aperture-radar
masked-autoencoder
model-hub
Instructions to use BiliSakura/SARMAE-transformers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BiliSakura/SARMAE-transformers with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="BiliSakura/SARMAE-transformers")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BiliSakura/SARMAE-transformers", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Add SARMAE transformers Hub model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
language: en
|
| 4 |
+
tags:
|
| 5 |
+
- vision
|
| 6 |
+
- image-feature-extraction
|
| 7 |
+
- sar
|
| 8 |
+
- remote-sensing
|
| 9 |
+
- synthetic-aperture-radar
|
| 10 |
+
- masked-autoencoder
|
| 11 |
+
- model-hub
|
| 12 |
+
library_name: transformers
|
| 13 |
+
pipeline_tag: image-feature-extraction
|
| 14 |
+
datasets:
|
| 15 |
+
- Wenquandan777/SAR-1M
|
| 16 |
+
arxiv: 2512.16635
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# SARMAE Transformers Checkpoints
|
| 20 |
+
|
| 21 |
+
Official Hugging Face Transformers-format releases of [SARMAE](https://arxiv.org/abs/2512.16635) ViT encoders, converted for native `transformers` inference with `trust_remote_code=True`.
|
| 22 |
+
|
| 23 |
+
| Resource | Link |
|
| 24 |
+
|----------|------|
|
| 25 |
+
| Paper | [2512.16635](https://arxiv.org/abs/2512.16635) |
|
| 26 |
+
| Training dataset | [Wenquandan777/SAR-1M](https://huggingface.co/datasets/Wenquandan777/SAR-1M) |
|
| 27 |
+
| Legacy PyTorch weights | [Wenquandan777/SARMAE](https://huggingface.co/Wenquandan777/SARMAE) |
|
| 28 |
+
| Source code | [GitHub](https://github.com/BiliSakura/SARMAE-transformers) |
|
| 29 |
+
|
| 30 |
+
## Available checkpoints
|
| 31 |
+
|
| 32 |
+
| Variant | Backbone | Stage | Hidden | Layers | Heads | Input |
|
| 33 |
+
|---------|----------|-------|--------|--------|-------|-------|
|
| 34 |
+
| [sarmae-vit-base-patch16-pretrain](https://huggingface.co/BiliSakura/SARMAE-transformers/tree/main/vit-base-patch16-pretrain) | ViT-B | pretrain | 768 | 12 | 12 | 224 |
|
| 35 |
+
| [sarmae-vit-large-patch16-pretrain](https://huggingface.co/BiliSakura/SARMAE-transformers/tree/main/vit-large-patch16-pretrain) | ViT-L | pretrain | 1024 | 24 | 16 | 224 |
|
| 36 |
+
|
| 37 |
+
## Installation
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
pip install transformers timm torch torchvision safetensors huggingface_hub
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
|
| 45 |
+
Point `transformers.pipeline` or `AutoModel.from_pretrained` at a variant subfolder:
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
from transformers import pipeline
|
| 49 |
+
|
| 50 |
+
pipe = pipeline(
|
| 51 |
+
task="image-feature-extraction",
|
| 52 |
+
model="BiliSakura/SARMAE-transformers",
|
| 53 |
+
revision="main",
|
| 54 |
+
trust_remote_code=True,
|
| 55 |
+
model_kwargs={"subfolder": "vit-base-patch16-pretrain"},
|
| 56 |
+
)
|
| 57 |
+
features = pipe(sar_image, pool=True, return_tensors=True)
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Or load a variant directly:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import AutoModel
|
| 64 |
+
|
| 65 |
+
model = AutoModel.from_pretrained(
|
| 66 |
+
"BiliSakura/SARMAE-transformers",
|
| 67 |
+
subfolder="vit-base-patch16-pretrain",
|
| 68 |
+
trust_remote_code=True,
|
| 69 |
+
)
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Each variant folder is a self-contained model repository with:
|
| 73 |
+
|
| 74 |
+
- `config.json` (`auto_map`, `custom_pipelines`)
|
| 75 |
+
- `model.safetensors`
|
| 76 |
+
- `preprocessor_config.json`
|
| 77 |
+
- `modeling_sarmae.py`, `image_processing_sarmae.py`, `pipeline_sarmae.py`
|
| 78 |
+
|
| 79 |
+
## Convert legacy checkpoints locally
|
| 80 |
+
|
| 81 |
+
```bash
|
| 82 |
+
python scripts/convert_checkpoint.py models/SARMAE_vitb_checkpoint-last
|
| 83 |
+
python scripts/convert_checkpoint.py models/SARMAE_vitl_checkpoint-last
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
## Upload to this Hub repo
|
| 87 |
+
|
| 88 |
+
```bash
|
| 89 |
+
python scripts/upload_to_hub.py models/sarmae-vit-base-patch16-pretrain \
|
| 90 |
+
--path-in-repo vit-base-patch16-pretrain
|
| 91 |
+
python scripts/upload_to_hub.py models/sarmae-vit-large-patch16-pretrain \
|
| 92 |
+
--path-in-repo vit-large-patch16-pretrain
|
| 93 |
+
python scripts/upload_to_hub.py --hub-readme-only
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Citation
|
| 97 |
+
|
| 98 |
+
```bibtex
|
| 99 |
+
@misc{liu2025sarmaemaskedautoencodersar,
|
| 100 |
+
title={SARMAE: Masked Autoencoder for SAR Representation Learning},
|
| 101 |
+
author={Danxu Liu and Di Wang and Hebaixu Wang and Haoyang Chen and Wentao Jiang and Yilin Cheng and Haonan Guo and Wei Cui and Jing Zhang},
|
| 102 |
+
year={2025},
|
| 103 |
+
eprint={2512.16635},
|
| 104 |
+
archivePrefix={arXiv},
|
| 105 |
+
primaryClass={cs.CV},
|
| 106 |
+
url={https://arxiv.org/abs/2512.16635},
|
| 107 |
+
}
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## License
|
| 111 |
+
|
| 112 |
+
[CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)
|