This codebase integrates OlmoEarth's pretrained geospatial foundation model with the Moondream2 Vision-Language Model (VLM) to enable text generation and semantic search on satellite imagery.
Video of the Streamlit Web App working with Chat + Semantic Search functionalities of the trained VLM Model over the entire ChatEarthNet dataset:
pip install -e .pip install -e .[dev])../chatearthnet_data (or point --data_dir to your path when training).
tools/installing/install_chatearthnet_dataset.pytools/installing/download_checkpoint.pyolmoearth_vlm_bridge.py
GeospatialQueryEncoder
OlmoEarthVLMBridge
ModelID, e.g. OLMOEARTH_V1_NANO).vikhyatk/moondream2 by default).Key init arguments (see code for full details):
olmoearth_model_id (default: ModelID.OLMOEARTH_V1_NANO)
vlm_model_id (default: "vikhyatk/moondream2")
freeze_olmoearth (default: True)
True, OlmoEarth encoder is kept frozen; only fusion + VLM parameters train.freeze_vlm_vision (default: False)
use_lora (default: True)
lora_r, lora_alpha (defaults: 16, 32)
num_geo_queries (default: 32)
device (default: "cuda" if available)
Additional behavior:
inference/inference_olmoearth_vlm.py
Script to generate text descriptions for satellite images using a trained bridge model.
Main CLI arguments:
--model_path (required): Path to a saved OlmoEarthVLMBridge checkpoint directory.--image_path (required): Path to the satellite RGB image.--prompt: Text prompt to steer the description (default is a generic "describe this image").--max_length, --temperature, --top_p, --top_k: Standard decoding parameters.--device: cuda or cpu (defaults to cuda if available).Example:
python -m vlm.inference.inference_olmoearth_vlm \
--model_path vlm_full_checkpoints/best_model \
--image_path path/to/image.png \
--prompt "Describe the land use and vegetation in this scene."
If model_path does not contain a config.json, the script will instantiate a fresh OlmoEarthVLMBridge with default settings.
training/train_olmoearth_vlm.py
Training script for the bridge model on the ChatEarthNet dataset.
Important model arguments:
--olmoearth_model: One of OLMOEARTH_V1_NANO, OLMOEARTH_V1_TINY, OLMOEARTH_V1_BASE, OLMOEARTH_V1_LARGE.--vlm_model: VLM model id (default vikhyatk/moondream2).--fusion_type: Fusion module type (set to geospatial_queries)--num_geo_queries: Number of geospatial query tokens (default 32).--freeze_olmoearth: Freeze OlmoEarth encoder (on by default).--freeze_vlm_vision: Freeze the VLM vision tower.--use_lora, --lora_r, --lora_alpha: Control lora settingsImportant training arguments:
--data_dir: Path to ChatEarthNet data (default ./chatearthnet_data).--output_dir: Directory for checkpoints (default ./olmoearth_vlm_checkpoints).--batch_size, --accumulation_steps--num_epochs, --learning_rate, --warmup_steps, --weight_decay.--save_every, --validate_every: Steps between checkpointing and validation.--device: cuda or cpu.Example (single GPU):
python -m vlm.training.train_olmoearth_vlm \
--data_dir ./chatearthnet_data \
--output_dir ./olmoearth_vlm_checkpoints \
--olmoearth_model OLMOEARTH_V1_NANO \
--vlm_model vikhyatk/moondream2 \
--batch_size 4 \
--accumulation_steps 4 \
--num_epochs 2 \
--use_lora --freeze_olmoearth
training/launch_olmoearth_vlm_training.sh for shell script to launch training with a pre-defined set of hyperparameters and environment flags.
Many thanks to the original authors of OlmoEarth, Moondream2, and ChatEarthNet for their foundational work.
Python
94.5%
Shell
2.9%
Jupyter Notebook
2.0%
This codebase integrates OlmoEarth's pretrained geospatial foundation model with the Moondream2 Vision-Language Model (VLM) to enable text generation and semantic search on satellite imagery.
Video of the Streamlit Web App working with Chat + Semantic Search functionalities of the trained VLM Model over the entire ChatEarthNet dataset:
pip install -e .pip install -e .[dev])../chatearthnet_data (or point --data_dir to your path when training).
tools/installing/install_chatearthnet_dataset.pytools/installing/download_checkpoint.pyolmoearth_vlm_bridge.py
GeospatialQueryEncoder
OlmoEarthVLMBridge
ModelID, e.g. OLMOEARTH_V1_NANO).vikhyatk/moondream2 by default).Key init arguments (see code for full details):
olmoearth_model_id (default: ModelID.OLMOEARTH_V1_NANO)
vlm_model_id (default: "vikhyatk/moondream2")
freeze_olmoearth (default: True)
True, OlmoEarth encoder is kept frozen; only fusion + VLM parameters train.freeze_vlm_vision (default: False)
use_lora (default: True)
lora_r, lora_alpha (defaults: 16, 32)
num_geo_queries (default: 32)
device (default: "cuda" if available)
Additional behavior:
inference/inference_olmoearth_vlm.py
Script to generate text descriptions for satellite images using a trained bridge model.
Main CLI arguments:
--model_path (required): Path to a saved OlmoEarthVLMBridge checkpoint directory.--image_path (required): Path to the satellite RGB image.--prompt: Text prompt to steer the description (default is a generic "describe this image").--max_length, --temperature, --top_p, --top_k: Standard decoding parameters.--device: cuda or cpu (defaults to cuda if available).Example:
python -m vlm.inference.inference_olmoearth_vlm \
--model_path vlm_full_checkpoints/best_model \
--image_path path/to/image.png \
--prompt "Describe the land use and vegetation in this scene."
If model_path does not contain a config.json, the script will instantiate a fresh OlmoEarthVLMBridge with default settings.
training/train_olmoearth_vlm.py
Training script for the bridge model on the ChatEarthNet dataset.
Important model arguments:
--olmoearth_model: One of OLMOEARTH_V1_NANO, OLMOEARTH_V1_TINY, OLMOEARTH_V1_BASE, OLMOEARTH_V1_LARGE.--vlm_model: VLM model id (default vikhyatk/moondream2).--fusion_type: Fusion module type (set to geospatial_queries)--num_geo_queries: Number of geospatial query tokens (default 32).--freeze_olmoearth: Freeze OlmoEarth encoder (on by default).--freeze_vlm_vision: Freeze the VLM vision tower.--use_lora, --lora_r, --lora_alpha: Control lora settingsImportant training arguments:
--data_dir: Path to ChatEarthNet data (default ./chatearthnet_data).--output_dir: Directory for checkpoints (default ./olmoearth_vlm_checkpoints).--batch_size, --accumulation_steps--num_epochs, --learning_rate, --warmup_steps, --weight_decay.--save_every, --validate_every: Steps between checkpointing and validation.--device: cuda or cpu.Example (single GPU):
python -m vlm.training.train_olmoearth_vlm \
--data_dir ./chatearthnet_data \
--output_dir ./olmoearth_vlm_checkpoints \
--olmoearth_model OLMOEARTH_V1_NANO \
--vlm_model vikhyatk/moondream2 \
--batch_size 4 \
--accumulation_steps 4 \
--num_epochs 2 \
--use_lora --freeze_olmoearth
training/launch_olmoearth_vlm_training.sh for shell script to launch training with a pre-defined set of hyperparameters and environment flags.
Many thanks to the original authors of OlmoEarth, Moondream2, and ChatEarthNet for their foundational work.
Python
94.5%
Shell
2.9%
Jupyter Notebook
2.0%