Convert dataset to Parquet (#1)
Browse files- Convert dataset to Parquet (0dc9f021543c73a7582ee1c5150471abd887274a)
- Add 'mini' config data files (c4ad5352ee44af6da2c4a6473fee0c33b235df8c)
- Delete loading script (7ca6d23eb4aa8a44d9e6c8230e00446dd453f69f)
- Delete data file (b89e6ee933eb523d4fb5e6e22713e3eeaa5545c4)
- Delete data file (5902569970d7466a5e4b9a2abe3524cc92af46b2)
- Delete data file (d65d7a6a87cd740500442294afa318ff5e12252c)
- Delete data file (53c5935ce0946f9a4c983eba7df7ace826186f59)
- Delete data file (71476673f4a586b55ff8140f6badaf52948b746d)
- Delete data file (5d594a540db892f49f8292b961611e30bf0b4d8e)
- Delete data file (282d304f5fec7679182e61ba769da04432ebad4c)
- Delete data file (8c6e318a8bc09200cdb95dd4e85ffb1eca95eda0)
Files changed (11)
- README.dataset.txtDeleted-6
- README.md+90-1
- README.roboflow.txtDeleted-35
- SunDataset.pyDeleted-153
- data/test.zip → full/test-00000-of-00001.parquetRenamed+2-2
- data/train.zip → full/train-00000-of-00001.parquetRenamed+2-2
- data/valid.zip → full/validation-00000-of-00001.parquetRenamed+2-2
- data/valid-mini.zip → mini/test-00000-of-00001.parquetRenamed+2-2
- thumbnail.jpg → mini/train-00000-of-00001.parquetRenamed+2-2
- mini/validation-00000-of-00001.parquetAdded+3
- split_name_to_num_samples.jsonDeleted-1
123456# SunDetection > SunDatasetv1https://universe.roboflow.com/samuelm0422/sundetection-bwqjs
Provided by a Roboflow userLicense: CC BY 4.0
3 unmodified lines456789103 unmodified linestags:- roboflow- roboflow2huggingface---<div align="center">3 unmodified lines4567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798993 unmodified linestags:- roboflow- roboflow2huggingfacedataset_info:- config_name: fullfeatures:- name: image_iddtype: int64- name: imagedtype: image- name: widthdtype: int32- name: heightdtype: int32- name: objectssequence:- name: iddtype: int64- name: areadtype: int64- name: bboxsequence: float32length: 4- name: categorydtype:class_label:names:'0': sunsplits:- name: trainnum_bytes: 116033440.923num_examples: 4047- name: validationnum_bytes: 10697357.0num_examples: 374- name: testnum_bytes: 5486934.0num_examples: 184download_size: 124477992dataset_size: 132217731.923- config_name: minifeatures:- name: image_iddtype: int64- name: imagedtype: image- name: widthdtype: int32- name: heightdtype: int32- name: objectssequence:- name: iddtype: int64- name: areadtype: int64- name: bboxsequence: float32length: 4- name: categorydtype:class_label:names:'0': sunsplits:- name: trainnum_bytes: 92832.0num_examples: 3- name: validationnum_bytes: 92832.0num_examples: 3- name: testnum_bytes: 92832.0num_examples: 3download_size: 292941dataset_size: 278496.0configs:- config_name: fulldata_files:- split: trainpath: full/train-*- split: validationpath: full/validation-*- split: testpath: full/test-*- config_name: minidata_files:- split: trainpath: mini/train-*- split: validationpath: mini/validation-*- split: testpath: mini/test-*---<div align="center">
1234567891011121314151617181920212223242526272829303132333435
SunDetection - v1 SunDatasetv1==============================
This dataset was exported via roboflow.com on April 10, 2025 at 4:19 PM GMT
Roboflow is an end-to-end computer vision platform that helps you* collaborate with your team on computer vision projects* collect & organize images* understand and search unstructured image data* annotate, and create datasets* export, train, and deploy computer vision models* use active learning to improve your dataset over time
For state of the art Computer Vision training notebooks you can use with this dataset,visit https://github.com/roboflow/notebooks
To find over 100k other datasets and pre-trained models, visit https://universe.roboflow.com
The dataset includes 4605 images.Sun-3Qf4-ywwQ-sun are annotated in COCO format.
The following pre-processing was applied to each image:* Auto-orientation of pixel data (with EXIF-orientation stripping)* Resize to 640x640 (Stretch)
The following augmentation was applied to create 3 versions of each source image:* 50% probability of horizontal flip* 50% probability of vertical flip* Randomly crop between 0 and 20 percent of the image* Random rotation of between -15 and +15 degrees* Random shear of between -10° to +10° horizontally and -10° to +10° vertically* Random brigthness adjustment of between -15 and +15 percent
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153import collections
import json
import os
import datasets
_HOMEPAGE = "https://universe.roboflow.com/samuelm0422/sundetection-bwqjs/dataset/1"
_LICENSE = "CC BY 4.0"
_CITATION = """\
@misc{
sundetection-bwqjs_dataset,
title = { SunDetection Dataset },
type = { Open Source Dataset },
author = { SamuelM0422 },
howpublished = { \\url{ https://universe.roboflow.com/samuelm0422/sundetection-bwqjs } },
url = { https://universe.roboflow.com/samuelm0422/sundetection-bwqjs },
journal = { Roboflow Universe },
publisher = { Roboflow },
year = { 2025 },
month = { apr },
note = { visited on 2025-04-10 },
}
"""
_CATEGORIES = ['sun']
_ANNOTATION_FILENAME = "_annotations.coco.json"
class SUNDATASETConfig(datasets.BuilderConfig):
"""Builder Config for SunDataset"""
def __init__(self, data_urls, **kwargs):
"""
BuilderConfig for SunDataset.
Args:
data_urls: `dict`, name to url to download the zip file from.
**kwargs: keyword arguments forwarded to super.
"""
super(SUNDATASETConfig, self).__init__(version=datasets.Version("1.0.0"), **kwargs)
self.data_urls = data_urls
class SUNDATASET(datasets.GeneratorBasedBuilder):
"""SunDataset object detection dataset"""
VERSION = datasets.Version("1.0.0")
BUILDER_CONFIGS = [
SUNDATASETConfig(
name="full",
description="Full version of SunDataset dataset.",
data_urls={
"train": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/train.zip",
"validation": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid.zip",
"test": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/test.zip",
},
),
SUNDATASETConfig(
name="mini",
description="Mini version of SunDataset dataset.",
data_urls={
"train": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid-mini.zip",
"validation": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid-mini.zip",
"test": "https://huggingface.co/datasets/SamuelM0422/SunDataset/resolve/main/data/valid-mini.zip",
},
)
]
def _info(self):
features = datasets.Features(
{
"image_id": datasets.Value("int64"),
"image": datasets.Image(),
"width": datasets.Value("int32"),
"height": datasets.Value("int32"),
"objects": datasets.Sequence(
{
"id": datasets.Value("int64"),
"area": datasets.Value("int64"),
"bbox": datasets.Sequence(datasets.Value("float32"), length=4),
"category": datasets.ClassLabel(names=_CATEGORIES),
}
),
}
)
return datasets.DatasetInfo(
features=features,
homepage=_HOMEPAGE,
citation=_CITATION,
license=_LICENSE,
)
def _split_generators(self, dl_manager):
data_files = dl_manager.download_and_extract(self.config.data_urls)
return [
datasets.SplitGenerator(
name=datasets.Split.TRAIN,
gen_kwargs={
"folder_dir": data_files["train"],
},
),
datasets.SplitGenerator(
name=datasets.Split.VALIDATION,
gen_kwargs={
"folder_dir": data_files["validation"],
},
),
datasets.SplitGenerator(
name=datasets.Split.TEST,
gen_kwargs={
"folder_dir": data_files["test"],
},
),
]
def _generate_examples(self, folder_dir):
def process_annot(annot, category_id_to_category):
return {
"id": annot["id"],
"area": annot["area"],
"bbox": annot["bbox"],
"category": category_id_to_category[annot["category_id"]],
}
image_id_to_image = {}
idx = 0
annotation_filepath = os.path.join(folder_dir, _ANNOTATION_FILENAME)
with open(annotation_filepath, "r") as f:
annotations = json.load(f)
category_id_to_category = {category["id"]: category["name"] for category in annotations["categories"]}
image_id_to_annotations = collections.defaultdict(list)
for annot in annotations["annotations"]:
image_id_to_annotations[annot["image_id"]].append(annot)
filename_to_image = {image["file_name"]: image for image in annotations["images"]}
for filename in os.listdir(folder_dir):
filepath = os.path.join(folder_dir, filename)
if filename in filename_to_image:
image = filename_to_image[filename]
objects = [
process_annot(annot, category_id_to_category) for annot in image_id_to_annotations[image["id"]]
]
with open(filepath, "rb") as f:
image_bytes = f.read()
yield idx, {
"image_id": image["id"],
"image": {"path": filepath, "bytes": image_bytes},
"width": image["width"],
"height": image["height"],
"objects": objects,
}
idx += 1123version https://git-lfs.github.com/spec/v1oid sha256:06951134ac42c63bacfaf9258ea32228a0323ed0cd2175189ebe15ad06448ee4size 5365011123version https://git-lfs.github.com/spec/v1oid sha256:15ec87b687222d96f7619f169c43eb2e13e698ebc6cb830b0134f19c8f15c175size 5481938
123version https://git-lfs.github.com/spec/v1oid sha256:32f325fe0d8e9a6b56c5b4d2c3cdca2d03dcf33a59f3b1d3698e550cb79c23c2size 105690953123version https://git-lfs.github.com/spec/v1oid sha256:2118506290571a3d3479c7fd30abd7f1d17bda716c2a582a4aa6e65c7c446fdasize 108323896
123version https://git-lfs.github.com/spec/v1oid sha256:fc959c85fe2681cfe9fb4479f2ca56faa8fc4c5582ca5f4c62e84600de249eddsize 10432336123version https://git-lfs.github.com/spec/v1oid sha256:f8a0fbc0d5208b69ec1bb7abc9008ae75578fd0729be7cb463b199490f58e2e8size 10672158
123version https://git-lfs.github.com/spec/v1oid sha256:c2ce488419f925e6fd0e2e3d87660ace7bb4754ab6845c1be2e99ceb1b1a16e0size 66357123version https://git-lfs.github.com/spec/v1oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986ebsize 97647
123version https://git-lfs.github.com/spec/v1oid sha256:f73c22f10b7c306d132a852f19f842b1f7acc0d2257c189ac8dea20a673d7c9asize 112685123version https://git-lfs.github.com/spec/v1oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986ebsize 97647
123version https://git-lfs.github.com/spec/v1oid sha256:d86105d162c48bf33525e3800d935f08fa4cf73cd064b56fcb3225a7200986ebsize 976471{"valid": 374, "test": 184, "train": 4047}README.dataset.txtDeleted-6
README.md+90-1
README.roboflow.txtDeleted-35
SunDataset.pyDeleted-153
data/test.zip → full/test-00000-of-00001.parquetRenamed+2-2
data/train.zip → full/train-00000-of-00001.parquetRenamed+2-2
data/valid.zip → full/validation-00000-of-00001.parquetRenamed+2-2
data/valid-mini.zip → mini/test-00000-of-00001.parquetRenamed+2-2
thumbnail.jpg → mini/train-00000-of-00001.parquetRenamed+2-2
mini/validation-00000-of-00001.parquetAdded+3
split_name_to_num_samples.jsonDeleted-1