File size: 7,842 Bytes
b8f1589
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
---
license: other
license_name: license-agreement-on-the-use-of-enmap-data
license_link: https://geoservice.dlr.de/resources/licenses/enmap/EnMAP-Data_License_v1_1.pdf
---

# How to use it
Install Dataset4EO

```git clone --branch streaming https://github.com/EarthNets/Dataset4EO.git```

```pip install -e .```

Then download the dataset from this Huggingface repo.

```python
import dataset4eo as eodata
import litdata as ld


train_dataset = eodata.StreamingDataset(input_dir="optimized_enmap_cdl_dataset", num_channels=202, channels_to_select=[0,1,2], shuffle=True, drop_last=True)
sample = dataset[101]
print(sample.keys())

dataloader = ld.StreamingDataLoader(train_dataset)
max_label = 0
for sample in tqdm.tqdm(dataloader):
    max_id = (np.unique(sample["segmentation_map"])).max()
    max_label = max_id if max_id > max_label else max_label

print(max_label)

```

The land cover classes of the [dataset](https://www.nass.usda.gov/Research_and_Science/Cropland/sarsfaqs2.php):

| Code | Land Cover                         |
|------|------------------------------------|
| 1    | Corn                               |
| 2    | Cotton                             |
| 3    | Rice                               |
| 4    | Sorghum                            |
| 5    | Soybeans                           |
| 6    | Sunflower                          |
| 10   | Peanuts                            |
| 11   | Tobacco                            |
| 12   | Sweet Corn                         |
| 13   | Pop or Orn Corn                    |
| 14   | Mint                               |
| 21   | Barley                             |
| 22   | Durum Wheat                        |
| 23   | Spring Wheat                       |
| 24   | Winter Wheat                       |
| 25   | Other Small Grains                 |
| 26   | Dbl Crop WinWht/Soybeans           |
| 27   | Rye                                |
| 28   | Oats                               |
| 29   | Millet                             |
| 30   | Speltz                             |
| 31   | Canola                             |
| 32   | Flaxseed                           |
| 33   | Safflower                          |
| 34   | Rape Seed                          |
| 35   | Mustard                            |
| 36   | Alfalfa                            |
| 37   | Other Hay/Non Alfalfa              |
| 38   | Camelina                           |
| 39   | Buckwheat                          |
| 41   | Sugarbeets                         |
| 42   | Dry Beans                          |
| 43   | Potatoes                           |
| 44   | Other Crops                        |
| 45   | Sugarcane                          |
| 46   | Sweet Potatoes                     |
| 47   | Misc Vegs & Fruits                 |
| 48   | Watermelons                        |
| 49   | Onions                             |
| 50   | Cucumbers                          |
| 51   | Chick Peas                         |
| 52   | Lentils                            |
| 53   | Peas                               |
| 54   | Tomatoes                           |
| 55   | Caneberries                        |
| 56   | Hops                               |
| 57   | Herbs                              |
| 58   | Clover/Wildflowers                 |
| 59   | Sod/Grass Seed                     |
| 60   | Switchgrass                        |
| 61   | Fallow/Idle Cropland               |
| 62   | Pasture/Grass                      |
| 63   | Forest                             |
| 64   | Shrubland                          |
| 65   | Barren                             |
| 66   | Cherries                           |
| 67   | Peaches                            |
| 68   | Apples                             |
| 69   | Grapes                             |
| 70   | Christmas Trees                    |
| 71   | Other Tree Crops                   |
| 72   | Citrus                             |
| 74   | Pecans                             |
| 75   | Almonds                            |
| 76   | Walnuts                            |
| 77   | Pears                              |
| 81   | Clouds/No Data                     |
| 82   | Developed                          |
| 83   | Water                              |
| 87   | Wetlands                           |
| 88   | Nonag/Undefined                    |
| 92   | Aquaculture                        |
| 111  | Open Water                         |
| 112  | Perennial Ice/Snow                 |
| 121  | Developed/Open Space               |
| 122  | Developed/Low Intensity            |
| 123  | Developed/Med Intensity            |
| 124  | Developed/High Intensity           |
| 131  | Barren                             |
| 141  | Deciduous Forest                   |
| 142  | Evergreen Forest                   |
| 143  | Mixed Forest                       |
| 152  | Shrubland                          |
| 176  | Grassland/Pasture                  |
| 190  | Woody Wetlands                     |
| 195  | Herbaceous Wetlands                |
| 204  | Pistachios                         |
| 205  | Triticale                          |
| 206  | Carrots                            |
| 207  | Asparagus                          |
| 208  | Garlic                             |
| 209  | Cantaloupes                        |
| 210  | Prunes                             |
| 211  | Olives                             |
| 212  | Oranges                            |
| 213  | Honeydew Melons                    |
| 214  | Broccoli                           |
| 215  | Avocados                           |
| 216  | Peppers                            |
| 217  | Pomegranates                       |
| 218  | Nectarines                         |
| 219  | Greens                             |
| 220  | Plums                              |
| 221  | Strawberries                       |
| 222  | Squash                             |
| 223  | Apricots                           |
| 224  | Vetch                              |
| 225  | Dbl Crop WinWht/Corn               |
| 226  | Dbl Crop Oats/Corn                 |
| 227  | Lettuce                            |
| 228  | Dbl Crop Triticale/Corn            |
| 229  | Pumpkins                           |
| 230  | Dbl Crop Lettuce/Durum Wht         |
| 231  | Dbl Crop Lettuce/Cantaloupe        |
| 232  | Dbl Crop Lettuce/Cotton            |
| 233  | Dbl Crop Lettuce/Barley            |
| 234  | Dbl Crop Durum Wht/Sorghum         |
| 235  | Dbl Crop Barley/Sorghum            |
| 236  | Dbl Crop WinWht/Sorghum            |
| 237  | Dbl Crop Barley/Corn               |
| 238  | Dbl Crop WinWht/Cotton             |
| 239  | Dbl Crop Soybeans/Cotton           |
| 240  | Dbl Crop Soybeans/Oats             |
| 241  | Dbl Crop Corn/Soybeans             |
| 242  | Blueberries                        |
| 243  | Cabbage                            |
| 244  | Cauliflower                        |
| 245  | Celery                             |
| 246  | Radishes                           |
| 247  | Turnips                            |
| 248  | Eggplants                          |
| 249  | Gourds                             |
| 250  | Cranberries                        |
| 254  | Dbl Crop Barley/Soybeans           |



We acknowledge and give full credit to the original authors of SpectralEarth for their effort in creating this dataset.
The dataset is re-hosted in compliance with its original license to facilitate further research. Please cite the following paper for the creation of the dataset:

```
@article{braham2024spectralearth,
  title={SpectralEarth: Training Hyperspectral Foundation Models at Scale},
  author={Braham, Nassim Ait Ali and Albrecht, Conrad M and Mairal, Julien and Chanussot, Jocelyn and Wang, Yi and Zhu, Xiao Xiang},
  journal={arXiv preprint arXiv:2408.08447},
  year={2024}
}
```