Commit ·
ab88412
0
Parent(s):
Duplicate from ngres/IGVC-Segmentation
Browse filesCo-authored-by: Nicolas <ngres@users.noreply.huggingface.co>
This view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +59 -0
- .gitignore +1 -0
- README.md +104 -0
- test/composite/1-00038.png +3 -0
- test/composite/1-00049.png +3 -0
- test/composite/1-00053.png +3 -0
- test/composite/1-00068.png +3 -0
- test/composite/1-00073.png +3 -0
- test/composite/1-00076.png +3 -0
- test/composite/1-00082.png +3 -0
- test/composite/1-00083.png +3 -0
- test/composite/1-00103.png +3 -0
- test/composite/1-00108.png +3 -0
- test/composite/1-10000.png +3 -0
- test/composite/1-10200.png +3 -0
- test/composite/1-10400.png +3 -0
- test/composite/1-10600.png +3 -0
- test/composite/1-10800.png +3 -0
- test/composite/1-11000.png +3 -0
- test/composite/1-11200.png +3 -0
- test/composite/1-11400.png +3 -0
- test/composite/1-11600.png +3 -0
- test/composite/1-11800.png +3 -0
- test/composite/1-12000.png +3 -0
- test/composite/1-12200.png +3 -0
- test/composite/1-12400.png +3 -0
- test/composite/2-10000.png +3 -0
- test/composite/2-10200.png +3 -0
- test/composite/2-10400.png +3 -0
- test/composite/2-10600.png +3 -0
- test/composite/2-10800.png +3 -0
- test/composite/2-11000.png +3 -0
- test/composite/2-11200.png +3 -0
- test/composite/2-11400.png +3 -0
- test/composite/2-11600.png +3 -0
- test/composite/2-11800.png +3 -0
- test/composite/2-12000.png +3 -0
- test/composite/2-12200.png +3 -0
- test/composite/2-12400.png +3 -0
- test/composite/3-10000.png +3 -0
- test/composite/3-10200.png +3 -0
- test/composite/3-10400.png +3 -0
- test/composite/3-10600.png +3 -0
- test/composite/3-10800.png +3 -0
- test/composite/3-11000.png +3 -0
- test/composite/3-11200.png +3 -0
- test/composite/3-11400.png +3 -0
- test/composite/3-11600.png +3 -0
- test/composite/3-11800.png +3 -0
- test/composite/3-12000.png +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.DS_Store
|
README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: IGVC Segmentation Dataset
|
| 3 |
+
tags:
|
| 4 |
+
- image
|
| 5 |
+
license: cc-by-4.0
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# IGCV Segmentation Dataset
|
| 9 |
+
|
| 10 |
+
Dataset for training a semantic image segmentation model for the [Intelligent Ground Vehicle Competition](http://www.igvc.org/).
|
| 11 |
+
|
| 12 |
+
## Composition
|
| 13 |
+
|
| 14 |
+
Each instance consists of an reference image from the point of view of the robot and the corresponding obstacle (e.g. construction drums, buckets) and lane segmentation masks.
|
| 15 |
+
|
| 16 |
+
**Train**
|
| 17 |
+
|
| 18 |
+
256 frames rendered in 4 different lighting environments using Blender = 1024 images
|
| 19 |
+
|
| 20 |
+
**Test**
|
| 21 |
+
|
| 22 |
+
10 frames captured from the [SCR 2023 IGVC run](https://www.youtube.com/watch?v=7tZsk3T3STA) (manually segmented) + 13 frames rendered in 4 lighting environments = 62 images
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
For usage with PyTorch it is recommended to wrap the dataset into a [`Dataset`](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Dataset) adapter class and generate a training/validation split:
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from torch.utils.data import Dataset
|
| 30 |
+
from datasets import load_dataset, Dataset as HFDataset
|
| 31 |
+
import numpy as np
|
| 32 |
+
|
| 33 |
+
class Split:
|
| 34 |
+
TRAIN = "train"
|
| 35 |
+
VALID = "valid"
|
| 36 |
+
TEST = "test"
|
| 37 |
+
|
| 38 |
+
class SegmentationDataset(Dataset):
|
| 39 |
+
def __init__(self, path="Nico0302/IGVC-Segmentation", split=Split.TRAIN, transform=None, mask_name="obstacle_mask", valid_size=0.125):
|
| 40 |
+
self.path = path
|
| 41 |
+
self.split = split
|
| 42 |
+
self.transform = transform
|
| 43 |
+
self.mask_name = mask_name
|
| 44 |
+
self.valid_size = valid_size
|
| 45 |
+
|
| 46 |
+
self.data = self._read_split()
|
| 47 |
+
|
| 48 |
+
def __len__(self):
|
| 49 |
+
return len(self.data)
|
| 50 |
+
|
| 51 |
+
def __getitem__(self, idx):
|
| 52 |
+
item = self.data[idx]
|
| 53 |
+
|
| 54 |
+
sample = dict(image=np.array(item["image"]), mask=np.array(item[self.mask_name]))
|
| 55 |
+
if self.transform is not None:
|
| 56 |
+
sample = self.transform(**sample)
|
| 57 |
+
|
| 58 |
+
return {
|
| 59 |
+
"image": np.transpose(sample["image"], (2, 0, 1)), # HWC to CHW (3, H, W)
|
| 60 |
+
"mask": np.expand_dims(sample["mask"].astype(np.float32) / 255.0, 0), # HW to CHW (1, H, W)
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
def _read_split(self):
|
| 64 |
+
dataset = load_dataset(self.path, split="test" if self.split == Split.TEST else "train")
|
| 65 |
+
assert isinstance(dataset, HFDataset), "Dataset must be a Hugging Face Dataset"
|
| 66 |
+
|
| 67 |
+
if (self.split == Split.TEST):
|
| 68 |
+
return dataset
|
| 69 |
+
|
| 70 |
+
splits = dataset.train_test_split(test_size=self.valid_size, seed=42)
|
| 71 |
+
if self.split == Split.VALID:
|
| 72 |
+
return splits["test"]
|
| 73 |
+
return splits["train"]
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
Using this adapter, the dataset can simple be passed to the [`DataLoader`](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader):
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
train_dataset = SegmentationDataset(split=Split.TRAIN)
|
| 80 |
+
valid_dataset = SegmentationDataset(split=Split.VALID)
|
| 81 |
+
test_dataset = SegmentationDataset(split=Split.TEST)
|
| 82 |
+
|
| 83 |
+
train_dataloader = DataLoader(train_dataset)
|
| 84 |
+
valid_dataloader = DataLoader(valid_dataset)
|
| 85 |
+
test_dataloader = DataLoader(test_dataset)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Acknowledgements
|
| 89 |
+
|
| 90 |
+
Thank you for [Sooner Competitive Robotics](https://ou.edu/scr/) for allowing me to use frames from their IGVC 2023 run video as part of the test set.
|
| 91 |
+
|
| 92 |
+
## Citation
|
| 93 |
+
|
| 94 |
+
If you are using this dataset, please cite
|
| 95 |
+
|
| 96 |
+
```bibtex
|
| 97 |
+
@misc{gres2025IGVC,
|
| 98 |
+
author = { Nicolas Gres },
|
| 99 |
+
title = { IGCV Segmentation Dataset },
|
| 100 |
+
year = 2025,
|
| 101 |
+
url = { https://huggingface.co/datasets/Nico0302/IGVC-Segmentation },
|
| 102 |
+
publisher = { Hugging Face }
|
| 103 |
+
}
|
| 104 |
+
```
|
test/composite/1-00038.png
ADDED
|
Git LFS Details
|
test/composite/1-00049.png
ADDED
|
Git LFS Details
|
test/composite/1-00053.png
ADDED
|
Git LFS Details
|
test/composite/1-00068.png
ADDED
|
Git LFS Details
|
test/composite/1-00073.png
ADDED
|
Git LFS Details
|
test/composite/1-00076.png
ADDED
|
Git LFS Details
|
test/composite/1-00082.png
ADDED
|
Git LFS Details
|
test/composite/1-00083.png
ADDED
|
Git LFS Details
|
test/composite/1-00103.png
ADDED
|
Git LFS Details
|
test/composite/1-00108.png
ADDED
|
Git LFS Details
|
test/composite/1-10000.png
ADDED
|
Git LFS Details
|
test/composite/1-10200.png
ADDED
|
Git LFS Details
|
test/composite/1-10400.png
ADDED
|
Git LFS Details
|
test/composite/1-10600.png
ADDED
|
Git LFS Details
|
test/composite/1-10800.png
ADDED
|
Git LFS Details
|
test/composite/1-11000.png
ADDED
|
Git LFS Details
|
test/composite/1-11200.png
ADDED
|
Git LFS Details
|
test/composite/1-11400.png
ADDED
|
Git LFS Details
|
test/composite/1-11600.png
ADDED
|
Git LFS Details
|
test/composite/1-11800.png
ADDED
|
Git LFS Details
|
test/composite/1-12000.png
ADDED
|
Git LFS Details
|
test/composite/1-12200.png
ADDED
|
Git LFS Details
|
test/composite/1-12400.png
ADDED
|
Git LFS Details
|
test/composite/2-10000.png
ADDED
|
Git LFS Details
|
test/composite/2-10200.png
ADDED
|
Git LFS Details
|
test/composite/2-10400.png
ADDED
|
Git LFS Details
|
test/composite/2-10600.png
ADDED
|
Git LFS Details
|
test/composite/2-10800.png
ADDED
|
Git LFS Details
|
test/composite/2-11000.png
ADDED
|
Git LFS Details
|
test/composite/2-11200.png
ADDED
|
Git LFS Details
|
test/composite/2-11400.png
ADDED
|
Git LFS Details
|
test/composite/2-11600.png
ADDED
|
Git LFS Details
|
test/composite/2-11800.png
ADDED
|
Git LFS Details
|
test/composite/2-12000.png
ADDED
|
Git LFS Details
|
test/composite/2-12200.png
ADDED
|
Git LFS Details
|
test/composite/2-12400.png
ADDED
|
Git LFS Details
|
test/composite/3-10000.png
ADDED
|
Git LFS Details
|
test/composite/3-10200.png
ADDED
|
Git LFS Details
|
test/composite/3-10400.png
ADDED
|
Git LFS Details
|
test/composite/3-10600.png
ADDED
|
Git LFS Details
|
test/composite/3-10800.png
ADDED
|
Git LFS Details
|
test/composite/3-11000.png
ADDED
|
Git LFS Details
|
test/composite/3-11200.png
ADDED
|
Git LFS Details
|
test/composite/3-11400.png
ADDED
|
Git LFS Details
|
test/composite/3-11600.png
ADDED
|
Git LFS Details
|
test/composite/3-11800.png
ADDED
|
Git LFS Details
|
test/composite/3-12000.png
ADDED
|
Git LFS Details
|