Views
No views yet
1pip install git+https://github.com/terrastackai/terratorch.git@multimodal
2pip install impactmesh1import torch
2from terratorch.cli_tools import LightningInferenceModel
3
4# Load TerraTorch task from
5task = LightningInferenceModel.from_config(
6 "terramind_v1_base_impactmesh_fire.yaml",
7 "TerraMind_v1_base_ImpactMesh_fire.pt",
8)
9
10model = task.model.model # Get model from Lighting task
11model.eval()
12
13# Inputs with shape [B, C, T, H, W]
14input = {
15 "S2L2A": torch.randn([1, 12, 4, 256, 256]),
16 "S1RTC": torch.randn([1, 2, 4, 256, 256]),
17 "DEM": torch.randn([1, 1, 4, 256, 256]), # Repeated per timestep
18}
19
20# Run inference
21with torch.no_grad():
22 pred = model(input).output
23
24y_hat = pred.argmax(dim=1)terratorch predict -c "terramind_v1_base_impactmesh_fire.yaml" --ckpt "TerraMind_v1_base_ImpactMesh_fire.pt" --predict_output_dir output/impactmesh_fire_predictions --predict_data_root "path/to/data/"