Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    UnidentifiedImageError
Message:      cannot identify image file <_io.BytesIO object at 0x7efe318a2570>
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
                  return get_rows(
                         ^^^^^^^^^
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
                  rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2690, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2240, in __iter__
                  example = _apply_feature_types_on_example(
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2159, in _apply_feature_types_on_example
                  decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/features/features.py", line 2204, in decode_example
                  column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/features/features.py", line 1508, in decode_nested_example
                  return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) if obj is not None else None
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/features/image.py", line 192, in decode_example
                  image = PIL.Image.open(BytesIO(bytes_))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/PIL/Image.py", line 3498, in open
                  raise UnidentifiedImageError(msg)
              PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7efe318a2570>

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

S2-100K

A complete re-host of the S2-100K dataset used to train SatCLIP (Klemmer et al., 2023).

100,000 globally sampled multi-spectral Sentinel-2 L2A image patches (256×256 px, 12 bands, uint16), with longitude/latitude coordinates for each patch.

Why this re-host?

The original Microsoft-hosted blob (https://satclip.blob.core.windows.net/...) is the canonical source. The only public mirror, davanstrien/satclip, is missing some patches (discussion). This repo is a verified-complete copy: 100,000 / 100,000 patches present, sourced directly from the original Microsoft container.

File layout

metadata.parquet        # fn, lon, lat, patch_idx, shard  (100,000 rows)
index.csv               # fn, lon, lat (verbatim from upstream)
data/shard-00000.tar    # patches 0..999
data/shard-00001.tar    # patches 1000..1999
...
data/shard-00099.tar    # patches 99000..99999
satclip.tar             # all 100,000 patches in one tar (78 GB) - included as a safety copy

Each shard is a plain (uncompressed) tar containing 1000 patch_<N>.tif files. Sharding the original 78 GB tar makes resumable downloads and partial loads practical; the single satclip.tar is included as well so users can grab everything at once if they prefer.

Per-patch format

Each patch_<N>.tif is a GeoTIFF with:

  • Shape: 256 × 256 pixels
  • Bands: 12 (Sentinel-2 L2A: B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12 — B10 is excluded)
  • dtype: uint16 (raw reflectance, scale by 10,000 to get [0,1])
  • CRS: UTM zone of the source raster (EPSG:326XX / 327XX)
  • Resolution: 10 m

Note: Pillow / datasets.Image cannot decode 12-band uint16 GeoTIFFs. Use rasterio (or tifffile) to read these files.

Loading

Stream a few shards directly

import io
import tarfile

import rasterio
from huggingface_hub import hf_hub_download

shard_path = hf_hub_download(
    repo_id="kklmmr/s2-100k",
    filename="data/shard-00000.tar",
    repo_type="dataset",
)

with tarfile.open(shard_path) as tar:
    member = tar.getmember("patch_42.tif")
    buf = tar.extractfile(member).read()

with rasterio.MemoryFile(buf) as mem, mem.open() as src:
    arr = src.read()           # shape: (12, 256, 256), dtype uint16
    bounds = src.bounds        # UTM bbox
    crs = src.crs              # e.g. EPSG:32610

Pair patches with their coordinates

import pandas as pd
from huggingface_hub import hf_hub_download

meta_path = hf_hub_download(
    repo_id="kklmmr/s2-100k",
    filename="metadata.parquet",
    repo_type="dataset",
)
meta = pd.read_parquet(meta_path)
# columns: fn, lon, lat, patch_idx, shard

Download everything

from huggingface_hub import snapshot_download

local_dir = snapshot_download(
    repo_id="kklmmr/s2-100k",
    repo_type="dataset",
    local_dir="./s2-100k",
)

Provenance

This repository contains only the dataset. The pretrained SatCLIP model checkpoints are available from the original SatCLIP authors.

License

MIT, matching the upstream SatCLIP project.

Citation

@article{klemmer2023satclip,
  title={SatCLIP: Global, General-Purpose Location Embeddings with Satellite Imagery},
  author={Klemmer, Konstantin and Rolf, Esther and Robinson, Caleb and Mackey, Lester and Ru{\ss}wurm, Marc},
  journal={arXiv preprint arXiv:2311.17179},
  year={2023}
}
Downloads last month
256

Paper for torchgeo/s2-100k