Convert dataset to Parquet
#1
by
SamuelM0422
- opened
- README.dataset.txt +0 -6
- README.md +90 -1
- README.roboflow.txt +0 -35
- SunDataset.py +0 -153
- data/test.zip → full/test-00000-of-00001.parquet +2 -2
- data/train.zip → full/train-00000-of-00001.parquet +2 -2
- data/valid.zip → full/validation-00000-of-00001.parquet +2 -2
- data/valid-mini.zip → mini/test-00000-of-00001.parquet +2 -2
- thumbnail.jpg → mini/train-00000-of-00001.parquet +2 -2
- mini/validation-00000-of-00001.parquet +3 -0
- split_name_to_num_samples.json +0 -1
README.dataset.txt
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
# SunDetection > SunDatasetv1
|
| 2 |
-
https://universe.roboflow.com/samuelm0422/sundetection-bwqjs
|
| 3 |
-
|
| 4 |
-
Provided by a Roboflow user
|
| 5 |
-
License: CC BY 4.0
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -4,7 +4,96 @@ task_categories:
|
|
| 4 |
tags:
|
| 5 |
- roboflow
|
| 6 |
- roboflow2huggingface
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
<div align="center">
|
|
|
|
| 4 |
tags:
|
| 5 |
- roboflow
|
| 6 |
- roboflow2huggingface
|
| 7 |
+
dataset_info:
|
| 8 |
+
- config_name: full
|
| 9 |
+
features:
|
| 10 |
+
- name: image_id
|
| 11 |
+
dtype: int64
|
| 12 |
+
- name: image
|
| 13 |
+
dtype: image
|
| 14 |
+
- name: width
|
| 15 |
+
dtype: int32
|
| 16 |
+
- name: height
|
| 17 |
+
dtype: int32
|
| 18 |
+
- name: objects
|
| 19 |
+
sequence:
|
| 20 |
+
- name: id
|
| 21 |
+
dtype: int64
|
| 22 |
+
- name: area
|
| 23 |
+
dtype: int64
|
| 24 |
+
- name: bbox
|
| 25 |
+
sequence: float32
|
| 26 |
+
length: 4
|
| 27 |
+
- name: category
|
| 28 |
+
dtype:
|
| 29 |
+
class_label:
|
| 30 |
+
names:
|
| 31 |
+
'0': sun
|
| 32 |
+
splits:
|
| 33 |
+
- name: train
|
| 34 |
+
num_bytes: 116033440.923
|
| 35 |
+
num_examples: 4047
|
| 36 |
+
- name: validation
|
| 37 |
+
num_bytes: 10697357.0
|
| 38 |
+
num_examples: 374
|
| 39 |
+
- name: test
|
| 40 |
+
num_bytes: 5486934.0
|
| 41 |
+
num_examples: 184
|
| 42 |
+
download_size: 124477992
|
| 43 |
+
dataset_size: 132217731.923
|
| 44 |
+
- config_name: mini
|
| 45 |
+
features:
|
| 46 |
+
- name: image_id
|
| 47 |
+
dtype: int64
|
| 48 |
+
- name: image
|
| 49 |
+
dtype: image
|
| 50 |
+
- name: width
|
| 51 |
+
dtype: int32
|
| 52 |
+
- name: height
|
| 53 |
+
dtype: int32
|
| 54 |
+
- name: objects
|
| 55 |
+
sequence:
|
| 56 |
+
- name: id
|
| 57 |
+
dtype: int64
|
| 58 |
+
- name: area
|
| 59 |
+
dtype: int64
|
| 60 |
+
- name: bbox
|
| 61 |
+
sequence: float32
|
| 62 |
+
length: 4
|
| 63 |
+
- name: category
|
| 64 |
+
dtype:
|
| 65 |
+
class_label:
|
| 66 |
+
names:
|
| 67 |
+
'0': sun
|
| 68 |
+
splits:
|
| 69 |
+
- name: train
|
| 70 |
+
num_bytes: 92832.0
|
| 71 |
+
num_examples: 3
|
| 72 |
+
- name: validation
|
| 73 |
+
num_bytes: 92832.0
|
| 74 |
+
num_examples: 3
|
| 75 |
+
- name: test
|
| 76 |
+
num_bytes: 92832.0
|
| 77 |
+
num_examples: 3
|
| 78 |
+
download_size: 292941
|
| 79 |
+
dataset_size: 278496.0
|
| 80 |
+
configs:
|
| 81 |
+
- config_name: full
|
| 82 |
+
data_files:
|
| 83 |
+
- split: train
|
| 84 |
+
path: full/train-*
|
| 85 |
+
- split: validation
|
| 86 |
+
path: full/validation-*
|
| 87 |
+
- split: test
|
| 88 |
+
path: full/test-*
|
| 89 |
+
- config_name: mini
|
| 90 |
+
data_files:
|
| 91 |
+
- split: train
|
| 92 |
+
path: mini/train-*
|
| 93 |
+
- split: validation
|
| 94 |
+
path: mini/validation-*
|
| 95 |
+
- split: test
|
| 96 |
+
path: mini/test-*
|
| 97 |
---
|
| 98 |
|
| 99 |
<div align="center">
|
README.roboflow.txt
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
SunDetection - v1 SunDatasetv1
|
| 3 |
-
==============================
|
| 4 |
-
|
| 5 |
-
This dataset was exported via roboflow.com on April 10, 2025 at 4:19 PM 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 4605 images.
|
| 21 |
-
Sun-3Qf4-ywwQ-sun 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 |
-
* 50% probability of vertical flip
|
| 30 |
-
* Randomly crop between 0 and 20 percent of the image
|
| 31 |
-
* Random rotation of between -15 and +15 degrees
|
| 32 |
-
* Random shear of between -10° to +10° horizontally and -10° to +10° vertically
|
| 33 |
-
* Random brigthness adjustment of between -15 and +15 percent
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SunDataset.py
DELETED
|
@@ -1,153 +0,0 @@
|
|
| 1 |
-
import collections
|
| 2 |
-
import json
|
| 3 |
-
import os
|
| 4 |
-
|
| 5 |
-
import datasets
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
_HOMEPAGE = "https://universe.roboflow.com/samuelm0422/sundetection-bwqjs/dataset/1"
|
| 9 |
-
_LICENSE = "CC BY 4.0"
|
| 10 |
-
_CITATION = """\
|
| 11 |
-
@misc{
|
| 12 |
-
sundetection-bwqjs_dataset,
|
| 13 |
-
title = { SunDetection Dataset },
|
| 14 |
-
type = { Open Source Dataset },
|
| 15 |
-
author = { SamuelM0422 },
|
| 16 |
-
howpublished = { \\url{ https://universe.roboflow.com/samuelm0422/sundetection-bwqjs } },
|
| 17 |
-
url = { https://universe.roboflow.com/samuelm0422/sundetection-bwqjs },
|
| 18 |
-
journal = { Roboflow Universe },
|
| 19 |
-
publisher = { Roboflow },
|
| 20 |
-
year = { 2025 },
|
| 21 |
-
month = { apr },
|
| 22 |
-
note = { visited on 2025-04-10 },
|
| 23 |
-
}
|
| 24 |
-
"""
|
| 25 |
-
_CATEGORIES = ['sun']
|
| 26 |
-
_ANNOTATION_FILENAME = "_annotations.coco.json"
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
class SUNDATASETConfig(datasets.BuilderConfig):
|
| 30 |
-
"""Builder Config for SunDataset"""
|
| 31 |
-
|
| 32 |
-
def __init__(self, data_urls, **kwargs):
|
| 33 |
-
"""
|
| 34 |
-
BuilderConfig for SunDataset.
|
| 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(SUNDATASETConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
|
| 41 |
-
self.data_urls = data_urls
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
class SUNDATASET(datasets.GeneratorBasedBuilder):
|
| 45 |
-
"""SunDataset object detection dataset"""
|
| 46 |
-
|
| 47 |
-
VERSION = datasets.Version("1.0.0")
|
| 48 |
-
BUILDER_CONFIGS = [
|
| 49 |
-
SUNDATASETConfig(
|
| 50 |
-
name="full",
|
| 51 |
-
description="Full version of SunDataset dataset.",
|
| 52 |
-
data_urls={
|
| 53 |
-
"train": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/train.zip",
|
| 54 |
-
"validation": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid.zip",
|
| 55 |
-
"test": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/test.zip",
|
| 56 |
-
},
|
| 57 |
-
),
|
| 58 |
-
SUNDATASETConfig(
|
| 59 |
-
name="mini",
|
| 60 |
-
description="Mini version of SunDataset dataset.",
|
| 61 |
-
data_urls={
|
| 62 |
-
"train": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid-mini.zip",
|
| 63 |
-
"validation": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid-mini.zip",
|
| 64 |
-
"test": "https://huggingface.co/datasets/SamuelM0422/SunDataset/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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/test.zip → full/test-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:15ec87b687222d96f7619f169c43eb2e13e698ebc6cb830b0134f19c8f15c175
|
| 3 |
+
size 5481938
|
data/train.zip → full/train-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2118506290571a3d3479c7fd30abd7f1d17bda716c2a582a4aa6e65c7c446fda
|
| 3 |
+
size 108323896
|
data/valid.zip → full/validation-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8a0fbc0d5208b69ec1bb7abc9008ae75578fd0729be7cb463b199490f58e2e8
|
| 3 |
+
size 10672158
|
data/valid-mini.zip → mini/test-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986eb
|
| 3 |
+
size 97647
|
thumbnail.jpg → mini/train-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986eb
|
| 3 |
+
size 97647
|
mini/validation-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986eb
|
| 3 |
+
size 97647
|
split_name_to_num_samples.json
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"valid": 374, "test": 184, "train": 4047}
|
|
|
|
|
|