Views
No views yet
1import torch
2from eo_vae.models.new_autoencoder import EOFluxVAE
3
4model = EOFluxVAE.from_pretrained(
5 repo_id="nilsleh/eo-vae",
6 ckpt_filename="eo-vae.ckpt",
7 config_filename="model_config.yaml",
8 device="cpu",
9)
10
11# Run reconstruction / latent extraction
12x = torch.randn(1, 3, 256, 256)
13# Example wavelengths for Sentinel-2 RGB
14wvs = torch.tensor([0.665, 0.56, 0.49], dtype=torch.float32)
15
16with torch.no_grad():
17 recon = model.reconstruct(x, wvs) # [B, 3, 256, 256]
18 z = model.encode_spatial_normalized(x, wvs) # [B, 32, 32, 32] for 256x256 input1WAVELENGTHS = {
2 'S2RGB': [0.665, 0.56, 0.49],
3 'S1RTC': [5.4, 5.6],
4 'S2L2A': [
5 0.443, 0.490, 0.560, 0.665, 0.705, 0.740,
6 0.783, 0.842, 0.865, 1.610, 2.190, 0.945,
7 ],
8 'S2L1C': [
9 0.443, 0.490, 0.560, 0.665, 0.705, 0.740,
10 0.783, 0.842, 0.865, 0.945, 1.375, 1.610, 2.190,
11 ],
12}1@article{eo-vae,
2 title={EO-VAE: Towards A Multi-sensor Tokenizer for Earth Observation Data},
3 author={Lehmann, Nils and Wang, Yi and Xiong, Zhitong and Zhu, Xiaoxiang},
4 journal={arXiv preprint arXiv:2602.12177},
5 year={2026}
6}