Views
No views yet
[!WARNING] we do not have a full checkpoint conversion validation, if you encounter pipeline loading failure and unsidered output, please contact me via bili_sakura@zju.edu.cn
.pth file into standard transformers-style artifacts:config.jsonmodel.safetensorspath/to/raw/AgriFM.pthencoder.*), which was remapped to Hugging Face PreTrainedModel state dict conventions.(B, T, C, H, W):HLSL30: C=6S2: C=10Modis: C=71import torch
2from AgriFM.models import AgriFMConfig, AgriFMModel
3
4model_dir = "path/to/AgriFM"
5config = AgriFMConfig.from_pretrained(model_dir)
6model = AgriFMModel.from_pretrained(model_dir, config=config)
7model.eval()
8
9B, T, H, W = 1, 32, 256, 256
10pixel_values = {
11 "HLSL30": torch.randn(B, T, 6, H, W),
12 "S2": torch.randn(B, T, 10, H, W),
13 "Modis": torch.randn(B, T, 7, H, W),
14}
15
16with torch.no_grad():
17 outputs = model(pixel_values=pixel_values)
18 features = outputs.features
19print(features.shape)environment.yml from Bili-Sakura/AgriFM-transformers1@article{li2026agrifm,
2 title={AgriFM: A multi-source temporal remote sensing foundation model for Agriculture mapping},
3 author={Li, Wenyuan and Liang, Shunlin and Chen, Keyan and Chen, Yongzhe and Ma, Han and Xu, Jianglei and Ma, Yichuan and Zhang, Yuxiang and Guan, Shikang and Fang, Husheng and others},
4 journal={Remote Sensing of Environment},
5 volume={334},
6 pages={115234},
7 year={2026},
8 publisher={Elsevier}
9}