Datasets:
File size: 2,588 Bytes
5e65a6c 4131906 5e65a6c 2155bc7 286387b 2155bc7 286387b 2155bc7 44dab90 2155bc7 deb53b9 2155bc7 286387b 2155bc7 4131906 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
---
license: mit
task_categories:
- image-feature-extraction
language:
- en
tags:
- sentinel
- satelite
- photo
- earthloc
pretty_name: 'EarthLoc 2021 Database '
size_categories:
- 100K<n<1M
---
# 🌍 Sentinel 2021 Image WebDataset
This dataset contains 150k 1024x1024 satellite images accross (9,10,11) zooms and bounded within (-60,60) latitude.
Stored using the [WebDataset](https://github.com/webdataset/webdataset) format.
The data is **sharded across 11 `.tar` archives**, and each sample contains:
- A JPEG image `.jpg`
- A unique key `__key__` corresponding to the original image path
- Companion **`.index`** file for fast random access stored next to the shard
This key encodes all relevant **metadata** about the image, including its bounding box, nadir, zoom, area parameters.
## Note this is not the whole data used to train the model. 3 more datasets are needed for years 2018,2019,2020 you can download them from https://github.com/gmberton/EarthLoc if you want to train from scratch.
---
## 🗂️ Dataset Structure
Each shard (e.g., `shard-000000.tar`) contains up to 15,000 samples. Every sample includes:
- `jpg`: The image bytes (decoded automatically)
- `__key__`: A string derived from the image's original path
The key format encodes metadata in the filename using the following structure:
@ lat1 @ lon1 @ lat2 @ lon2 @ lat3 @ lon3 @ lat4 @ lon4
@ image_id @ timestamp @ nadir_lat @ nadir_lon @ sq_km_area @ orientation @.jpg
> Commas (`,`) in the keys have been used to replace dots (`.`) due to WebDataset's format. You’ll need to reverse this replacement (`replace(',', '.')`) when decoding.
For more details on how the key structure encodes geospatial metadata, refer to the [EarthLoc repository](https://github.com/gmberton/EarthLoc).
---

## 🧪 Example: Displaying the First Image in a Shard
You can inspect a sample using the following code in a Jupyter notebook:
```python
import webdataset as wds
from PIL import Image
import matplotlib.pyplot as plt
# Path to a WebDataset .tar file
tar_path = "./shard-000000.tar"
# Create a WebDataset iterator
dataset = wds.WebDataset(tar_path).decode("pil")
# Load the first sample
sample = next(iter(dataset))
# Access image and key
image = sample["jpg"] # PIL Image
key = sample["__key__"].replace(',', '.')
# Display the image
plt.imshow(image)
plt.axis("off")
plt.title(f"Key: {key}")
plt.show()
# Print the key (for metadata parsing)
print(f"Key: {key}") |