EarthView / README.md
dvd42's picture
Update README.md
9cfa9ad verified
---
dataset_info:
- config_name: default
features:
- name: 1m
sequence:
sequence:
sequence:
sequence: uint8
- name: chm
sequence:
sequence:
sequence:
sequence: uint8
- name: rgb
sequence:
sequence:
sequence:
sequence: uint8
- name: metadata
struct:
- name: bounds
sequence: float64
- name: epsg
dtype: string
- name: siteID
dtype: string
- name: timestamp
sequence: string
splits:
- name: train
num_bytes: 303349477315
num_examples: 35501
download_size: 240895951943
dataset_size: 303349477315
- config_name: satellogic
features:
- name: 1m
sequence:
sequence:
sequence:
sequence: uint8
- name: rgb
sequence:
sequence:
sequence:
sequence: uint8
- name: metadata
struct:
- name: bounds
sequence: float64
- name: crs
sequence: string
- name: timestamp
sequence: string
splits:
- name: train
num_bytes: 3675346598134
num_examples: 2967663
download_size: 3528764568282
dataset_size: 3675346598134
- config_name: sentinel_1
features:
- name: 10m
sequence:
sequence:
sequence:
sequence: uint8
- name: metadata
dtype: string
splits:
- name: train
num_bytes: 1762041095796
num_examples: 1049466
download_size: 1487586838960
dataset_size: 1762041095796
- config_name: sentinel_2
features:
- name: 10m
sequence:
sequence:
sequence:
sequence: uint8
- name: 20m
sequence:
sequence:
sequence:
sequence: uint8
- name: 40m
sequence:
sequence:
sequence:
sequence: uint8
- name: rgb
sequence:
sequence:
sequence:
sequence: uint8
- name: scl
sequence:
sequence:
sequence:
sequence: uint8
- name: metadata
struct:
- name: s3Path
sequence: string
- name: solarAngles
sequence: string
- name: tileGeometry
sequence: string
- name: timestamp
sequence: string
- name: viewIncidenceAngles
sequence: string
splits:
- name: train
num_bytes: 14967110614854
download_size: 12926621389874
dataset_size: 14967110614854
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- config_name: satellogic
data_files:
- split: train
path: satellogic/**/train-*
- config_name: sentinel_1
data_files:
- split: train
path: sentinel_1/train-*
- config_name: sentinel_2
data_files:
- split: train
path: sentinel_2/**/train-*
---
<style>
.prose :where(pre):not(:where([class~=not-prose] *)) {
backgroun-color: "#e0e0e0";
</style>
# EarthView dataset
<!-- Dataset thumbnail -->
![EarthView](<dataset samples op1.gif>)
## Overview
The **EarthView** Dataset is a comprehensive collection of multispectral earth imagery. The dataset is divided into four distinct subsets sourced from Satellogic, Sentinel-1, Sentinel-2 (coming soon), and NEON imagers, each providing unique data.
## Dataset Viewer
Check the [EarthView Dataset Viewer](https://huggingface.co/spaces/satellogic/EarthView-Viewer) and [it's code](https://huggingface.co/spaces/satellogic/EarthView-Viewer/tree/main) for examples on how to access the images and navigate the dataset.
[![ ](viewer.png 'EarthView Dataset Viewer')](https://satellogic-earthview-viewer.hf.space/)
- [EarthView dataset](#earthview-dataset)
- [Overview](#overview)
- [Dataset Viewer](#dataset-viewer)
- [Data Sources](#data-sources)
- [Available Subsets](#available-subsets)
- [Data Format](#data-format)
- [Satellogic](#satellogic)
- [Metadata](#metadata)
- [Images](#images)
- [Example (Jupyter Notebook)](#example-jupyter-notebook)
- [Example (iterate)](#example-iterate)
- [Sentinel-1](#sentinel-1)
- [Metadata](#metadata-1)
- [Images](#images-1)
- [Example (Jupyter Notebook)](#example-jupyter-notebook-1)
- [Neon](#neon)
- [Metadata](#metadata-2)
- [Images](#images-2)
- [Example (Jupyter Notebook)](#example-jupyter-notebook-2)
- [Sentinel 2 (Coming Soon)](#sentinel-2-coming-soon)
- [Known Issues](#known-issues)
## Data Sources
Each subset (AKA configuration) in the EarthView dataset includes samples representing specific patches of the Earth. Each source (satellite type) has different characteristics, so the details for the samples in each of the subsets are subtly different. We provide a very simple library to access the images in the subsets.
## Available Subsets
| Name | Samples | Unique locations | Products | Image Resolution |
|--|--|--|--|--|
| Satellogic | ~6 million | ~3 million | RGB | 1m |
| | | | NIR (Near Infrared) | 1m
| Neon | ~1 million | ~0.3 million | RGB | 0.1m |
| | | | Canopy Height Model (Lidar)| 1m
| | | | Hyperspectral (369 bands) | 1m
| Sentinel-1 | ~5.2 million | ~1 million | SAR (mapped to RGB) | 10m (from 20m)
| Sentinel-2 | ~10 million | ~1 million | RGB | 10m
| | | | NIR | 10m
| | | | NIR / Red Edge / SWIR | 20m
| | | | Scene Classification Layer | 20m
| | | | Coastal-Aerosol / Water Vapour / Cirrus | 40 (from 60m)
## Data Format
Each subset has some peculiarities and a specific data format in the dataset. Each item (sample) in the dataset is a dictionary with a `metadata` field and one or more entries for the different image products available, such as `rgb`, `chm`, `1m`, `10m` (see below). All of the image fields are 4D arrays where dimensions are REVISITS, BANDS, HEIGHT, WIDTH.
We encourage you to use the supplied [`earthview` library](https://huggingface.co/spaces/satellogic/EarthView-Viewer/blob/main/earthview.py) to simplify accessing the dataset, metadata and images. (For now, download the single python file and place in the same directory as your scripts, or in Python's path)
Bellow you'll find details for each subset
### Satellogic
#### Metadata
| key | description |
|--|--|
| `bounds` | [x_min, y_min, x_max, y_max] (bottom-left corner and top-right corner coordinates in (easting, northing) format, WGS 84 / UTM).
| | `[178191.0, 8248444.0, 178575.0, 8248828.0]`
| | `[[171507.0, 7874670.0, 171891.0, 7875054.0], [174795.0, 7878747.0, 175179.0, 7879131.0]]`
| `crs` | EPSG code
| | `['EPSG:32723']`
| `timestamp` | list of timestamps corresponding to the capture dates (only date is valid)
| | `['2022-07-21T00:00:00']`
| | `['2022-07-21T00:00:00', '2022-07-25T00:00:00']`
|`count` | Number of re-visits for the location (not present in the dataset, generated by `items_to_images()`)
| | 1
#### Images
Satellogic images are captured with Satellogic's MarkIV satellite fleet. The payload produces RGB and NIR images at 1m native resolution (no PAN sharpening). Each sample in the dataset has 1 or 2 re-visits per location.
| key | Product | Image Resolution | Size (pixels) | Bands | Re-samples |
|--|--|--|--|--|--|
| rgb | RGB | 1m | 384 x 384 | 3 | 1 or 2 |
| 1m | NIR | 1m | 384 x 384 | 1 | 1 or 2 |
#### Example (Jupyter Notebook)
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
import numpy as np
import earthview as ev
data = ev.load_dataset("satellogic", shards=[10]) # shard is optional
sample = next(iter(data))
print(sample.keys())
print(np.array(sample['rgb']).shape) # RGB Data
print(np.array(sample['1m']).shape) # NIR Data
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```
dict_keys(['1m', 'rgb', 'metadata'])
(1, 3, 384, 384)
(1, 1, 384, 384)
```
</td></tr></table>
<table border="1" style="border-collapse: inherit" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
sample = ev.item_to_images("satellogic", sample)
display(sample)
display(*sample["rgb"])
display(*sample["1m"])
```
</td></tr></table>
<table border="1" style="border-collapse: inherit" width="100%" bgcolor="#f0f0f0"><tr><td>
```
{'1m': [<PIL.Image.Image image mode=L size=384x384>],
'rgb': [<PIL.Image.Image image mode=RGB size=384x384>],
'metadata': {'bounds': [[178191.0, 8248444.0, 178575.0, 8248828.0]],
'crs': ['EPSG:32723'],
'timestamp': ['2022-08-13T00:00:00'],
'count': 1}}
```
</td></tr></table>
![Satellogic RGB](satellogic-rgb.png)
![Satellogic RGB](satellogic-nir.png)
#### Example (iterate)
</td></tr></table>
<table border="1" style="border-collapse: inherit" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
from itertools import islice
import earthview as ev
data = ev.load_dataset("satellogic", shards=[10]) # shard is optional
datai = iter(data)
for sample in islice(datai, 10):
sample = ev.item_to_images("satellogic", sample)
print(sample["metadata"]["bounds"])
sample["rgb"][0].show()
```
</td></tr></table>
### Sentinel-1
#### Metadata
| key | description |
|--|--|
| `type` | `'Polygon'` Indicates the `coordinates` are the vertices of a Polygon
| `coordinates` | Five coordinates of a closed Polygon.
| | `[[[434520.0, 8715520.0], [438360.0, 8715520.0], [438360.0, 8711680.0], [434520.0, 8711680.0], [434520.0, 8715520.0]]]`
| `crs` | EPSG code
| | `'epsg:32736'`
|`count` | Number of re-visits for the location (not present in the dataset, generated by `items_to_images()`)
| | 6
#### Images
Sentinel-1 carries a Synthetic Aperture Radar (SAR) payload. The data (imagery) produced has two channels, for vertical and horizontal polarization. The data in the dataset contains just the two channels, the images returned by `item_to_images()` implements a [standard mapping](https://gis.stackexchange.com/questions/400726/creating-composite-rgb-images-from-sentinel-1-channels) to return RGB images. (see the example below). Samples in the dataset contain varied numbers of re-visits per location.
| key | Product | Image Resolution | Size (pixels) | Bands | Re-samples |
|--|--|--|--|--|--|
| 10m | RGB | 10m | 384 x 384 | 3 | 1 or 2 |
#### Example (Jupyter Notebook)
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
import numpy as np
import earthview as ev
# data = ev.load_dataset("sentinel_1", shards=[88]) # shard is optional
data = ev.load_parquet("dataset/sentinel_1/train-00088-of-01763.parquet")
sample = next(iter(data))
print(sample.keys())
print(np.array(sample['rgb']).shape) # RGB Data
print(np.array(sample['10m']).shape) # NIR Data
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```
dict_keys(['10m', 'metadata'])
(6, 2, 384, 384)
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
sample = ev.item_to_images("sentinel_1", sample)
display(sample)
display(*sample["10m"][:2])
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```
{'10m': [<PIL.Image.Image image mode=RGB size=384x384>,
<PIL.Image.Image image mode=RGB size=384x384>,
<PIL.Image.Image image mode=RGB size=384x384>,
<PIL.Image.Image image mode=RGB size=384x384>,
<PIL.Image.Image image mode=RGB size=384x384>,
<PIL.Image.Image image mode=RGB size=384x384>],
'metadata': {'type': 'Polygon',
'crs': 'epsg:32736',
'coordinates': [[[434520.0, 8715520.0],
[438360.0, 8715520.0],
[438360.0, 8711680.0],
[434520.0, 8711680.0],
[434520.0, 8715520.0]]],
'count': 6}}
```
</td></tr></table>
![Sentinel-1 RGB](sentinel_1-0.png)
![Sentinel-1 RGB](sentinel_1-1.png)
### Neon
In the dataset, the subset/configuration for NEON is called `default`, but when using the earthview library you should call it `neon`.
#### Metadata
| key | description |
|--|--|
| `bounds` | [x_min, y_min, x_max, y_max] (bottom-left corner and top-right corner coordinates in (easting, northing).
| | `[-82.04138011662944, 29.634596313943526, -82.04071312100113, 29.635179014437973]`
| `epsg` | EPSG code
| | `'EPSG:32617'`
| `timestamp` | list of timestamps corresponding to the capture dates (only date is valid)
| | `['2018-01-01T00:00:00', '2019-01-01T00:00:00', '2021-01-01T00:00:00']`
| `siteID` | `'OSBS'` for Ordway-Swisher Biological Station
|`count` | Number of re-visits for the location (not present in the dataset, generated by `items_to_images()`)
| | 3
#### Images
The NEON subset is composed of very high resolution RGB images at 0.1m, 1m hyperspectral data (369 bands), and 1m Canopy Height Model out of a LIDAR sensor. Every sample in the dataset contains 3 re-visits.
| key | Product | Image Resolution | Size (pixels) | Bands | Re-samples |
|--|--|--|--|--|--|
| rgb | RGB | 0.1m | 640 x 640 | 3 | 3 |
| chm | Canopy Height Model | 1m | 64 x 64 | 1 | 3 |
| 1m | Hyperspectral | 1m | 64 x 64 | 369 | 3 |
When using `item_to_images()` the Hyperspectral images are mapped, from the 369 bands to RGB using a meaningless mapping. Please, don't use it for anything else than an example.
#### Example (Jupyter Notebook)
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
import numpy as np
import earthview as ev
data = ev.load_dataset("neon", shards=[100]) # shard is optional
# data = ev.load_parquet("neon", batch_size = 10)
sample = next(iter(data))
print(sample.keys())
print(np.array(sample['rgb']).shape) # RGB Data
print(np.array(sample['chm']).shape) # Canopy Height
print(np.array(sample['1m']).shape) # Hyperspectral
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```
dict_keys(['1m', 'chm', 'rgb', 'metadata'])
(3, 3, 640, 640)
(3, 1, 64, 64)
(3, 369, 64, 64)
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```python
sample = ev.item_to_images("neon", sample)
display(sample)
display(sample["rgb"][0])
display(sample["1m"][0])
display(sample["chm"][0])
```
</td></tr></table>
<table border="1" style="border-collapse: inherit;" width="100%" bgcolor="#f0f0f0"><tr><td>
```
{'1m': [<PIL.Image.Image image mode=RGB size=64x64>,
<PIL.Image.Image image mode=RGB size=64x64>,
<PIL.Image.Image image mode=RGB size=64x64>],
'chm': [<PIL.Image.Image image mode=L size=64x64>,
<PIL.Image.Image image mode=L size=64x64>,
<PIL.Image.Image image mode=L size=64x64>],
'rgb': [<PIL.Image.Image image mode=RGB size=640x640>,
<PIL.Image.Image image mode=RGB size=640x640>,
<PIL.Image.Image image mode=RGB size=640x640>],
'metadata': {'bounds': [-82.04138011662944,
29.634596313943526,
-82.04071312100113,
29.635179014437973],
'epsg': 'EPSG:32617',
'siteID': 'OSBS',
'timestamp': ['2018-01-01T00:00:00',
'2019-01-01T00:00:00',
'2021-01-01T00:00:00'],
'count': 3}}
```
</td></tr></table>
![NEON RGB](neon-2-rgb.png)
![NEON Canopy Height](neon-2-chm.png)
![NEON Hyperspectral meaningless mapping](neon-2-1m.png)
### Sentinel 2 (Coming Soon)
Check the [EarthView Dataset Viewer](https://huggingface.co/spaces/satellogic/EarthView-Viewer) and [it's code](https://huggingface.co/spaces/satellogic/EarthView-Viewer/tree/main) to get an idea on how to use it.
## Known Issues
* The time component of timestamps is not correct.
* Bounds for some images is not correct. We are evaluating what has happened.
We intend to update the dataset to fix issues when possible