Feat/user data input - #128
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
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.
Summary
Adds a bring-your-own-data path: users with their own imagery (local patches, exported GeoTIFFs, training cubes) can compute embeddings directly, with no provider fetch and no GEE auth.
What's in here
UserDatadeclaration: register imagery once (pixels + collection + one band name per channel + optional spatial/temporal); the declaration, not the array shape, is the contract.bandsmay be omitted only for the canonical 12-band S2 L2A case; band identity is never guessed.NIR_NARROW → B8A); a collection mismatch or missing band raisesModelErrornaming what is missing; precomputed models always refuse.list_models_for_datareports the verdict for every catalog model without loading weights.get_embedding_from_data(model, data)/get_embeddings_batch_from_data(model, datas, batch_size=...); batch items carry their own spatial/temporal, dispatch grouped, results in input order.batch_sizecaps the per-forward batch for small GPUs.input_prep="tile"default for fairness: arrays larger than a model's input size are cut into model-native tiles at native resolution and stitched, so a 256px patch reaches clay as one pass and galileo as a 4×4 grid of 64px tiles instead of losing 15/16 of its pixels to a resize;"resize"opts out.EmbedderBase.resolve_input_image_sizehook; olmoearth (FlexiViT) consumes any patch-divisible size as one seamless pass by default, warns above 512px (quadratic attention cost), and an explicitimage_sizerestores fixed-size tiling._requires_georef(clay/prithvi refuse spatial-less data — coordinates are never fabricated),resolve_input_image_size, olmoearthtiled_dispatch_model_config.get_embeddings_batch_from_inputsno longer acquires a provider for prefetched inputs (it forced Earth Engine auth on GEE-less machines; single path already followed the lazy-provider convention).docs/user_data.md(site-style admonitions, complete GeoTIFF-to-embedding and directory-to-feature-matrix examples), Input size column in the models overview, CHANGELOG entries.Testing
test_user_data_matching.py+test_api_from_data.py(mock embedders, no weights/network;list_models_for_dataalso exercised against the real catalog), clay/olmoearth regression tests, contract tests updated deliberately (tiled_dispatchregistry now pins{thor, olmoearth}); affected suites incl.test_export_input_prep_consistency.pypass, ruff clean.