Views
No views yet
config.json, model.safetensors, preprocessor, and remote code) for geospatial feature extraction.modeling_mmearth.py, processor, pipeline) and load with trust_remote_code=True.| Folder | Input | Size | Dataset | Loss | Image | Patch | Ch |
|---|---|---|---|---|---|---|---|
mmearth-convnextv2-atto-all-mod-1m-64-uncertainty-56x8 | all_mod | atto | 1M_64 | uncertainty | 56 | 8 | 12 |
mmearth-convnextv2-atto-all-mod-1m-64-unweighted-56x8 | all_mod | atto | 1M_64 | unweighted | 56 | 8 | 12 |
mmearth-convnextv2-atto-all-mod-1m-128-uncertainty-112x16 | all_mod | atto | 1M_128 | uncertainty | 112 | 16 | 12 |
mmearth-convnextv2-atto-all-mod-100k-128-uncertainty-112x16 | all_mod | atto | 100k_128 | uncertainty | 112 | 16 | 12 |
mmearth-convnextv2-tiny-all-mod-1m-64-uncertainty-56x8 | all_mod | tiny | 1M_64 | uncertainty | 56 | 8 | 12 |
mmearth-convnextv2-atto-s2-1m-64-uncertainty-56x8 | S2 | atto | 1M_64 | uncertainty | 56 | 8 | 12 |
mmearth-convnextv2-atto-rgb-1m-64-uncertainty-56x8 | rgb (BGR) | atto | 1M_64 | uncertainty | 56 | 8 | 3 |
mmearth-convnextv2-atto-rgb-1m-128-uncertainty-112x16 | rgb (BGR) | atto | 1M_128 | uncertainty | 112 | 16 | 3 |
mmearth-convnextv2-atto-img-mod-1m-64-uncertainty-56x8 | img_mod | atto | 1M_64 | uncertainty | 56 | 8 | 12 |
mmearth-convnextv2-atto-pix-mod-1m-64-uncertainty-56x8 | pix_mod | atto | 1M_64 | uncertainty | 56 | 8 | 12 |
.pth filename mapping is in conversion_manifest.json.do_resize: false. Inputs keep native height and width. Apply per-band MMEarth normalization when you have dataset statistics (image_mean / image_std).1from transformers import pipeline
2import numpy as np
3
4MODEL = "/path/to/MMEarth-transformers/mmearth-convnextv2-atto-rgb-1m-64-uncertainty-56x8"
5
6pipe = pipeline(
7 task="mmearth-feature-extraction",
8 model=MODEL,
9 trust_remote_code=True,
10)
11
12# RGB/BGR: 3 bands at native size (56×56 for this checkpoint)
13image = np.random.rand(56, 56, 3).astype(np.float32) * 1000
14features = pipe(image, pool=True, return_tensors=True)
15print(features.shape) # torch.Size([1, 320])1MODEL = "/path/to/MMEarth-transformers/mmearth-convnextv2-atto-all-mod-1m-64-uncertainty-56x8"
2pipe = pipeline(task="mmearth-feature-extraction", model=MODEL, trust_remote_code=True)
3
4image = np.random.rand(56, 56, 12).astype(np.float32) * 1000
5features = pipe(image, pool=True, return_tensors=True)
6print(features.shape) # torch.Size([1, 320])1tokens = pipe(image, pool=False, return_tensors=True)
2print(tokens.shape) # [1, num_patches, hidden_size]features = pipe(image, pool=True, return_tensors=True, image_processor_kwargs={"do_resize": True})1from transformers import AutoModel, AutoImageProcessor
2
3model = AutoModel.from_pretrained(MODEL, trust_remote_code=True)
4processor = AutoImageProcessor.from_pretrained(MODEL, trust_remote_code=True)config.json:1"custom_pipelines": {
2 "mmearth-feature-extraction": {
3 "impl": "pipeline_mmearth.MMEarthImageFeatureExtractionPipeline",
4 "pt": ["AutoModel"]
5 }
6}trust_remote_code=True loads MMEarthImageFeatureExtractionPipeline, which extends the standard ImageFeatureExtractionPipeline with numpy array and file path support.image-feature-extraction task also works:pipe = pipeline(task="image-feature-extraction", model=MODEL, trust_remote_code=True)data_*_band_stats.json. The converted preprocessor defaults to do_normalize: false because band statistics are not embedded in the legacy checkpoints. Provide your own image_mean / image_std when preprocessing:1features = pipe(
2 image,
3 pool=True,
4 return_tensors=True,
5 image_processor_kwargs={
6 "do_normalize": True,
7 "image_mean": [...], # one value per channel
8 "image_std": [...],
9 },
10)channel_order="bgr".transformers, torch, timm, safetensorsopencv-python (multispectral resize with more than 4 channels when do_resize=True)1@inproceedings{nedungadi2024mmearth,
2 title={MMEarth: Exploring multi-modal pretext tasks for geospatial representation learning},
3 author={Nedungadi, Vishal and Kariryaa, Ankit and Oehmcke, Stefan and Belongie, Serge and Igel, Christian and Lang, Nico},
4 booktitle={European Conference on Computer Vision},
5 pages={164--182},
6 year={2024},
7 organization={Springer}
8}