csaybar commited on
Commit
2bcd2e9
·
verified ·
1 Parent(s): cea5fe1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -27
README.md CHANGED
@@ -55,17 +55,18 @@ those who prefer traditional storage formats, GeoTIFF files are available in our
55
 
56
  *CloudSEN12+ spatial coverage. The terms p509 and p2000 denote the patch size 509 × 509 and 2000 × 2000, respectively. ‘high’, ‘scribble’, and ‘nolabel’ refer to the types of expert-labeled annotations*
57
 
58
- **ML-STAC Snippet**
59
  ```python
60
- import mlstac
61
- dataset = mlstac.load('isp-uv-es/CloudSEN12Plus')
 
62
  ```
63
 
64
  **Sensor: Sentinel2 - MSI**
65
 
66
- **ML-STAC Task: image-segmentation**
67
 
68
- **ML-STAC Dataset Version: 1.0.0**
69
 
70
  **Data raw repository: [https://cloudsen12.github.io/](https://cloudsen12.github.io/)**
71
 
@@ -161,31 +162,39 @@ website [https://cloudsen12.github.io/](https://cloudsen12.github.io/).
161
 
162
 
163
  ```python
164
- import mlstac
165
- import matplotlib.pyplot as plt
166
- import numpy as np
167
-
168
- ds = mlstac.load(snippet="isp-uv-es/CloudSEN12Plus")
169
- subset = ds.metadata[(ds.metadata["split"] == "test") & (ds.metadata["label_type"] == "high") & (ds.metadata["proj_shape"] == 509)][10:14]
170
- datacube = mlstac.get_data(dataset=subset)
171
- ```
172
-
173
- Make a plot of the data point downloaded
174
-
175
- ```python
176
- datapoint = datacube[2]
177
- datapoint_rgb = np.moveaxis(datapoint[[3, 2, 1]], 0, -1) / 5_000
178
- fig, ax = plt.subplots(1, 3, figsize=(10, 5))
179
- ax[0].imshow(datapoint_rgb)
180
- ax[0].set_title("RGB")
181
- ax[1].imshow(datapoint[13], cmap="gray")
182
- ax[1].set_title("Human label")
183
- ax[2].imshow(datapoint[14], cmap="gray")
184
- ax[2].set_title("UnetMobV2 v1.0")
 
 
 
 
 
 
 
 
185
  ```
186
 
187
 
188
- ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6402474cfa1acad600659e92/scVhZf3rkB3uWkZZ6Epmu.png)
189
 
190
  ## Citation
191
 
 
55
 
56
  *CloudSEN12+ spatial coverage. The terms p509 and p2000 denote the patch size 509 × 509 and 2000 × 2000, respectively. ‘high’, ‘scribble’, and ‘nolabel’ refer to the types of expert-labeled annotations*
57
 
58
+ **TACO Snippet**
59
  ```python
60
+ import tacoreader
61
+ import rasterio as rio
62
+ dataset = tacoreader.load("tacofoundation:cloudsen12-l1c")
63
  ```
64
 
65
  **Sensor: Sentinel2 - MSI**
66
 
67
+ **TACO Task: image-segmentation**
68
 
69
+ **TACO Dataset Version: 1.1.0**
70
 
71
  **Data raw repository: [https://cloudsen12.github.io/](https://cloudsen12.github.io/)**
72
 
 
162
 
163
 
164
  ```python
165
+ import tacoreader
166
+ import rasterio as rio
167
+
168
+ print(tacoreader.__version__) # 0.5.3
169
+
170
+ # Remotely load the Cloud-Optimized Dataset
171
+ dataset = tacoreader.load("tacofoundation:cloudsen12-l1c")
172
+ #dataset = tacoreader.load("tacofoundation:cloudsen12-l2a")
173
+ #dataset = tacoreader.load("tacofoundation:cloudsen12-extra")
174
+
175
+ # Read a sample
176
+ sample_idx = 2422
177
+ s2_l1c = dataset.read(sample_idx).read(0)
178
+ s2_label = dataset.read(sample_idx).read(1)
179
+
180
+ # Retrieve the data
181
+ with rio.open(s2_l1c) as src, rio.open(s2_label) as dst:
182
+ s2_l1c_data = src.read([4, 3, 2], window=rio.windows.Window(0, 0, 512, 512))
183
+ s2_label_data = dst.read(window=rio.windows.Window(0, 0, 512, 512))
184
+
185
+ # Display
186
+ fig, ax = plt.subplots(1, 2, figsize=(10, 5))
187
+ ax[0].imshow(s2_l1c_data.transpose(1, 2, 0) / 3000)
188
+ ax[0].set_title("Sentinel-2 L1C")
189
+ ax[1].imshow(s2_label_data[0])
190
+ ax[1].set_title("Human Label")
191
+ plt.tight_layout()
192
+ plt.savefig("taco_check.png")
193
+ plt.close(fig)
194
  ```
195
 
196
 
197
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/6402474cfa1acad600659e92/0nRv7sqMRMNY-TVkY2kh7.png)
198
 
199
  ## Citation
200