Vihaanakshaay commited on
Commit
a300863
·
verified ·
1 Parent(s): 9c5c785

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +121 -3
README.md CHANGED
@@ -1,3 +1,121 @@
1
- ---
2
- license: cc0-1.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc0-1.0
3
+ task_categories:
4
+ - object-detection
5
+ - image-segmentation
6
+ tags:
7
+ - landslide-detection
8
+ - satellite-imagery
9
+ - landsat
10
+ - earthquake
11
+ - remote-sensing
12
+ - pascal-voc
13
+ - yolo
14
+ size_categories:
15
+ - 1K<n<10K
16
+ ---
17
+
18
+ # LandsatQuake
19
+
20
+ Landslide detection in Landsat satellite imagery across 16 earthquake and rainstorm events (1987–2020).
21
+
22
+ ## ⚠️ Important: Do NOT use `load_dataset()`
23
+
24
+ HuggingFace's auto-parquet conversion does **not** work correctly for this dataset. It drops all bounding-box annotations and replaces filenames with hashes. Instead, **clone the repository directly**:
25
+
26
+ ```bash
27
+ # Install git-lfs first: https://git-lfs.com
28
+ git lfs install
29
+ git clone https://huggingface.co/datasets/Vihaanakshaay/LandsatQuake
30
+ cd LandsatQuake
31
+ git lfs pull
32
+ ```
33
+
34
+ ## Dataset Structure
35
+
36
+ ```
37
+ LandsatQuake/
38
+ ├── LandsatQuake/ # Object detection (Pascal VOC)
39
+ │ ├── train/ # 834 images + 834 XMLs
40
+ │ ├── test/ # 105 images + 105 XMLs
41
+ │ └── val/ # 103 images + 103 XMLs
42
+ ├── LandsatQuake_InstanceSegmentation/ # Instance segmentation (YOLO)
43
+ │ ├── image_patches/ # Image files
44
+ │ └── labels/ # YOLO polygon TXT files
45
+ └── LandsatQuake_Polygons.zip # Raw polygon annotations
46
+ ```
47
+
48
+ ## Format Details
49
+
50
+ ### Images
51
+ - **Size:** 224 × 224 pixels, RGB, JPEG
52
+ - **Source:** Landsat satellite imagery
53
+ - **Naming convention:** `{year} {location} {pre/post}-earthquake_patch_{x}_{y}.jpg`
54
+
55
+ ### Object Detection Labels (Pascal VOC XML)
56
+ Each image has a paired `.xml` file in Pascal VOC format with bounding boxes:
57
+ ```xml
58
+ <annotation>
59
+ <size><width>224</width><height>224</height><depth>3</depth></size>
60
+ <object>
61
+ <name>landslides</name>
62
+ <bndbox><xmin>141</xmin><ymin>201</ymin><xmax>150</xmax><ymax>210</ymax></bndbox>
63
+ </object>
64
+ <!-- ... more objects ... -->
65
+ </annotation>
66
+ ```
67
+
68
+ ### Instance Segmentation Labels (YOLO TXT)
69
+ Each `.txt` file contains normalised polygon coordinates:
70
+ ```
71
+ 0 x1 y1 x2 y2 x3 y3 ...
72
+ ```
73
+ Where `0` = landslides class and coordinates are normalised to [0, 1].
74
+
75
+ ## Statistics
76
+
77
+ | Split | Images | Landslide Boxes | Mean Boxes/Image |
78
+ |-------|--------|-----------------|------------------|
79
+ | Train | 834 | 5,626 | 6.7 |
80
+ | Test | 105 | 508 | 4.8 |
81
+ | Val | 103 | 830 | 8.1 |
82
+ | **Total** | **1,042** | **6,964** | **6.7** |
83
+
84
+ ### Events Covered (16 total)
85
+ | Event | Images |
86
+ |-------|--------|
87
+ | 1987 Sichuan pre-earthquake | 508 |
88
+ | 2015 Gorkha earthquake | 205 |
89
+ | 1999 Chamoli earthquake | 84 |
90
+ | 2011 Sikkim earthquake | 64 |
91
+ | 2016 Arun rainstorm | 34 |
92
+ | 1991 Limon earthquake | 30 |
93
+ | 2010 Haiti | 28 |
94
+ | Others (9 events) | 89 |
95
+
96
+ ## Quick Start (Python)
97
+
98
+ ```python
99
+ import os
100
+ import xml.etree.ElementTree as ET
101
+ from PIL import Image
102
+
103
+ def parse_voc_xml(xml_path):
104
+ """Parse Pascal VOC XML and return list of (class, xmin, ymin, xmax, ymax)."""
105
+ tree = ET.parse(xml_path)
106
+ boxes = []
107
+ for obj in tree.getroot().findall("object"):
108
+ cls = obj.find("name").text
109
+ bb = obj.find("bndbox")
110
+ boxes.append((
111
+ cls,
112
+ int(bb.find("xmin").text), int(bb.find("ymin").text),
113
+ int(bb.find("xmax").text), int(bb.find("ymax").text),
114
+ ))
115
+ return boxes
116
+
117
+ # Example: load a training image with its annotations
118
+ img = Image.open("LandsatQuake/train/1987 Sichuan pre-earthquake_patch_2464_11872.jpg")
119
+ boxes = parse_voc_xml("LandsatQuake/train/1987 Sichuan pre-earthquake_patch_2464_11872.xml")
120
+ print(f"Image size: {img.size}, Landslide boxes: {len(boxes)}")
121
+ ```