Views
No views yet
1from transformers import AutoModel
2import torch
3
4# Load model from HuggingFace Hub
5model = AutoModel.from_pretrained("ozlabs/siad-wm-medium", trust_remote_code=True)
6model.inference_mode()
7
8# Prepare inputs
9obs_context = torch.randn(1, 8, 256, 256) # Current observation
10actions = torch.randn(1, 6, 2) # 6-month climate actions
11
12# Run prediction (with decoder for pixel-space output)
13with torch.no_grad():
14 z0 = model.encode(obs_context)
15 z_pred = model.rollout(z0, actions, H=6)
16 x_pred = model.decode(z_pred) # [1, 6, 8, 256, 256] - Decode to pixels
17
18print(f"Predicted 6 months (pixels): {{x_pred.shape}}")
19
201import numpy as np
2import matplotlib.pyplot as plt
3
4def create_rgb(bands: np.ndarray) -> np.ndarray:
5 """Create RGB composite from 8-band satellite image"""
6 rgb = bands[[2, 1, 0]].transpose(1, 2, 0) # [H, W, 3]
7
8 for i in range(3):
9 channel = rgb[:, :, i]
10 vmin, vmax = np.percentile(channel, [2, 98])
11 rgb[:, :, i] = np.clip((channel - vmin) / (vmax - vmin + 1e-8), 0, 1)
12
13 return rgb
14
15# Visualize first prediction
16x_first = x_pred[0, 0].cpu().numpy() # [8, 256, 256]
17rgb = create_rgb(x_first)
18plt.imshow(rgb)
19plt.axis("off")
20plt.show()1# Full forward pass with loss computation
2outputs = model(
3 obs_context=obs_context,
4 actions_rollout=actions,
5 obs_targets=targets, # Ground truth for loss
6 return_dict=True
7)
8
9print(f"Loss: {outputs.loss}")
10print(f"Predictions: {outputs.predictions.shape}")
11print(f"Metrics: {outputs.metrics}")1latent_dim: 1024
2encoder_blocks: 8
3encoder_heads: 16
4encoder_mlp_dim: 4096
5transition_blocks: 12
6transition_heads: 16
7transition_mlp_dim: 4096
8dropout: 0.11@misc{siad_world_model,
2 title={SIAD: Satellite Imagery Anticipatory Dynamics},
3 author={OzLabs.ai},
4 year={2025},
5 howpublished={\url{https://huggingface.co/ozlabs/siad-wm-medium}},
6}