aadityabuilds commited on
Commit
7122511
·
1 Parent(s): e037e7b

updated readme

Browse files
Files changed (1) hide show
  1. README.md +95 -15
README.md CHANGED
@@ -82,34 +82,114 @@ configs:
82
  path: "data/configs/intl_train_US__ood_IN/ood_test-*.parquet"
83
  ---
84
 
85
- # Tree Distribution Shift — Satellite Tree Detection (COCO export)
86
 
87
- This dataset is organized as **configs** (distribution shift settings).
88
- Each config provides 3 splits:
89
 
90
  - `train`
91
- - `id_test` (same region as train, held-out)
92
- - `ood_test` (different region)
93
 
94
- ## Super simple COCO UX
95
 
96
- Export any config into standard COCO folder structure:
 
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  ```bash
99
- python tools/export_coco.py --repo aadityabuilds/tree-distribution-shift --config biome_India_Karnataka_train_DRY__ood_WET --out ./coco_out
100
  ```
101
 
102
- This writes:
 
 
103
 
104
- - `./coco_out/biome_India_Karnataka_train_DRY__ood_WET/train/images/*.tiff`
105
- - `./coco_out/biome_India_Karnataka_train_DRY__ood_WET/train/annotations/instances_train.json`
106
- - `./coco_out/biome_India_Karnataka_train_DRY__ood_WET/id_test/...`
107
- - `./coco_out/biome_India_Karnataka_train_DRY__ood_WET/ood_test/...`
 
 
108
 
109
- ## Programmatic load (optional)
 
 
 
 
 
 
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  ```python
112
  from datasets import load_dataset
113
- ds = load_dataset("aadityabuilds/tree-distribution-shift", "biome_India_Karnataka_train_DRY__ood_WET")
 
 
 
 
 
 
 
 
 
114
  print(ds)
 
 
115
  ```
 
 
 
 
 
 
 
 
 
 
82
  path: "data/configs/intl_train_US__ood_IN/ood_test-*.parquet"
83
  ---
84
 
85
+ # Tree Distribution Shift — Satellite Tree Detection (COCO + HF Datasets)
86
 
87
+ This dataset is organized as **configs** (distribution shift benchmarks). Each config provides **three splits**:
 
88
 
89
  - `train`
90
+ - `id_test` (same distribution as train, held-out)
91
+ - `ood_test` (different distribution)
92
 
93
+ ## What is a config?
94
 
95
+ A **config** fully defines a benchmark setting (e.g., country shift, state shift, biome shift).
96
+ When you select a config, you automatically get:
97
 
98
+ - `train` split
99
+ - `id_test` split
100
+ - `ood_test` split
101
+
102
+ No filtering or custom split logic is required.
103
+
104
+ ---
105
+
106
+ # Export to COCO (recommended for training)
107
+
108
+ Use this when you want a **standard COCO folder structure** that works with most CV frameworks (Detectron2, MMDetection, torchvision detection, etc.).
109
+
110
+ ## Step 1 — Clone the dataset repository (to get the export tool)
111
+ ```bash
112
+ git clone https://huggingface.co/datasets/aadityabuilds/tree-distribution-shift
113
+ cd tree-distribution-shift
114
+ ```
115
+
116
+ ## Step 2 — Install dependencies
117
  ```bash
118
+ pip install datasets huggingface_hub orjson
119
  ```
120
 
121
+ ## Step 3 — Pick a config
122
+
123
+ Go to the dataset page and choose a config from the Configs section:
124
 
125
+ https://huggingface.co/datasets/aadityabuilds/tree-distribution-shift
126
+
127
+ Example config:
128
+ ```
129
+ biome_India_Karnataka_train_DRY__ood_WET
130
+ ```
131
 
132
+ ## Step 4 — Export to COCO (one command)
133
+ ```bash
134
+ python tools/export_coco.py \
135
+ --repo aadityabuilds/tree-distribution-shift \
136
+ --config biome_India_Karnataka_train_DRY__ood_WET \
137
+ --out ./coco_out
138
+ ```
139
 
140
+ ## Output structure
141
+ ```
142
+ coco_out/
143
+ └── biome_India_Karnataka_train_DRY__ood_WET/
144
+ ├── train/
145
+ │ ├── images/
146
+ │ │ └── *.tiff
147
+ │ └── annotations/
148
+ │ └── instances_train.json
149
+ ├── id_test/
150
+ │ ├── images/
151
+ │ └── annotations/
152
+ │ └── instances_id_test.json
153
+ └── ood_test/
154
+ ├── images/
155
+ └── annotations/
156
+ └── instances_ood_test.json
157
+ ```
158
+
159
+ ---
160
+
161
+ # Load with Hugging Face Datasets (recommended for analysis / prototyping)
162
+
163
+ Use this when you want programmatic access (e.g., notebooks, statistics, custom pipelines) without writing files to disk.
164
+
165
+ ## Install
166
+ ```bash
167
+ pip install datasets
168
+ ```
169
+
170
+ ## Load a config (gets train / id_test / ood_test)
171
  ```python
172
  from datasets import load_dataset
173
+
174
+ ds = load_dataset(
175
+ "aadityabuilds/tree-distribution-shift",
176
+ "biome_India_Karnataka_train_DRY__ood_WET"
177
+ )
178
+
179
+ train = ds["train"]
180
+ id_test = ds["id_test"]
181
+ ood_test= ds["ood_test"]
182
+
183
  print(ds)
184
+ print(len(train), len(id_test), len(ood_test))
185
+ print(train[0].keys())
186
  ```
187
+
188
+ ## What each example contains
189
+
190
+ Each row includes:
191
+
192
+ - `image_bytes` (raw image bytes)
193
+ - `coco_annotations` (COCO annotations for that image)
194
+ - `coco_categories` (COCO categories)
195
+ - metadata fields (country, state, zone, biome, etc.)