Datasets:
Tasks:
Object Detection
Modalities:
Image
Formats:
imagefolder
Languages:
English
Size:
1K - 10K
ArXiv:
License:
Add full dataset card
Browse files
README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
annotations_creators:
|
|
|
|
| 3 |
language: en
|
| 4 |
license: cc-by-nc-3.0
|
| 5 |
size_categories:
|
|
@@ -7,28 +8,26 @@ size_categories:
|
|
| 7 |
task_categories:
|
| 8 |
- object-detection
|
| 9 |
task_ids: []
|
| 10 |
-
pretty_name:
|
| 11 |
tags:
|
| 12 |
- active-learning
|
| 13 |
- data-curation
|
| 14 |
- fiftyone
|
| 15 |
- image
|
| 16 |
-
- image
|
| 17 |
-
- object-detection
|
| 18 |
- object-detection
|
| 19 |
- power-line-inspection
|
| 20 |
- uav
|
| 21 |
- unlabeled
|
| 22 |
description: 'A 1,754-image, media-only sample of InsPLAD-det (UAV power line inspection
|
| 23 |
imagery), built for a hands-on FiftyOne workshop on a complete annotation workflow.
|
| 24 |
-
No label fields are attached by design; this is a genuine cold-start pool for
|
| 25 |
-
compression, embedding, seeded similarity search, and annotation
|
| 26 |
-
before ever touching a model. A deterministic, balanced stratified
|
| 27 |
-
drawn from the full 10,561-image InsPLAD-det: roughly 217 images
|
| 28 |
-
id plate`, `polymer insulator`, `glass insulator`, and `yoke`
|
| 29 |
-
at the same quota so no class dominates the annotation
|
| 30 |
-
14 intact drone-flight sequences (a real near-duplicate
|
| 31 |
-
images for texture.'
|
| 32 |
dataset_summary: '
|
| 33 |
|
| 34 |
|
|
@@ -76,13 +75,7 @@ dataset_summary: '
|
|
| 76 |
'
|
| 77 |
---
|
| 78 |
|
| 79 |
-
# Dataset Card for
|
| 80 |
-
|
| 81 |
-
<!-- Provide a quick summary of the dataset. -->
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
|
| 87 |
This is a [FiftyOne](https://github.com/voxel51/fiftyone) dataset with 1754 samples.
|
| 88 |
|
|
@@ -108,135 +101,370 @@ dataset = load_from_hub("harpreetsahota/InsPLAD-workshop-pool")
|
|
| 108 |
session = fo.launch_app(dataset)
|
| 109 |
```
|
| 110 |
|
| 111 |
-
|
| 112 |
## Dataset Details
|
| 113 |
|
| 114 |
### Dataset Description
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
## Uses
|
| 135 |
|
| 136 |
-
<!-- Address questions around how the dataset is intended to be used. -->
|
| 137 |
-
|
| 138 |
### Direct Use
|
| 139 |
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
### Out-of-Scope Use
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
## Dataset Structure
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
### Curation Rationale
|
| 159 |
-
|
| 160 |
-
<!-- Motivation for the creation of this dataset. -->
|
| 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 |
-
|
|
|
|
|
|
|
| 187 |
|
| 188 |
-
|
| 189 |
|
| 190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
-
|
| 193 |
|
| 194 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
-
|
| 199 |
|
| 200 |
-
|
| 201 |
|
| 202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
-
|
| 205 |
|
| 206 |
-
|
|
|
|
|
|
|
| 207 |
|
| 208 |
-
###
|
| 209 |
|
| 210 |
-
|
|
|
|
|
|
|
|
|
|
| 211 |
|
| 212 |
-
|
| 213 |
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
-
|
| 217 |
|
| 218 |
**BibTeX:**
|
| 219 |
|
| 220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
|
| 222 |
**APA:**
|
| 223 |
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
## Glossary [optional]
|
| 227 |
-
|
| 228 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the dataset or dataset card. -->
|
| 229 |
-
|
| 230 |
-
[More Information Needed]
|
| 231 |
|
| 232 |
-
## More Information
|
| 233 |
|
| 234 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
-
## Dataset Card Authors
|
| 237 |
|
| 238 |
-
|
| 239 |
|
| 240 |
## Dataset Card Contact
|
| 241 |
|
| 242 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
annotations_creators:
|
| 3 |
+
- no-annotation
|
| 4 |
language: en
|
| 5 |
license: cc-by-nc-3.0
|
| 6 |
size_categories:
|
|
|
|
| 8 |
task_categories:
|
| 9 |
- object-detection
|
| 10 |
task_ids: []
|
| 11 |
+
pretty_name: InsPLAD Workshop Pool
|
| 12 |
tags:
|
| 13 |
- active-learning
|
| 14 |
- data-curation
|
| 15 |
- fiftyone
|
| 16 |
- image
|
|
|
|
|
|
|
| 17 |
- object-detection
|
| 18 |
- power-line-inspection
|
| 19 |
- uav
|
| 20 |
- unlabeled
|
| 21 |
description: 'A 1,754-image, media-only sample of InsPLAD-det (UAV power line inspection
|
| 22 |
imagery), built for a hands-on FiftyOne workshop on a complete annotation workflow.
|
| 23 |
+
No label fields are attached by design; this is a genuine cold-start pool for
|
| 24 |
+
practicing compression, embedding, seeded similarity search, and annotation
|
| 25 |
+
prioritization before ever touching a model. A deterministic, balanced stratified
|
| 26 |
+
sample (seed=51) drawn from the full 10,561-image InsPLAD-det: roughly 217 images
|
| 27 |
+
each of `tower id plate`, `polymer insulator`, `glass insulator`, and `yoke`
|
| 28 |
+
(deliberately capped at the same quota so no class dominates the annotation
|
| 29 |
+
budget), 574 images from 14 intact drone-flight sequences (a real near-duplicate
|
| 30 |
+
wall), and 215 long-tail images for texture.'
|
| 31 |
dataset_summary: '
|
| 32 |
|
| 33 |
|
|
|
|
| 75 |
'
|
| 76 |
---
|
| 77 |
|
| 78 |
+
# Dataset Card for InsPLAD Workshop Pool
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
This is a [FiftyOne](https://github.com/voxel51/fiftyone) dataset with 1754 samples.
|
| 81 |
|
|
|
|
| 101 |
session = fo.launch_app(dataset)
|
| 102 |
```
|
| 103 |
|
|
|
|
| 104 |
## Dataset Details
|
| 105 |
|
| 106 |
### Dataset Description
|
| 107 |
|
| 108 |
+
InsPLAD Workshop Pool is a 1,754-image, **media-only** sample of
|
| 109 |
+
[InsPLAD-det](https://huggingface.co/datasets/harpreetsahota/InsPLAD), built to
|
| 110 |
+
teach a complete annotation workflow in FiftyOne: compress a raw image pool,
|
| 111 |
+
embed it, search for examples of each target class from a handful of seed
|
| 112 |
+
examples, prioritize the rest for annotation, fine-tune a detector, and correct
|
| 113 |
+
its mistakes. This dataset ships with **zero label fields by design**. The point
|
| 114 |
+
of the exercise is deciding which images deserve human attention before any
|
| 115 |
+
labels exist. The images sampled into this pool were deliberately stratified
|
| 116 |
+
(not randomly subsampled) so that every step of that workflow has something real
|
| 117 |
+
to work with: genuine near-duplicate sequences, and four target classes
|
| 118 |
+
deliberately balanced to roughly the same size instead of reproducing the class
|
| 119 |
+
imbalance already present in the raw source data. See
|
| 120 |
+
[Curation Rationale](#curation-rationale) below for exactly how, and the
|
| 121 |
+
[workshop's companion GitHub repository](https://github.com/harpreetsahota204/annotation_workshop/tree/main)
|
| 122 |
+
for the full, runnable pipeline and workshop materials.
|
| 123 |
+
|
| 124 |
+
- **Curated by:** Harpreet Sahota (Voxel51), sampled from InsPLAD (see Dataset
|
| 125 |
+
Sources for the original dataset's curators)
|
| 126 |
+
- **Funded by:** N/A (derivative sample; see original InsPLAD for its funding)
|
| 127 |
+
- **Shared by:** Harpreet Sahota, via Hugging Face Hub
|
| 128 |
+
- **Language(s):** en (asset class names in the source data; not an NLP dataset)
|
| 129 |
+
- **License:** cc-by-nc-3.0 (inherited from InsPLAD; non-commercial use only)
|
| 130 |
+
|
| 131 |
+
### Dataset Sources
|
| 132 |
+
|
| 133 |
+
- **Repository:** https://github.com/andreluizbvs/InsPLAD
|
| 134 |
+
- **Paper:** InsPLAD: A Dataset and Benchmark for Power Line Asset Inspection in
|
| 135 |
+
UAV Images, International Journal of Remote Sensing (2023),
|
| 136 |
+
https://arxiv.org/abs/2311.01619
|
| 137 |
+
- **Original data download:** https://data.mendeley.com/datasets/5n3fjgvfyz/1
|
| 138 |
+
- **Full FiftyOne build (all 3 InsPLAD sub-datasets, with labels):**
|
| 139 |
+
https://huggingface.co/datasets/harpreetsahota/InsPLAD
|
| 140 |
|
| 141 |
## Uses
|
| 142 |
|
|
|
|
|
|
|
| 143 |
### Direct Use
|
| 144 |
|
| 145 |
+
Practicing (or teaching) a complete annotation loop end to end: near-duplicate
|
| 146 |
+
compression, embedding-based visual exploration, seeded similarity search for a
|
| 147 |
+
target class, uniqueness/representativeness-based annotation prioritization,
|
| 148 |
+
detector fine-tuning on the curated subset, and model-assisted correction. Also
|
| 149 |
+
useful as a small, realistic stand-in for InsPLAD-det when testing FiftyOne
|
| 150 |
+
workflows without downloading the full 10,561-image, 4.2 GB source dataset.
|
| 151 |
|
| 152 |
### Out-of-Scope Use
|
| 153 |
|
| 154 |
+
Not intended as a benchmark dataset for reporting detection accuracy. It is a
|
| 155 |
+
deliberately non-random, stratified sample built for a specific teaching workflow,
|
| 156 |
+
not an i.i.d. sample of InsPLAD-det. Any commercial use is out of scope; the
|
| 157 |
+
source license (CC BY-NC 3.0) is non-commercial only. Not suitable for identifying
|
| 158 |
+
individuals; it contains no personal or sensitive data by design (aerial images of
|
| 159 |
+
power line hardware only).
|
| 160 |
|
| 161 |
## Dataset Structure
|
| 162 |
|
| 163 |
+
This is a flat image dataset (`media_type = "image"`), not grouped or video, with
|
| 164 |
+
**1,754 samples** and no splits or saved views. Every sample carries only
|
| 165 |
+
FiftyOne's default fields; there is no `ground_truth`, no per-sample split tag,
|
| 166 |
+
and no per-sample sampling-tier label. This is intentional: the dataset is meant
|
| 167 |
+
to be loaded and explored exactly as if no prior work had been done on it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
+
### Fields
|
| 170 |
|
| 171 |
+
| Field | FiftyOne type | Description |
|
| 172 |
+
|-------|---------------|-------------|
|
| 173 |
+
| `filepath` | `StringField` | Path to the image file |
|
| 174 |
+
| `tags` | list of `str` | Empty for every sample; no split or tier tags are shipped |
|
| 175 |
+
| `metadata` | `ImageMetadata` | Not populated (`None`) until `dataset.compute_metadata()` is run |
|
| 176 |
|
| 177 |
+
### `dataset.info`
|
| 178 |
|
| 179 |
+
```python
|
| 180 |
+
{
|
| 181 |
+
"source": "https://github.com/andreluizbvs/InsPLAD",
|
| 182 |
+
"note": (
|
| 183 |
+
"Media-only workshop pool sampled from InsPLAD-det. No labels "
|
| 184 |
+
"attached by design; see 02_build_workshop_pool.py for the "
|
| 185 |
+
"sampling manifest and heldout_ground_truth.json for the real "
|
| 186 |
+
"boxes, held out until the 'close the loop' act."
|
| 187 |
+
),
|
| 188 |
+
}
|
| 189 |
+
```
|
| 190 |
|
| 191 |
+
### Parsing decisions
|
| 192 |
+
|
| 193 |
+
- **Media-only import, on purpose.** The staging step that builds this pool does
|
| 194 |
+
compute real bounding boxes for every sampled image (converted from InsPLAD's
|
| 195 |
+
COCO format to FiftyOne's relative `[x, y, w, h]`), but those boxes are written
|
| 196 |
+
to a separate `heldout_ground_truth.json` file and never attached to the
|
| 197 |
+
FiftyOne dataset. This dataset is the "before" half of a before/after teaching
|
| 198 |
+
exercise.
|
| 199 |
+
- **No tier or split metadata shipped.** Which sampling tier (eval holdout,
|
| 200 |
+
balanced target, duplicate-wall, long-tail) or original InsPLAD split
|
| 201 |
+
(`train`/`val`) each image came from is recorded in
|
| 202 |
+
`workshop_pool_manifest.json` at build time, not carried into this Hub
|
| 203 |
+
dataset's fields, including the `eval_holdout` tag itself. That keeps the
|
| 204 |
+
pool looking like a genuine unlabeled pool, not a labeled one with fields
|
| 205 |
+
hidden. If you build the pool locally via the companion
|
| 206 |
+
`01_download_insplad_det.py` through `04_import_workshop_dataset.py`
|
| 207 |
+
scripts instead of loading from the Hub, step 4 re-applies the
|
| 208 |
+
`eval_holdout` tag to the same 100 stratified samples on import.
|
| 209 |
+
- **Whole scenes only, no crops.** Unlike the full InsPLAD-fault sub-datasets
|
| 210 |
+
(cropped, near-square asset images), every image in this pool is a full UAV
|
| 211 |
+
scene from InsPLAD-det. A bounding-box task only makes sense on full scenes,
|
| 212 |
+
and every act of the target workflow (including fine-tuning and correcting a
|
| 213 |
+
detector) depends on that.
|
| 214 |
|
| 215 |
+
## Dataset Creation
|
| 216 |
|
| 217 |
+
### Curation Rationale
|
| 218 |
|
| 219 |
+
A naive random subsample of InsPLAD-det's 10,561 images breaks the workflow this
|
| 220 |
+
dataset is meant to teach: dedupe before subsampling and there's no duplicate wall
|
| 221 |
+
left for the "compress" step to find; subsample without correcting for class
|
| 222 |
+
frequency and the resulting pool just reproduces whatever imbalance already
|
| 223 |
+
exists in the raw data (`tower id plate` has only 242 images total; some other
|
| 224 |
+
classes have thousands). Instead, this pool uses a **deterministic, balanced
|
| 225 |
+
stratified sample** (seed=`51`, same result every run) that guarantees every step
|
| 226 |
+
of the workflow has something real to work with, at a fraction of the source
|
| 227 |
+
data's size, with all 4 target classes capped at the same rough quota.
|
| 228 |
|
| 229 |
+
Two scripts build this pool from the original InsPLAD-det source; both are
|
| 230 |
+
included verbatim below for full reproducibility.
|
| 231 |
|
| 232 |
+
#### Step 1: Download InsPLAD-det from source
|
| 233 |
|
| 234 |
+
InsPLAD ships as a single Mendeley Data record containing three inner zips
|
| 235 |
+
(`InsPLAD-det.zip`, `supervised_fault_classification.zip`,
|
| 236 |
+
`unsupervised_anomaly_detection.zip`). This workshop only uses whole UAV scene
|
| 237 |
+
images, so only `InsPLAD-det.zip` is extracted; the other two stay zipped and
|
| 238 |
+
untouched.
|
| 239 |
|
| 240 |
+
```python
|
| 241 |
+
"""Step 1: Download InsPLAD from source and extract only the detection
|
| 242 |
+
(InsPLAD-det) sub-dataset: full UAV scene images, no cropped fault/anomaly
|
| 243 |
+
images. This workshop uses whole images only.
|
| 244 |
+
|
| 245 |
+
Source: Mendeley Data, https://data.mendeley.com/datasets/5n3fjgvfyz/1
|
| 246 |
+
The Mendeley record ships one outer zip containing three inner zips
|
| 247 |
+
(InsPLAD-det.zip, supervised_fault_classification.zip,
|
| 248 |
+
unsupervised_anomaly_detection.zip). We download the outer zip (it's a
|
| 249 |
+
single file on Mendeley, can't be split at the API level), but only extract
|
| 250 |
+
InsPLAD-det.zip from it; the other two are left zipped and untouched.
|
| 251 |
+
"""
|
| 252 |
+
import zipfile
|
| 253 |
+
from pathlib import Path
|
| 254 |
+
|
| 255 |
+
import requests
|
| 256 |
+
|
| 257 |
+
MENDELEY_DATASET_ID = "5n3fjgvfyz"
|
| 258 |
+
WORK_DIR = Path(__file__).parent / "data"
|
| 259 |
+
OUTER_ZIP = WORK_DIR / "InsPLAD_Dataset.zip"
|
| 260 |
+
DET_DIR = WORK_DIR / "InsPLAD-det"
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
def get_download_url():
|
| 264 |
+
"""Query the Mendeley public API for the current file download URL
|
| 265 |
+
(avoids hardcoding a URL that may rotate)."""
|
| 266 |
+
resp = requests.get(
|
| 267 |
+
f"https://data.mendeley.com/public-api/datasets/{MENDELEY_DATASET_ID}"
|
| 268 |
+
"/files?folder_id=root&version=1"
|
| 269 |
+
)
|
| 270 |
+
resp.raise_for_status()
|
| 271 |
+
files = resp.json()
|
| 272 |
+
assert len(files) == 1, f"expected 1 file, got {len(files)}"
|
| 273 |
+
return files[0]["content_details"]["download_url"], files[0]["size"]
|
| 274 |
+
|
| 275 |
+
|
| 276 |
+
def extract_det_only(outer_zip, det_dir):
|
| 277 |
+
with zipfile.ZipFile(outer_zip) as outer:
|
| 278 |
+
names = outer.namelist()
|
| 279 |
+
det_zip_name = next(n for n in names if n.endswith("InsPLAD-det.zip"))
|
| 280 |
+
outer.extract(det_zip_name, WORK_DIR)
|
| 281 |
+
|
| 282 |
+
inner_zip_path = WORK_DIR / det_zip_name
|
| 283 |
+
with zipfile.ZipFile(inner_zip_path) as inner:
|
| 284 |
+
inner.extractall(det_dir)
|
| 285 |
+
inner_zip_path.unlink() # don't need the intermediate inner zip anymore
|
| 286 |
+
```
|
| 287 |
|
| 288 |
+
Result: `data/InsPLAD-det/{train,val}/*.jpg` plus COCO annotation JSONs: 10,561
|
| 289 |
+
unique images (46 duplicate COCO `image_id` entries for the same file are a known
|
| 290 |
+
quirk of the source data, resolved during staging).
|
| 291 |
|
| 292 |
+
#### Step 2: Build the balanced stratified sample
|
| 293 |
|
| 294 |
+
```python
|
| 295 |
+
"""Step 2: Build the reproducible, balanced stratified workshop pool
|
| 296 |
+
manifest from InsPLAD-det's raw images. Whole scene images only, no
|
| 297 |
+
labels attached to the resulting pool: ground truth for the sampled
|
| 298 |
+
images is saved separately in step 3, held out for the "close the loop"
|
| 299 |
+
act.
|
| 300 |
+
|
| 301 |
+
Tiers:
|
| 302 |
+
0. Eval holdout: a stratified ~25-per-class slice across all 4 target
|
| 303 |
+
classes, carved out FIRST, before any other tier is built. These
|
| 304 |
+
images are never available to prioritization or annotation in any
|
| 305 |
+
downstream act -- they exist purely so there's a clean, never-touched
|
| 306 |
+
benchmark to evaluate the fine-tuned detector against later. Tagged
|
| 307 |
+
`eval_holdout` at import time (step 4).
|
| 308 |
+
1. Balanced annotation targets: capped per-flight, per-class samples of
|
| 309 |
+
all 4 target classes (`tower id plate`, `polymer insulator`,
|
| 310 |
+
`glass insulator`, `yoke`), excluding whatever tier 0 already claimed
|
| 311 |
+
for eval, each capped at the same quota so the pool is balanced
|
| 312 |
+
across classes instead of skewed toward whichever ones are naturally
|
| 313 |
+
most common. The quota is set by `tower id plate`'s natural ceiling
|
| 314 |
+
(only 242 images exist in all of InsPLAD-det, 25 of which tier 0
|
| 315 |
+
already claimed), so every class gets an equal shot at the
|
| 316 |
+
annotation budget.
|
| 317 |
+
2. Duplicate-wall flights: N whole flights kept 100% intact, giving the
|
| 318 |
+
"compress" act a real wall of near-identical drone frames to find
|
| 319 |
+
(not simulated: these are actual contiguous DJI frame sequences).
|
| 320 |
+
3. Long-tail texture: one image per remaining flight, so the embedding
|
| 321 |
+
plot's messy middle still looks like a messy middle.
|
| 322 |
+
|
| 323 |
+
Deterministic given SEED: same manifest every run, same code whether
|
| 324 |
+
this runs live at the workshop or at home.
|
| 325 |
+
"""
|
| 326 |
+
import random
|
| 327 |
+
import re
|
| 328 |
+
from collections import defaultdict
|
| 329 |
+
|
| 330 |
+
SEED = 51
|
| 331 |
+
N_DUP_WALL_FLIGHTS = 14
|
| 332 |
+
TARGET_CLASSES = ["tower id plate", "polymer insulator", "glass insulator", "yoke"]
|
| 333 |
+
EVAL_HOLDOUT_PER_CLASS = 25
|
| 334 |
+
TARGET_CLASS_QUOTA = 217
|
| 335 |
+
TARGET_CLASS_PER_FLIGHT_CAP = 4
|
| 336 |
+
|
| 337 |
+
FLIGHT_PATTERN = re.compile(r"^(.+?)_DJI_(\d+)\.jpg$", re.IGNORECASE)
|
| 338 |
+
rng = random.Random(SEED)
|
| 339 |
+
|
| 340 |
+
|
| 341 |
+
def flight_of(filename):
|
| 342 |
+
"""Images are named `<flight_id>_DJI_<frame>.jpg`; grouping by
|
| 343 |
+
flight_id recovers each drone's actual, contiguous flight sequence."""
|
| 344 |
+
m = FLIGHT_PATTERN.match(filename)
|
| 345 |
+
return m.group(1) if m else None
|
| 346 |
+
|
| 347 |
+
|
| 348 |
+
# Tier 0: eval holdout, carved out FIRST and stratified per class, before
|
| 349 |
+
# any annotation tier gets a chance to claim these images.
|
| 350 |
+
for cls in TARGET_CLASSES:
|
| 351 |
+
candidates = [fn for fn, lbls in fn_labels.items() if cls in lbls and fn not in selected]
|
| 352 |
+
rng.shuffle(candidates)
|
| 353 |
+
picked = candidates[:EVAL_HOLDOUT_PER_CLASS]
|
| 354 |
+
for fn in picked:
|
| 355 |
+
selected[fn] = f"eval_holdout:{cls}"
|
| 356 |
+
|
| 357 |
+
# Tier 1: all 4 target classes, capped at the same per-flight, per-class quota
|
| 358 |
+
for cls in TARGET_CLASSES:
|
| 359 |
+
candidates = [fn for fn, lbls in fn_labels.items() if cls in lbls and fn not in selected]
|
| 360 |
+
rng.shuffle(candidates)
|
| 361 |
+
per_flight_count = defaultdict(int)
|
| 362 |
+
picked = []
|
| 363 |
+
for fn in candidates:
|
| 364 |
+
fid = flight_of(fn)
|
| 365 |
+
if per_flight_count[fid] < TARGET_CLASS_PER_FLIGHT_CAP and len(picked) < TARGET_CLASS_QUOTA:
|
| 366 |
+
picked.append(fn)
|
| 367 |
+
per_flight_count[fid] += 1
|
| 368 |
+
|
| 369 |
+
# Tier 2: N_DUP_WALL_FLIGHTS whole flights, every frame kept
|
| 370 |
+
flight_ids_sorted = sorted(flights.keys())
|
| 371 |
+
dup_wall_flights = rng.sample(flight_ids_sorted, N_DUP_WALL_FLIGHTS)
|
| 372 |
+
|
| 373 |
+
# Tier 3: one remaining image per flight, for long-tail texture
|
| 374 |
+
for fid, fns in flights.items():
|
| 375 |
+
remaining = [fn for fn in fns if fn not in selected]
|
| 376 |
+
if remaining:
|
| 377 |
+
pick = rng.choice(remaining)
|
| 378 |
+
```
|
| 379 |
|
| 380 |
+
Result, with `seed=51`:
|
| 381 |
|
| 382 |
+
| Tier | What it keeps | Images |
|
| 383 |
+
|---|---|---|
|
| 384 |
+
| 0: Eval holdout (25/class, carved out first) | `tower id plate`, `polymer insulator`, `glass insulator`, `yoke`, 25 each | 100 |
|
| 385 |
+
| 1: Balanced annotation targets (capped per class, per flight) | `tower id plate` (214), `polymer insulator` (217), `glass insulator` (217), `yoke` (217) | 865 |
|
| 386 |
+
| 2: Duplicate-wall flights (14 flights, 100% intact) | real contiguous drone-frame sequences | 574 |
|
| 387 |
+
| 3: Long-tail texture (1/remaining flight) | everything else, thinly | 215 |
|
| 388 |
+
| **Total** | | **1,754** |
|
| 389 |
|
| 390 |
+
The 100 eval-holdout images are tagged `eval_holdout` at import time (step 4)
|
| 391 |
+
and excluded from every interactive step of the companion workshop; the true
|
| 392 |
+
interactive pool at any point is 1,654 images. A later staging step copies
|
| 393 |
+
all 1,754 images into a lean pool directory and converts their real COCO
|
| 394 |
+
boxes to FiftyOne's relative `[x, y, w, h]` format, but writes them to
|
| 395 |
+
`heldout_ground_truth.json` rather than into the FiftyOne dataset, which is
|
| 396 |
+
imported strictly media-only.
|
| 397 |
|
| 398 |
+
### Source Data
|
| 399 |
|
| 400 |
+
#### Data Collection and Processing
|
| 401 |
|
| 402 |
+
The underlying images were captured by UAV (drone) during real-world inspections
|
| 403 |
+
of operating power lines, at 1920x1080 resolution, under varied environmental
|
| 404 |
+
conditions, orientations, and distances. See the original
|
| 405 |
+
[InsPLAD dataset card](https://huggingface.co/datasets/harpreetsahota/InsPLAD)
|
| 406 |
+
for the full collection and annotation process. This derivative pool applies no
|
| 407 |
+
further transformation to the images themselves; it only selects which 1,754 of
|
| 408 |
+
the 10,561 to include, per the stratified sampling above.
|
| 409 |
|
| 410 |
+
#### Who are the source data producers?
|
| 411 |
|
| 412 |
+
UAV inspection imagery of real, operating power lines, collected by the Voxar
|
| 413 |
+
Labs group at Universidade Federal de Pernambuco (see the original InsPLAD paper
|
| 414 |
+
and dataset card).
|
| 415 |
|
| 416 |
+
### Annotations
|
| 417 |
|
| 418 |
+
This dataset ships with no annotations. The real bounding boxes for these same
|
| 419 |
+
1,754 images exist (extracted from InsPLAD-det's COCO annotations during
|
| 420 |
+
staging) but are deliberately withheld from this Hub dataset, distributed
|
| 421 |
+
alongside the workshop's companion code as `heldout_ground_truth.json` instead.
|
| 422 |
|
| 423 |
+
#### Personal and Sensitive Information
|
| 424 |
|
| 425 |
+
Not addressed explicitly in the source paper. Images are aerial captures of
|
| 426 |
+
power line hardware and surrounding infrastructure; there is no statement in the
|
| 427 |
+
source material regarding incidental capture of people or other personal data.
|
| 428 |
+
`[More Information Needed]`
|
| 429 |
|
| 430 |
+
## Citation
|
| 431 |
|
| 432 |
**BibTeX:**
|
| 433 |
|
| 434 |
+
```
|
| 435 |
+
@article{doi:10.1080/01431161.2023.2283900,
|
| 436 |
+
author = {André Luiz Buarque Vieira e Silva, Heitor de Castro Felix, Franscisco Paulo Magalhães Simões, Veronica Teichrieb, Michel dos Santos, Hemir Santiago, Virginia Sgotti and Henrique Lott Neto},
|
| 437 |
+
title = {InsPLAD: A Dataset and Benchmark for Power Line Asset Inspection in UAV Images},
|
| 438 |
+
journal = {International Journal of Remote Sensing},
|
| 439 |
+
volume = {44},
|
| 440 |
+
number = {23},
|
| 441 |
+
pages = {1-27},
|
| 442 |
+
year = {2023},
|
| 443 |
+
publisher = {Taylor & Francis},
|
| 444 |
+
doi = {10.1080/01431161.2023.2283900},
|
| 445 |
+
URL = {https://doi.org/10.1080/01431161.2023.2283900},
|
| 446 |
+
eprint = {https://doi.org/10.1080/01431161.2023.2283900},
|
| 447 |
+
}
|
| 448 |
+
```
|
| 449 |
|
| 450 |
**APA:**
|
| 451 |
|
| 452 |
+
Vieira-e-Silva, A. L. B., de Castro Felix, H., Simões, F. P. M., Teichrieb, V., dos Santos, M., Santiago, H., Sgotti, V., & Lott Neto, H. (2023). InsPLAD: A Dataset and Benchmark for Power Line Asset Inspection in UAV Images. *International Journal of Remote Sensing*, 44(23), 1-27.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 453 |
|
| 454 |
+
## More Information
|
| 455 |
|
| 456 |
+
This is a derivative sampling of InsPLAD-det for the "Cold Pool to Hot Queue"
|
| 457 |
+
FiftyOne workshop. The full pipeline that builds this pool from scratch (source
|
| 458 |
+
download through media-only import), plus the in-App workshop steps and the
|
| 459 |
+
eval-holdout reveal/scoring script, lives in the workshop's companion GitHub
|
| 460 |
+
repository: **https://github.com/harpreetsahota204/annotation_workshop/tree/main**.
|
| 461 |
+
For the full, labeled InsPLAD dataset (all three official sub-tasks, 49,706
|
| 462 |
+
samples), see https://huggingface.co/datasets/harpreetsahota/InsPLAD.
|
| 463 |
|
| 464 |
+
## Dataset Card Authors
|
| 465 |
|
| 466 |
+
Harpreet Sahota (FiftyOne / Voxel51 sampling and card)
|
| 467 |
|
| 468 |
## Dataset Card Contact
|
| 469 |
|
| 470 |
+
harpreetsahota
|