longdpkr commited on
Commit
2de6027
·
verified ·
1 Parent(s): ffd95b5

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +253 -0
README.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: etalab-2.0
3
+ task_categories:
4
+ - image-classification
5
+ - other
6
+ tags:
7
+ - Aerial
8
+ - Lidar
9
+ - Point Cloud
10
+ - Forest
11
+ - Tree Species
12
+ - Earth Observation
13
+ - Multimodal
14
+ - IGN
15
+ size_categories:
16
+ - 100K<n<1M
17
+ ---
18
+
19
+ # PureForest Clone
20
+
21
+ This is a clone of the original [IGNF/PureForest](https://huggingface.co/datasets/IGNF/PureForest) dataset,
22
+ re-uploaded as zip archives for easier downloading and use.
23
+
24
+ > **Original paper:** [PureForest: A Large-Scale Aerial Lidar and Aerial Imagery Dataset for Tree Species Classification in Monospecific Forests](https://arxiv.org/abs/2404.12064)
25
+ > Charles Gaydon, Floryne Roche — IGN, 2024
26
+
27
+ ---
28
+
29
+ ## Dataset Overview
30
+
31
+ PureForest is the largest publicly available dataset for tree species classification from:
32
+ - **ALS (Aerial Lidar Scanning)** point clouds — high density: ~40 pts/m²
33
+ - **VHR (Very High Resolution)** aerial images — 0.2 m resolution, 250×250 pixels, NIRGB channels
34
+
35
+ | Property | Value |
36
+ |----------|-------|
37
+ | Total patches | 135,569 |
38
+ | Coverage | 339 km² |
39
+ | Forests | 449 distinct monospecific forests |
40
+ | Departments | 40 French departments |
41
+ | Semantic classes | 13 (grouping 18 tree species) |
42
+ | Patch size | 50 m × 50 m |
43
+
44
+ ---
45
+
46
+ ## Dataset Structure
47
+
48
+ ```
49
+ PureForest_clone/
50
+ ├── train.zip # 69,111 patches (~51.4 GB)
51
+ ├── val.zip # 13,523 patches (~10 GB)
52
+ ├── test.zip # 52,935 patches (~39.3 GB)
53
+ └── metadata/ # Metadata files
54
+ ```
55
+
56
+ Each `.npz` patch file contains:
57
+ - `intensities` — Lidar intensity values
58
+ - `classes` — semantic class label (integer 0–12)
59
+ - Point cloud coordinates (x, y, z) colorized with aerial imagery
60
+
61
+ ### File Naming Convention
62
+
63
+ ```
64
+ {SPLIT}-{ClassName}-C{ClassID}-{PatchID}.npz
65
+
66
+ Example: TRAIN-Quercus_ilex-C1-177_13_242.npz
67
+ TEST-Abies_alba-C9-001_02_015.npz
68
+ ```
69
+
70
+ ### Semantic Classes
71
+
72
+ | Class ID | Species | Common Name |
73
+ |----------|---------|-------------|
74
+ | 0 | Quercus (deciduous) | Deciduous oak |
75
+ | 1 | Quercus ilex | Evergreen oak |
76
+ | 2 | Fagus sylvatica | Beech |
77
+ | 3 | Castanea sativa | Chestnut |
78
+ | 4 | Robinia pseudoacacia | Black locust |
79
+ | 5 | Pinus pinaster | Maritime pine |
80
+ | 6 | Pinus sylvestris | Scotch pine |
81
+ | 7 | Pinus nigra | Black pine |
82
+ | 8 | Pinus halepensis | Aleppo pine |
83
+ | 9 | Abies alba | Fir |
84
+ | 10 | Picea abies | Spruce |
85
+ | 11 | Larix decidua | Larch |
86
+ | 12 | Pseudotsuga menziesii | Douglas |
87
+
88
+ ### Train/Val/Test Split Distribution
89
+
90
+ | Class | Train | Val | Test |
91
+ |-------|-------|-----|------|
92
+ | (0) Deciduous oak | 22.92% | 32.35% | 52.59% |
93
+ | (1) Evergreen oak | 16.80% | 2.75% | 19.61% |
94
+ | (2) Beech | 10.14% | 12.03% | 7.62% |
95
+ | (3) Chestnut | 4.83% | 1.09% | 0.38% |
96
+ | (4) Black locust | 2.41% | 2.40% | 0.60% |
97
+ | (5) Maritime pine | 6.61% | 7.10% | 3.85% |
98
+ | (6) Scotch pine | 16.39% | 17.95% | 8.51% |
99
+ | (7) Black pine | 6.30% | 6.98% | 3.64% |
100
+ | (8) Aleppo pine | 5.83% | 1.72% | 0.83% |
101
+ | (9) Fir | 0.14% | 5.32% | 0.05% |
102
+ | (10) Spruce | 3.73% | 4.64% | 1.64% |
103
+ | (11) Larch | 3.67% | 3.73% | 0.48% |
104
+ | (12) Douglas | 0.23% | 1.95% | 0.20% |
105
+
106
+ ---
107
+
108
+ ## Download & Setup
109
+
110
+ ### Step 1 — Download zip files
111
+
112
+ ```python
113
+ from huggingface_hub import hf_hub_download
114
+
115
+ for split in ["train", "val", "test"]:
116
+ hf_hub_download(
117
+ repo_id="longdpkr/PureForest_clone",
118
+ filename=f"{split}.zip",
119
+ repo_type="dataset",
120
+ local_dir="./PureForest"
121
+ )
122
+ ```
123
+
124
+ Or using the CLI:
125
+ ```bash
126
+ huggingface-cli download longdpkr/PureForest_clone train.zip --repo-type=dataset
127
+ huggingface-cli download longdpkr/PureForest_clone val.zip --repo-type=dataset
128
+ huggingface-cli download longdpkr/PureForest_clone test.zip --repo-type=dataset
129
+ ```
130
+
131
+ ### Step 2 — Extract zip files
132
+
133
+ ```python
134
+ import zipfile
135
+ from pathlib import Path
136
+
137
+ dataset_dir = Path("./PureForest")
138
+
139
+ for split in ["train", "val", "test"]:
140
+ zip_path = dataset_dir / f"{split}.zip"
141
+ print(f"Extracting {split}.zip ...")
142
+ with zipfile.ZipFile(zip_path, "r") as zf:
143
+ zf.extractall(dataset_dir)
144
+ print(f"Done: {split}/")
145
+ ```
146
+
147
+ Or manually using WinRAR / 7-Zip.
148
+
149
+ After extraction, the structure should be:
150
+ ```
151
+ PureForest/
152
+ ├── train/
153
+ │ ├── TRAIN-Quercus_ilex-C1-xxx.npz
154
+ │ └── ...
155
+ ├── val/
156
+ │ ├── VAL-Fagus_sylvatica-C2-xxx.npz
157
+ │ └── ...
158
+ └── test/
159
+ ├── TEST-Pinus_sylvestris-C6-xxx.npz
160
+ └── ...
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Loading Data
166
+
167
+ ### Load a single patch
168
+
169
+ ```python
170
+ import numpy as np
171
+
172
+ data = np.load("train/TRAIN-Quercus_ilex-C1-177_13_242.npz")
173
+
174
+ print(list(data.keys())) # show available keys
175
+ print(data["classes"]) # class label (0-12)
176
+ ```
177
+
178
+ ### PyTorch Dataset
179
+
180
+ ```python
181
+ import numpy as np
182
+ import torch
183
+ from torch.utils.data import Dataset
184
+ from pathlib import Path
185
+
186
+
187
+ class PureForestDataset(Dataset):
188
+ def __init__(self, split="train", data_dir="./PureForest"):
189
+ self.files = sorted(Path(data_dir) / split).glob("*.npz"))
190
+
191
+ def __len__(self):
192
+ return len(self.files)
193
+
194
+ def __getitem__(self, idx):
195
+ data = np.load(self.files[idx])
196
+ label = int(data["classes"])
197
+ # add your preprocessing here
198
+ return data, label
199
+
200
+
201
+ train_dataset = PureForestDataset(split="train")
202
+ val_dataset = PureForestDataset(split="val")
203
+ test_dataset = PureForestDataset(split="test")
204
+
205
+ print(f"Train: {len(train_dataset)} | Val: {len(val_dataset)} | Test: {len(test_dataset)}")
206
+ ```
207
+
208
+ ### With RandLA-Net
209
+
210
+ This dataset is compatible with [RandLA-Net](https://github.com/QingyongHu/RandLA-Net) for point cloud classification.
211
+ Place extracted folders under the `datasets/` directory of your RandLA-Net project:
212
+
213
+ ```
214
+ RandLA-Net/
215
+ └── datasets/
216
+ └── PureForest/
217
+ ├── train/
218
+ ├── val/
219
+ └── test/
220
+ ```
221
+
222
+ ---
223
+
224
+ ## License
225
+
226
+ This dataset is a clone of [IGNF/PureForest](https://huggingface.co/datasets/IGNF/PureForest)
227
+ and inherits its original license: **[Etalab Open License 2.0](https://www.etalab.gouv.fr/licence-ouverte-open-licence/)**.
228
+
229
+ ---
230
+
231
+ ## Citation
232
+
233
+ If you use this dataset in your research, please cite the original paper:
234
+
235
+ ```bibtex
236
+ @misc{gaydon2024pureforest,
237
+ title = {PureForest: A Large-Scale Aerial Lidar and Aerial Imagery Dataset
238
+ for Tree Species Classification in Monospecific Forests},
239
+ author = {Charles Gaydon and Floryne Roche},
240
+ year = {2024},
241
+ eprint = {2404.12064},
242
+ archivePrefix = {arXiv},
243
+ url = {https://arxiv.org/abs/2404.12064}
244
+ }
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Acknowledgements
250
+
251
+ Original dataset by [IGN — Institut national de l'information géographique et forestière](https://www.ign.fr/).
252
+ Lidar data from the [Lidar HD program](https://geoservices.ign.fr/lidarhd).
253
+ Aerial imagery from [ORTHO HR®](https://geoservices.ign.fr/bdortho).