feat(models): integrate OLMoEarth embedding model#3
Open
go-bananas-wwj wants to merge 7 commits intoOpenGeoScope:mainfrom
Open
feat(models): integrate OLMoEarth embedding model#3go-bananas-wwj wants to merge 7 commits intoOpenGeoScope:mainfrom
go-bananas-wwj wants to merge 7 commits intoOpenGeoScope:mainfrom
Conversation
- Add models/olmoearth_model.py with Base size, MEAN pooling, and band reordering - Register OLMoEarth in core/model_manager.py and generate_embeddings.py - Add olmoearth config block to configs/config.yaml - Add olmoearth-pretrain-minimal to requirements.txt - Include OLMoEarth in Image Search and Mixed Search dropdowns in app.py
Replace cv2.INTER_NEAREST with cv2.INTER_CUBIC in MajorTOM_Embedder for higher-quality 12-band multispectral resizing needed by OLMoEarth.
Add embeddings_*/, *.pkl, *.npy, and olmoearth_*.png to .gitignore.
- Update all 'four models' references to 'six models' - Add OLMoEarth to modality table and dataset table - Add OLMoEarth compatibility note with conda environment setup - Add OLMoEarth citation [10] and acknowledgements - Update CONTRIBUTING.md architecture tree
- Update dataset name to Core-S2L2A-249k-OlmoEarth-Base - Rename all user-facing strings from OLMoEarth to OlmoEarth - Update ModelScope dataset path in configs/config.yaml - Keep class name OlmoEarthModel unchanged
- Add Prerequisites section for README.md YAML metadata header - Add Option B for updating existing studios - Fix Git URL domain (modelscope.cn for China, modelscope.ai for international) - Add --force push explanation for diverged histories - Add Troubleshooting table with 5 common issues
- Add missing self.requires_multiband = True so search_engine routes multiband data correctly instead of passing RGB directly. - Fix PIL.Image branch band indices: construct tensor in MajorTOM order [B01..B12] so _prepare_input's reordering produces correct OlmoEarth order instead of double-reordering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(models): integrate OLMoEarth embedding model
Overview
This PR adds OLMoEarth (Allen AI's Earth-system foundation model) as the 6th embedding model to Eart
hEmbeddingExplorer, alongside SigLIP, FarSLIP, SatCLIP, DINOv2, and Clay.
OLMoEarth is a multimodal, spatio-temporal foundation model trained on Sentinel-2 L2A and 6 derived geos
patial maps (OpenStreetMap, WorldCover, SRTM DEM, etc.). It excels at capturing spectral and spatial pat
terns from 12-band multispectral imagery, making it a strong candidate for pure visual similarity search
in remote-sensing applications.
Paper: Herzog et al., 2025 — OlmoEarth: Stable Latent Image Modeling for Multimodal Earth Observati
on
What Changed
feat(models)models/olmoearth_model.py,core/model_manager.py,generate_embeddings.py, `requ,configs/config.yaml,app.py`fix(majortom)MajorTOM/embedder/MajorTOM_Embedder.pyINTER_CUBICinstead of `INTER_NEAREchore(gitignore).gitignoreembeddings_*/,*.pkl, `docs(readme, doc, contributing)README.md,doc.md,CONTRIBUTING.mdKey Technical Details
1. Band Reordering
MajorTOM stores bands as
[B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12], but OLMoEarth expects
[B02, B03, B04, B08, B05, B06, B07, B8A, B11, B12, B01, B09]. The wrapper handles this transparently in
_prepare_input().2. Pooling Strategy
We use
PoolingType.MEAN(matching the officialallenai/olmoearth_ml4rs_tutorial) rather than MAX pooling. Raw embeddings have L2 norm ~10.3 and are not normalized during storage/encoding to stay consi
stent with the official tutorial.
3. Retrieval Normalization
To avoid polar clustering (polar embeddings have systematically higher norms ~10.5 vs ~10.2), we apply
F.normalize()only insidesearch(), converting dot products to cosine similarity in[-1, 1].4. Complete Metadata
The OLMoEarth embedding GeoParquet now includes
parquet_urlandparquet_rowcolumns copied from thereference DINOv2/SatCLIP dataset (all 6 models share identical 248,719 samples in the same order). This
means no fallback code is needed — the normal
_fetch_top_k_imagespath works out of the box.Dataset
WeijieWu/olmoearth_embdding(824 MB, 248,719 rows, 768-dim float32)ntions
Major-TOM/Core-S2L2A-249k(same as other 5 models)Environment Compatibility
olmoearth-pretrain-minimalrequirestorch >= 2.8, < 2.9. For users with older PyTorch versions, we recommend a dedicated conda environment: