SATtxt is a vision-language foundation model for satellite imagery. We train only the projection heads, keeping both encoders frozen.
1git clone https://github.com/ikhado/sattxt.git
2cd sattxt
3pip install -r requirements.txt
4pip install flash-attn --no-build-isolation # Required for LLM2Vec
1import sys
2from pathlib import Path
3
4import torch
5
6sys.path.insert(0, str(Path(__file__).resolve().parent / "thirdparty" / "dinov3"))
7
8from sattxt.model import SATtxt
9from sattxt.utils import image_loader, get_preprocess, zero_shot_classify
10device = "cuda:0" if torch.cuda.is_available() else "cpu"
11
12model = SATtxt(
13 dinov3_weights_path="/PATH/TO/dinov3_vitl16_pretrain_sat493m-eadcf0ff.pth",
14 sattxt_vision_head_pretrain_weights="/PATH/TO/sattxt_vision_head.pt",
15 text_encoder_id="McGill-NLP/LLM2Vec-Meta-Llama-3-8B-Instruct-mntp",
16 sattxt_text_head_pretrain_weights="/PATH/TO/sattxt_text_head.pt",
17).to(device).eval()
18
19categories = [
20 "AnnualCrop", "Forest", "HerbaceousVegetation", "Highway", "Industrial",
21 "Pasture", "PermanentCrop", "Residential", "River", "SeaLake"
22]
23
24image = image_loader("./asset/Residential_167.jpg")
25image_tensor = get_preprocess(is_ms=False, all_bands=False)(image).unsqueeze(0).to(device)
26
27logits, pred_idx = zero_shot_classify(model, image_tensor, categories)
28
29print("Prediction:", categories[pred_idx.item()])
1@misc{do2026sattxt,
2 title={Spectrally Distilled Representations Aligned with Instruction-Augmented LLMs for Satellite Imagery},
3 author={Minh Kha Do and Wei Xiang and Kang Han and Di Wu and Khoa Phan and Yi-Ping Phoebe Chen and Gaowen Liu and Ramana Rao Kompella},
4 year={2026},
5 eprint={2602.22613},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2602.22613},
9}
We pretrained the model with:
Lightning-Hydra-Template
We use evaluation scripts from:
MS-CLIP and
Pangaea-Bench
We also use LLMs (such as ChatGPT and Claude) for code refactoring.
We welcome contributions and issues to further improve SATtxt.