dataset uploaded by roboflow2huggingface package
Browse files- DominoDataset.py +153 -0
- README.dataset.txt +6 -0
- README.md +100 -0
- README.roboflow.txt +34 -0
- data/test.zip +3 -0
- data/train.zip +3 -0
- data/valid-mini.zip +3 -0
- data/valid.zip +3 -0
- split_name_to_num_samples.json +1 -0
- thumbnail.jpg +3 -0
DominoDataset.py
ADDED
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import collections
|
2 |
+
import json
|
3 |
+
import os
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
|
8 |
+
_HOMEPAGE = "https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5/dataset/2"
|
9 |
+
_LICENSE = "CC BY 4.0"
|
10 |
+
_CITATION = """\
|
11 |
+
@misc{
|
12 |
+
dominos-6ptm5_dataset,
|
13 |
+
title = { dominos Dataset },
|
14 |
+
type = { Open Source Dataset },
|
15 |
+
author = { Virginia Tech },
|
16 |
+
howpublished = { \\url{ https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5 } },
|
17 |
+
url = { https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5 },
|
18 |
+
journal = { Roboflow Universe },
|
19 |
+
publisher = { Roboflow },
|
20 |
+
year = { 2024 },
|
21 |
+
month = { sep },
|
22 |
+
note = { visited on 2024-09-14 },
|
23 |
+
}
|
24 |
+
"""
|
25 |
+
_CATEGORIES = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15']
|
26 |
+
_ANNOTATION_FILENAME = "_annotations.coco.json"
|
27 |
+
|
28 |
+
|
29 |
+
class DOMINODATASETConfig(datasets.BuilderConfig):
|
30 |
+
"""Builder Config for DominoDataset"""
|
31 |
+
|
32 |
+
def __init__(self, data_urls, **kwargs):
|
33 |
+
"""
|
34 |
+
BuilderConfig for DominoDataset.
|
35 |
+
|
36 |
+
Args:
|
37 |
+
data_urls: `dict`, name to url to download the zip file from.
|
38 |
+
**kwargs: keyword arguments forwarded to super.
|
39 |
+
"""
|
40 |
+
super(DOMINODATASETConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
|
41 |
+
self.data_urls = data_urls
|
42 |
+
|
43 |
+
|
44 |
+
class DOMINODATASET(datasets.GeneratorBasedBuilder):
|
45 |
+
"""DominoDataset object detection dataset"""
|
46 |
+
|
47 |
+
VERSION = datasets.Version("1.0.0")
|
48 |
+
BUILDER_CONFIGS = [
|
49 |
+
DOMINODATASETConfig(
|
50 |
+
name="full",
|
51 |
+
description="Full version of DominoDataset dataset.",
|
52 |
+
data_urls={
|
53 |
+
"train": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/train.zip",
|
54 |
+
"validation": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/valid.zip",
|
55 |
+
"test": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/test.zip",
|
56 |
+
},
|
57 |
+
),
|
58 |
+
DOMINODATASETConfig(
|
59 |
+
name="mini",
|
60 |
+
description="Mini version of DominoDataset dataset.",
|
61 |
+
data_urls={
|
62 |
+
"train": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/valid-mini.zip",
|
63 |
+
"validation": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/valid-mini.zip",
|
64 |
+
"test": "https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/data/valid-mini.zip",
|
65 |
+
},
|
66 |
+
)
|
67 |
+
]
|
68 |
+
|
69 |
+
def _info(self):
|
70 |
+
features = datasets.Features(
|
71 |
+
{
|
72 |
+
"image_id": datasets.Value("int64"),
|
73 |
+
"image": datasets.Image(),
|
74 |
+
"width": datasets.Value("int32"),
|
75 |
+
"height": datasets.Value("int32"),
|
76 |
+
"objects": datasets.Sequence(
|
77 |
+
{
|
78 |
+
"id": datasets.Value("int64"),
|
79 |
+
"area": datasets.Value("int64"),
|
80 |
+
"bbox": datasets.Sequence(datasets.Value("float32"), length=4),
|
81 |
+
"category": datasets.ClassLabel(names=_CATEGORIES),
|
82 |
+
}
|
83 |
+
),
|
84 |
+
}
|
85 |
+
)
|
86 |
+
return datasets.DatasetInfo(
|
87 |
+
features=features,
|
88 |
+
homepage=_HOMEPAGE,
|
89 |
+
citation=_CITATION,
|
90 |
+
license=_LICENSE,
|
91 |
+
)
|
92 |
+
|
93 |
+
def _split_generators(self, dl_manager):
|
94 |
+
data_files = dl_manager.download_and_extract(self.config.data_urls)
|
95 |
+
return [
|
96 |
+
datasets.SplitGenerator(
|
97 |
+
name=datasets.Split.TRAIN,
|
98 |
+
gen_kwargs={
|
99 |
+
"folder_dir": data_files["train"],
|
100 |
+
},
|
101 |
+
),
|
102 |
+
datasets.SplitGenerator(
|
103 |
+
name=datasets.Split.VALIDATION,
|
104 |
+
gen_kwargs={
|
105 |
+
"folder_dir": data_files["validation"],
|
106 |
+
},
|
107 |
+
),
|
108 |
+
datasets.SplitGenerator(
|
109 |
+
name=datasets.Split.TEST,
|
110 |
+
gen_kwargs={
|
111 |
+
"folder_dir": data_files["test"],
|
112 |
+
},
|
113 |
+
),
|
114 |
+
]
|
115 |
+
|
116 |
+
def _generate_examples(self, folder_dir):
|
117 |
+
def process_annot(annot, category_id_to_category):
|
118 |
+
return {
|
119 |
+
"id": annot["id"],
|
120 |
+
"area": annot["area"],
|
121 |
+
"bbox": annot["bbox"],
|
122 |
+
"category": category_id_to_category[annot["category_id"]],
|
123 |
+
}
|
124 |
+
|
125 |
+
image_id_to_image = {}
|
126 |
+
idx = 0
|
127 |
+
|
128 |
+
annotation_filepath = os.path.join(folder_dir, _ANNOTATION_FILENAME)
|
129 |
+
with open(annotation_filepath, "r") as f:
|
130 |
+
annotations = json.load(f)
|
131 |
+
category_id_to_category = {category["id"]: category["name"] for category in annotations["categories"]}
|
132 |
+
image_id_to_annotations = collections.defaultdict(list)
|
133 |
+
for annot in annotations["annotations"]:
|
134 |
+
image_id_to_annotations[annot["image_id"]].append(annot)
|
135 |
+
filename_to_image = {image["file_name"]: image for image in annotations["images"]}
|
136 |
+
|
137 |
+
for filename in os.listdir(folder_dir):
|
138 |
+
filepath = os.path.join(folder_dir, filename)
|
139 |
+
if filename in filename_to_image:
|
140 |
+
image = filename_to_image[filename]
|
141 |
+
objects = [
|
142 |
+
process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
|
143 |
+
]
|
144 |
+
with open(filepath, "rb") as f:
|
145 |
+
image_bytes = f.read()
|
146 |
+
yield idx, {
|
147 |
+
"image_id": image["id"],
|
148 |
+
"image": {"path": filepath, "bytes": image_bytes},
|
149 |
+
"width": image["width"],
|
150 |
+
"height": image["height"],
|
151 |
+
"objects": objects,
|
152 |
+
}
|
153 |
+
idx += 1
|
README.dataset.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# dominos > 2024-09-14 6:35am
|
2 |
+
https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5
|
3 |
+
|
4 |
+
Provided by a Roboflow user
|
5 |
+
License: CC BY 4.0
|
6 |
+
|
README.md
ADDED
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
task_categories:
|
3 |
+
- object-detection
|
4 |
+
tags:
|
5 |
+
- roboflow
|
6 |
+
- roboflow2huggingface
|
7 |
+
|
8 |
+
---
|
9 |
+
|
10 |
+
<div align="center">
|
11 |
+
<img width="640" alt="aviola/DominoDataset" src="https://huggingface.co/datasets/aviola/DominoDataset/resolve/main/thumbnail.jpg">
|
12 |
+
</div>
|
13 |
+
|
14 |
+
### Dataset Labels
|
15 |
+
|
16 |
+
```
|
17 |
+
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15']
|
18 |
+
```
|
19 |
+
|
20 |
+
|
21 |
+
### Number of Images
|
22 |
+
|
23 |
+
```json
|
24 |
+
{'valid': 11, 'test': 10, 'train': 249}
|
25 |
+
```
|
26 |
+
|
27 |
+
|
28 |
+
### How to Use
|
29 |
+
|
30 |
+
- Install [datasets](https://pypi.org/project/datasets/):
|
31 |
+
|
32 |
+
```bash
|
33 |
+
pip install datasets
|
34 |
+
```
|
35 |
+
|
36 |
+
- Load the dataset:
|
37 |
+
|
38 |
+
```python
|
39 |
+
from datasets import load_dataset
|
40 |
+
|
41 |
+
ds = load_dataset("aviola/DominoDataset", name="full")
|
42 |
+
example = ds['train'][0]
|
43 |
+
```
|
44 |
+
|
45 |
+
### Roboflow Dataset Page
|
46 |
+
[https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5/dataset/2](https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5/dataset/2?ref=roboflow2huggingface)
|
47 |
+
|
48 |
+
### Citation
|
49 |
+
|
50 |
+
```
|
51 |
+
@misc{
|
52 |
+
dominos-6ptm5_dataset,
|
53 |
+
title = { dominos Dataset },
|
54 |
+
type = { Open Source Dataset },
|
55 |
+
author = { Virginia Tech },
|
56 |
+
howpublished = { \\url{ https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5 } },
|
57 |
+
url = { https://universe.roboflow.com/virginia-tech-xente/dominos-6ptm5 },
|
58 |
+
journal = { Roboflow Universe },
|
59 |
+
publisher = { Roboflow },
|
60 |
+
year = { 2024 },
|
61 |
+
month = { sep },
|
62 |
+
note = { visited on 2024-09-14 },
|
63 |
+
}
|
64 |
+
```
|
65 |
+
|
66 |
+
### License
|
67 |
+
CC BY 4.0
|
68 |
+
|
69 |
+
### Dataset Summary
|
70 |
+
This dataset was exported via roboflow.com on September 14, 2024 at 6:38 AM GMT
|
71 |
+
|
72 |
+
Roboflow is an end-to-end computer vision platform that helps you
|
73 |
+
* collaborate with your team on computer vision projects
|
74 |
+
* collect & organize images
|
75 |
+
* understand and search unstructured image data
|
76 |
+
* annotate, and create datasets
|
77 |
+
* export, train, and deploy computer vision models
|
78 |
+
* use active learning to improve your dataset over time
|
79 |
+
|
80 |
+
For state of the art Computer Vision training notebooks you can use with this dataset,
|
81 |
+
visit https://github.com/roboflow/notebooks
|
82 |
+
|
83 |
+
To find over 100k other datasets and pre-trained models, visit https://universe.roboflow.com
|
84 |
+
|
85 |
+
The dataset includes 270 images.
|
86 |
+
Dominos are annotated in COCO format.
|
87 |
+
|
88 |
+
The following pre-processing was applied to each image:
|
89 |
+
* Auto-orientation of pixel data (with EXIF-orientation stripping)
|
90 |
+
* Resize to 640x640 (Stretch)
|
91 |
+
|
92 |
+
The following augmentation was applied to create 3 versions of each source image:
|
93 |
+
* 50% probability of horizontal flip
|
94 |
+
* Randomly crop between 0 and 20 percent of the image
|
95 |
+
* Random rotation of between -15 and +15 degrees
|
96 |
+
* Random Gaussian blur of between 0 and 1.5 pixels
|
97 |
+
* Salt and pepper noise was applied to 0.1 percent of pixels
|
98 |
+
|
99 |
+
|
100 |
+
|
README.roboflow.txt
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
dominos - v2 2024-09-14 6:35am
|
3 |
+
==============================
|
4 |
+
|
5 |
+
This dataset was exported via roboflow.com on September 14, 2024 at 6:38 AM GMT
|
6 |
+
|
7 |
+
Roboflow is an end-to-end computer vision platform that helps you
|
8 |
+
* collaborate with your team on computer vision projects
|
9 |
+
* collect & organize images
|
10 |
+
* understand and search unstructured image data
|
11 |
+
* annotate, and create datasets
|
12 |
+
* export, train, and deploy computer vision models
|
13 |
+
* use active learning to improve your dataset over time
|
14 |
+
|
15 |
+
For state of the art Computer Vision training notebooks you can use with this dataset,
|
16 |
+
visit https://github.com/roboflow/notebooks
|
17 |
+
|
18 |
+
To find over 100k other datasets and pre-trained models, visit https://universe.roboflow.com
|
19 |
+
|
20 |
+
The dataset includes 270 images.
|
21 |
+
Dominos are annotated in COCO format.
|
22 |
+
|
23 |
+
The following pre-processing was applied to each image:
|
24 |
+
* Auto-orientation of pixel data (with EXIF-orientation stripping)
|
25 |
+
* Resize to 640x640 (Stretch)
|
26 |
+
|
27 |
+
The following augmentation was applied to create 3 versions of each source image:
|
28 |
+
* 50% probability of horizontal flip
|
29 |
+
* Randomly crop between 0 and 20 percent of the image
|
30 |
+
* Random rotation of between -15 and +15 degrees
|
31 |
+
* Random Gaussian blur of between 0 and 1.5 pixels
|
32 |
+
* Salt and pepper noise was applied to 0.1 percent of pixels
|
33 |
+
|
34 |
+
|
data/test.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3110a9b3ee7769949ef5c35088721efcb966c527979cd9e9fe82b8b1b639c275
|
3 |
+
size 510273
|
data/train.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:61fa950a26f9b1e6c0b3cd923dcf6e2b5caf5678c1a335f66dfe63e62f42eb0c
|
3 |
+
size 12715943
|
data/valid-mini.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ff9c1c47342634e924a9697fb825c2c7006bd9d561fe1483ea61fc869309e4dd
|
3 |
+
size 178546
|
data/valid.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ffcf58a9bbfc468f7897ef48d0dd2885cc5459261870d2ec41bbd3cf6b7f2417
|
3 |
+
size 614859
|
split_name_to_num_samples.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"valid": 11, "test": 10, "train": 249}
|
thumbnail.jpg
ADDED
Git LFS Details
|