Datasets:
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- image-segmentation
|
| 5 |
+
- object-detection
|
| 6 |
+
tags:
|
| 7 |
+
- recycling
|
| 8 |
+
- steel-scrap
|
| 9 |
+
- copper
|
| 10 |
+
- yolo
|
| 11 |
+
configs:
|
| 12 |
+
- config_name: a1
|
| 13 |
+
data_files:
|
| 14 |
+
- split: test
|
| 15 |
+
path: data/a1/test/*.parquet
|
| 16 |
+
- split: train
|
| 17 |
+
path: data/a1/train/*.parquet
|
| 18 |
+
- split: val
|
| 19 |
+
path: data/a1/val/*.parquet
|
| 20 |
+
---
|
| 21 |
+
# SteelDS (Parquet mirror)
|
| 22 |
+
|
| 23 |
+
Shredded E40 steel scrap and copper on a lab conveyor belt, 3680 x 2160 frames with YOLO segmentation labels.
|
| 24 |
+
Mirror of https://zenodo.org/records/20271102, converted for streaming (videos left out). Licence: CC BY 4.0, credit the original authors.
|
| 25 |
+
|
| 26 |
+
- Subsets (configs): a1; a1-a3 are labelled, a4-a5 unlabelled
|
| 27 |
+
- Classes: 0 = background, 1 = steel, 2 = copper
|
| 28 |
+
- `yolo_label`: the original YOLO-seg label text ("<class> x1 y1 x2 y2 ..." normalised to 0-1); `has_label` = False where the original frame had no label file
|
| 29 |
+
|
| 30 |
+
## Load
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from datasets import load_dataset
|
| 34 |
+
|
| 35 |
+
ds = load_dataset("vivekkol/steelds", "a1", split="train", streaming=True) # or without streaming=True to download once
|
| 36 |
+
for row in ds:
|
| 37 |
+
image = row["image"] # PIL image
|
| 38 |
+
label = row["yolo_label"] # YOLO-seg text, same as the original .txt file
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Write out as YOLO folders (for Ultralytics)
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
import os
|
| 45 |
+
from datasets import load_dataset
|
| 46 |
+
|
| 47 |
+
for split in ["train", "val", "test"]:
|
| 48 |
+
os.makedirs(f"steelds/images/{split}", exist_ok=True); os.makedirs(f"steelds/labels/{split}", exist_ok=True)
|
| 49 |
+
for row in load_dataset("vivekkol/steelds", "a1", split=split, streaming=True):
|
| 50 |
+
row["image"].save(f"steelds/images/{split}/{row['file_name']}.jpg", quality=95)
|
| 51 |
+
open(f"steelds/labels/{split}/{row['file_name']}.txt", "w").write(row["yolo_label"])
|
| 52 |
+
```
|