Introducing Whirld for Running Geospatial Foundation Models Locally

Suppose you have a Sentinel-2 scene and want to see whether Clay can find places that resemble a site you know. Before you can try it, you need to get the model running on your machine, work out which bands it expects and how to scale them, divide the scene into image chips, and keep track of where each chip came from. Some mistakes are easier to spot than others. A missing dependency stops the run, so that’s fairly obvious. Putting the bands in the wrong order can still get you a plausible result, so that’s harder to troubleshoot.

We built Whirld to make this kind of work easier. The idea was an “Ollama for geospatial foundation models.” If you’ve used Ollama to try a language model, the experience should feel familiar. You pick a model, download it, and run it on your own machine. With satellite imagery, there’s an extra step. The pixels you have may need some work before they’re the pixels the model expects.

Whirld handles that preparation through an open-source command-line tool and Python library. Each supported model has an explicit description of the imagery it accepts and the preparation it requires. Whirld uses that information to select and order bands, resample pixels, apply scaling and normalization, and create chips. It keeps track of each chip’s location so you can compare the results with the source imagery.

Whirld currently supports three workflows.

  • Where else in this scene looks like my reference site? Clay v1.5 produces an embedding for each chip. You can compare those embeddings in Python, rank the chips by similarity to your reference, and use the accompanying spatial metadata to inspect the closest matches on a map.
  • Which description best fits this part of the scene? RemoteCLIP compares each chip with text prompts you supply. Whirld writes the scores and chip footprints to GeoJSON so you can see where each description ranked highest.
  • Which pixels show a burn scar or surface water? Whirld supports two separately trained Prithvi models. One maps burn scars in Harmonized Landsat Sentinel-2 (HLS) imagery. The other maps water in Sentinel-2 Level-1C imagery for flood analysis. Both produce a mask you can open as a GeoTIFF in your GIS.

The quickest way to try Whirld is with the RemoteCLIP demo included in Whirld 0.4.0. It uses a small Sentinel-2 image over Sacramento, so you can run it before choosing imagery of your own. The quickstart guide shows how to install the release, check your setup with whirld doctor, and run the demo.

Once you’ve installed it, run these commands from the directory containing your virtual environment.

.venv/bin/whirld doctor
.venv/bin/whirld demo --output quickstart-results

The demo runs on a CPU without a GPU and requires about 4GB of RAM. The first run will download 408.4 MB of RemoteCLIP RN50 weights in addition to the Python dependencies installed during setup. Subsequent runs will reuse the verified weights.

Open quickstart-results/preview.html in a browser to see the four chip footprints over the source image, or open scores.geojson in your GIS to inspect their scores. In the recorded run, the urban prompt ranked highest for all four chips. Each score reflects how well the chip matched that description relative to the other choices: farmland, forest, and water. Changing the prompts changes the comparison. The scores don’t measure the probability that a chip is urban land cover.

Contains modified Copernicus Sentinel data 2024, via Element 84.

To use your own imagery, start with the sensor and processing level of a scene you know. The Sacramento demo, for example, uses Sentinel-2 Level-2A imagery, while the Prithvi flood model expects Level-1C. A .tif extension and familiar band names alone won’t tell you whether a scene is suitable. The worked examples show how to go from imagery to results for similarity search, text-prompt classification, and burn-scar mapping.

For larger scenes, Whirld can read local GeoTIFFs, STAC items, and remote Cloud Optimized GeoTIFFs in batches, writing results to disk as it goes. Batching limits how many image chips Whirld holds in memory at once, though the model, its runtime, and the raster decoder also need memory. The streaming guide describes the grid requirements in more detail. Inputs must use north-up projected grids in metres, and assets read together from a STAC item must share a coordinate reference system.

Whirld is an early project, and we’ve kept the initial set of models and input combinations small. For the burn-scar workflow, we’ve published a four-case evaluation with reference labels so you can reproduce the measurements and see how the model performed on those scenes.

If you try Whirld with your own imagery, we’d like to hear what you were trying to learn, which data you used, and where you ran into difficulty. You can share that feedback through GitHub issues. If you’ve fixed a bug or made an improvement, we’d welcome a pull request.