pip 安装后仍需克隆仓库才能拿到 trainer.py 和 configs 配置文件;开发环境推荐用 mamba 创建,且官方仅在 Linux + CUDA GPU 上测试过;训练需通过 trainer.py 配合 configs/config.yaml 运行,不能只靠 pip 包完成。
model
Clay-foundationApache-2.0更新放缓开源的地球观测基础模型,能把 Sentinel-1/2 卫星影像和数字高程数据转成向量嵌入,方便做地表特征检索与下游分析。
The Clay Foundation Model - An open source AI model and interface for Earth
pip install git+https://github.com/Clay-foundation/model.gitREADME 未说明具体显存要求;仅注明 mamba 环境创建命令已在带 CUDA GPU 的 Linux 设备上测试过,未提及 CPU 运行或 GPU 厂商型号。
面向地球观测的开源 AI 模型与接口,提供可直接调用的预训练权重与训练流程
开源的地球观测基础模型,能把 Sentinel-1/2 卫星影像和数字高程数据转成向量嵌入,方便做地表特征检索与下游分析。
核心能力
- 提供 Apache 许可的源码与训练好的模型权重
- 以 pip 包 claymodel 形式提供数据模块与模型模块
- 基于 PyTorch Lightning 的 LightningCLI 驱动训练与验证
- 附带 Jupyter Book 文档与 Binder、SageMaker 在线教程
- 用 mamba 环境文件一键搭建含 JupyterLab 的开发环境
容易踩的坑
- v1.0.1v1.0.1 Pip installable最新正式版2025-07-05 · 2025-07-05 10:54 UTC
What's Changed
- Add changelog for v1.0 by @yellowcap in https://github.com/Clay-foundation/model/pull/267
- Fix duplicate transform bug by @srmsoumya in https://github.com/Clay-foundation/model/pull/268
- Fix launch buttons by @yellowcap in https://github.com/Clay-foundation/model/pull/273
- Classifier downstream task by @srmsoumya in https://github.com/Clay-foundation/model/pull/270
- Remove model_clay.py by @srmsoumya in https://github.com/Clay-foundation/model/pull/281
- Point latest release to v1.0 by @fnands in https://github.com/Clay-foundation/model/pull/286
- Regression example of Clay by @srmsoumya in https://github.com/Clay-foundation/model/pull/285
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/Clay-foundation/model/pull/289
- Fix link in README by @yellowcap in https://github.com/Clay-foundation/model/pull/293
- Add example for simple classification on embeddings by @yellowcap in https://github.com/Clay-foundation/model/pull/292
- Fix relative paths by @yellowcap in https://github.com/Clay-foundation/model/pull/295
- Add no sign request flag to segment scripts and readme by @yellowcap in https://github.com/Clay-foundation/model/pull/298
- Register embeddings finetune in toc by @yellowcap in https://github.com/Clay-foundation/model/pull/297
- Organise finetune code and docs by @yellowcap in https://github.com/Clay-foundation/model/pull/301
- V1 model inference with NAIP by @lillythomas in https://github.com/Clay-foundation/model/pull/247
- Add entry for naip sim search tutorial to toc by @lillythomas in https://github.com/Clay-foundation/model/pull/306
- Added Planetscope SR mapping by @jonasViehweger in https://github.com/Clay-foundation/model/pull/319
- Fix formatting and typos by @clausmichele in https://github.com/Clay-foundation/model/pull/316
- Adjust s5cmd invocation flags by @wboykinm in https://github.com/Clay-foundation/model/pull/322
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/Clay-foundation/model/pull/327
- Updating dead link:
mambainstall by @MaxLenormand in https://github.com/Clay-foundation/model/pull/330 - Unpin timm and pyarrow by @weiji14 in https://github.com/Clay-foundation/model/pull/310
- Update to v1.5 by @yellowcap in https://github.com/Clay-foundation/model/pull/334
- Update tutorials to Clay v1.5 by @srmsoumya in https://github.com/Clay-foundation/model/pull/336
- correct link to v1.5 ckpt by @rbavery in https://github.com/Clay-foundation/model/pull/337
- Add modis sampling to docs by @yellowcap in https://github.com/Clay-foundation/model/pull/335
- Update documentation to reflect v1.5 by @srmsoumya in https://github.com/Clay-foundation/model/pull/339
- Fix Typo in Embeddings Tutorial by @Brayden-Zhang in https://github.com/Clay-foundation/model/pull/344
- Update licensing information in documentation to Apache by @brunosan in https://github.com/Clay-foundation/model/pull/351
- Fix deprecated version of
actions/upload-artifact: v3by @brunosan in https://github.com/Clay-foundation/model/pull/352 - fix-table-formatting by @abarciauskas-bgse in https://github.com/Clay-foundation/model/pull/354
- All for Satellogic EarthView by @brunosan in https://github.com/Clay-foundation/model/pull/350
- Create package by @brunosan in https://github.com/Clay-foundation/model/pull/359
New Contributors
- @fnands made their first contribution in https://github.com/Clay-foundation/model/pull/286
- @jonasViehweger made their first contribution in https://github.com/Clay-foundation/model/pull/319
- @clausmichele made their first contribution in https://github.com/Clay-foundation/model/pull/316
- @wboykinm made their first contribution in https://github.com/Clay-foundation/model/pull/322
- @rbavery made their first contribution in https://github.com/Clay-foundation/model/pull/337
- @Brayden-Zhang made their first contribution in https://github.com/Clay-foundation/model/pull/344
- @abarcia
- v1.02024-06-06 · 2024-06-06 10:55 UTC
查看更新说明
Release v1.0 (2024/06/06)
💫 Highlights
- 🎉 Release of Clay Foundation Model v1.0 🎉
🚀 Model
- Datamodule & Model for Clay v1 by @srmsoumya in https://github.com/Clay-foundation/model/pull/253
🗃️ Data Pipeline
- Moved data pipeline code into stacchip a dedicated library for the data wrangling
📖 Documentation
- Clay over aoi by @yellowcap in https://github.com/Clay-foundation/model/pull/116
- Convert run-over-aoi ipynb to md by @yellowcap in https://github.com/Clay-foundation/model/pull/122
- Static Documentation for v0.1 by @brunosan in https://github.com/Clay-foundation/model/pull/118
- Document data sampling strategy by @yellowcap in https://github.com/Clay-foundation/model/pull/124
- Updating location to download imagery script in docs by @MaxLenormand in https://github.com/Clay-foundation/model/pull/198
- Change "Radiant Earth Foundation" to "Radiant Earth" in docs by @kbgg in https://github.com/Clay-foundation/model/pull/214
- Update instructions to re-lock conda-lock.yml file by @weiji14 in https://github.com/Clay-foundation/model/pull/225
- chore(docs): correct typos and improve stylistic consistency by @kelseyjosund in https://github.com/Clay-foundation/model/pull/232
- Partial inputs - Pakistan flood tutorial by @lillythomas in https://github.com/Clay-foundation/model/pull/154
- Obtain patch level metadata (e.g. geospatial bounds and cloud cover), save and demo DEP use case (sim search) by @lillythomas in https://github.com/Clay-foundation/model/pull/172
- Obtain patch level cloud coverage percentages by @lillythomas in https://github.com/Clay-foundation/model/pull/184
- Tutorial on burn scar analysis using embeddings from partial inputs by @yellowcap in https://github.com/Clay-foundation/model/pull/149
- Doc updates by @brunosan in https://github.com/Clay-foundation/model/pull/230
- Update specification.md by @brunosan in https://github.com/Clay-foundation/model/pull/250
- Add notebook showing how to run v1 by @yellowcap in https://github.com/Clay-foundation/model/pull/254
- Documented v1 sampling strategy by @yellowcap in https://github.com/Clay-foundation/model/pull/249
- Updates the mamba install instructions link. by @dbonomo in https://github.com/Clay-foundation/model/pull/252
- Remove clay-v0-tutorials & add visualize embeddings for v1 by @srmsoumya in https://github.com/Clay-foundation/model/pull/256
- Minor spelling fix by @tylere in https://github.com/Clay-foundation/model/pull/260
- Shorten comment line length by @yellowcap in https://github.com/Clay-foundation/model/pull/261
- Refactor docs by moving v0 docs into separate section by @yellowcap in https://github.com/Clay-foundation/model/pull/262
- Docs v1 continued by @yellowcap in https://github.com/Clay-foundation/model/pull/263
- Documented metadata file for normalization and wavelenghts by @yellowcap in https://github.com/Clay-foundation/model/pull/266
- [small change] add source.coop link by @brunosan in https://github.com/Clay-foundation/model/pull/137
- Segmentation on Clay by @srmsoumya in https://github.com/Clay-foundation/model/pull/257
🧰 Maintenance
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/Clay-foundation/model/pull/206
- Bump conda-lock from 2.5.1 to 2.5.6 by @weiji14 in https://github.com/Clay-foundation/model/pull/183
- Remove scripts folder by @yellowcap in https://github.com/Clay-foundation/model/pull/265
- Unified v1 and v0 environments by @yellowcap in https://github.com/Clay-foundation/model/pull/264
- Add osx-arm64 platform to conda-lock.yml file and GitHub Actions CI by @weiji14 in https://github.com/Clay-foundation/model/pull/164
- Move pipeline scripts into dedicated folder by @yellowcap in https://github.com/Clay-foundation/model/pull/163
- Memory buildup clean by @brunosan in https://github.com/Clay-foundation/model/pull/158
- Add osx platform to conda loc
- v0.0.1pre-release2024-01-12 · 2024-01-12 06:21 UTC
查看更新说明
Release v0.0.1 (2024/01/12)
💫 Highlights
- 🎉 First release of Clay Foundation Model 🎉
- Implement MAE with support for position, time, latlon & channel embeddings (#47)
🚀 Model
- Generate embeddings from CLAYModule trained with latlon/time encodings (#96)
- Add multigpu support & UI to test embeddings (#109)
- Refactor model for multi-device usage and easier disabling of masking (#95)
- Rename embeddings file to include MGRS code and store GeoTIFF source_url (#86)
- Callback function to log Masked Autoencoder reconstructions to WandB (#88)
- Adapt model to load 512x512 images from s3 bucket (#85)
- Save embeddings with spatiotemporal metadata to GeoParquet (#73)
- Generate embeddings via prediction loop (#56)
- Initial Vision Transformer architecture with MAE decoder (#37)
🗃️ Data Pipeline
- Adapted sampling strategy (#81)
- Allow ClayDataModule to load GeoTIFF files directly from s3 (#92)
- Let ClayDataModule return same spatiotemporal fields as GeoTIFFDataModule (#91)
- Improve date handling for data pipeline (#76)
- Let LightningDataModule return spatiotemporal metadata (#66)
- check for no data on a tile level in sentinel 1 vv and vh, sentinel 2 and DEM (#60)
- Batch setup (#54)
- LightningDataModule to load GeoTIFF files (#52)
- Ready for batch (#44)
- Tiler module (#41)
- Landcover based sampling strategy (#29)
- Datacube (#27)
📖 Documentation
- Document how the benchmark dataset labels were prepared (#100)
- Document how to finetune pretrained model on downstream task (#99)
- Document how to generate vector embeddings (#98)
- Document how to run the datacube pipeline with a batch job (#97)
- Initialize Jupyter Book documentation (#89)
- Setting the model license to OpenRail-M (#63)
- Create CODE_OF_CONDUCT.md (#53)
🧰 Maintenance
- Bump pytorch from 2.0.0 to 2.1.0, CUDA from 11.8 to 12.0 (#51)
- Add pre-commit hooks with ruff formatter/linter rules (#26)
- Setup GitHub Actions Continuous Integration tests (#25)
- Setup LightningCLI trainer script (#24)
- Initial conda environment and binder links (#15)
🧑🤝🧑 Contributors
- @brunosan
- [@lillythomas]
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Clay Foundation Model
An open source AI model and interface for Earth.
License
Clay Model is licensed under the Apache. This applies to the source code as well as the trained model weights.
The Documentation is licensed under the CC-BY-4.0 license.
Quickstart
Launch into a JupyterLab environment on
| Binder | SageMaker Studio Lab |
|---|---|
Installation
Pip Installation (Recommended)
The easiest way to install Clay Foundation Model is via pip:
pip install git+https://github.com/Clay-foundation/model.git
This will install the claymodel package and all its dependencies. You can then import and use it in your Python code:
from claymodel.datamodule import ClayDataModule
from claymodel.module import ClayMAEModule
Development Installation
For development or advanced usage, you can set up the full development environment:
To help out with development, start by cloning this repo-url
git clone <repo-url>
cd model
Then we recommend using mamba to install the dependencies. A virtual environment will also be created with Python and JupyterLab installed.
mamba env create --file environment.yml
[!NOTE] The command above has been tested on Linux devices with CUDA GPUs.
Activate the virtual environment first.
mamba activate claymodel
Finally, double-check that the libraries have been installed.
mamba list
Usage
Running jupyter lab
mamba activate claymodel
python -m ipykernel install --user --name claymodel # to install virtual env properly
jupyter kernelspec list --json # see if kernel is installed
jupyter lab &
Running the model
The neural network model can be run via LightningCLI v2.
[!NOTE] If you installed via pip, you'll need to clone the repository to access the trainer script and config files.
To check out the different options available, and look at the hyperparameter configurations, run:
python trainer.py --help
To quickly test the model on one batch in the validation set:
python trainer.py fit --model ClayMAEModule --data ClayDataModule --config configs/config.yaml --trainer.fast_dev_run=True
To train the model:
python trainer.py fit --model ClayMAEModule --data ClayDataModule --config configs/config.yaml
More options can be found using python trainer.py fit --help, or at the
LightningCLI docs.
Contributing
Writing documentation
Our Documentation uses Jupyter Book.
Install it with:
pip install -U jupyter-book
Then build it with:
jupyter-book build docs/
You can preview the site locally with:
python -m http.server --directory _build/html
There is a GitHub Action on .github/workflows/deploy-docs.yml that builds the site and pushes it to GitHub Pages.