Datasets:
Tasks:
Image Classification
Formats:
parquet
Sub-tasks:
multi-label-image-classification
Size:
10K - 100K
License:
Commit ·
1e5291a
1
Parent(s): a8093a9
Update parquet files
Browse files- .gitattributes +0 -41
- .gitignore +0 -5
- Meta.csv +0 -3
- README.md +0 -165
- Test.csv → bazyl--GTSRB/parquet-test.parquet +2 -2
- Train.csv → bazyl--GTSRB/parquet-train.parquet +2 -2
- data/test-00000-of-00001-747a54d4a6461a97.parquet +0 -3
- data/train-00000-of-00001-dc762c064c221993.parquet +0 -3
- dataset_infos.json +0 -3
- dummy/gtsrb/0.0.0/dummy_data.zip +0 -3
- gtsrb.py +0 -201
- requirements.txt +0 -30
.gitattributes
DELETED
|
@@ -1,41 +0,0 @@
|
|
| 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 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
# Audio files - uncompressed
|
| 29 |
-
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
# Audio files - compressed
|
| 33 |
-
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 36 |
-
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 38 |
-
dataset_infos.json filter=lfs diff=lfs merge=lfs -text
|
| 39 |
-
Meta.csv filter=lfs diff=lfs merge=lfs -text
|
| 40 |
-
Test.csv filter=lfs diff=lfs merge=lfs -text
|
| 41 |
-
Train.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.gitignore
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
.env
|
| 2 |
-
test/
|
| 3 |
-
Test/
|
| 4 |
-
train/
|
| 5 |
-
Train/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Meta.csv
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:50b90aed8f9d4f071f841c3f2a92e4fc0378275fb6c7770849ec9f5937fc9cce
|
| 3 |
-
size 1033
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
|
@@ -1,165 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
annotations_creators:
|
| 3 |
-
- crowdsourced
|
| 4 |
-
language_creators:
|
| 5 |
-
- found
|
| 6 |
-
language: []
|
| 7 |
-
license:
|
| 8 |
-
- gpl-3.0
|
| 9 |
-
multilinguality: []
|
| 10 |
-
size_categories:
|
| 11 |
-
- 10K<n<100K
|
| 12 |
-
source_datasets:
|
| 13 |
-
- original
|
| 14 |
-
task_categories:
|
| 15 |
-
- image-classification
|
| 16 |
-
task_ids:
|
| 17 |
-
- multi-label-image-classification
|
| 18 |
-
pretty_name: GTSRB
|
| 19 |
-
---
|
| 20 |
-
|
| 21 |
-
# Dataset Card for GTSRB
|
| 22 |
-
|
| 23 |
-
## Table of Contents
|
| 24 |
-
|
| 25 |
-
- [Dataset Description](#dataset-description)
|
| 26 |
-
- [Dataset Summary](#dataset-summary)
|
| 27 |
-
- [Supported Tasks](#supported-tasks-and-leaderboards)
|
| 28 |
-
- [Languages](#languages)
|
| 29 |
-
- [Dataset Structure](#dataset-structure)
|
| 30 |
-
- [Data Instances](#data-instances)
|
| 31 |
-
- [Data Fields](#data-instances)
|
| 32 |
-
- [Data Splits](#data-instances)
|
| 33 |
-
- [Dataset Creation](#dataset-creation)
|
| 34 |
-
- [Curation Rationale](#curation-rationale)
|
| 35 |
-
- [Source Data](#source-data)
|
| 36 |
-
- [Annotations](#annotations)
|
| 37 |
-
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
| 38 |
-
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
| 39 |
-
- [Social Impact of Dataset](#social-impact-of-dataset)
|
| 40 |
-
- [Discussion of Biases](#discussion-of-biases)
|
| 41 |
-
- [Other Known Limitations](#other-known-limitations)
|
| 42 |
-
- [Additional Information](#additional-information)
|
| 43 |
-
- [Dataset Curators](#dataset-curators)
|
| 44 |
-
- [Licensing Information](#licensing-information)
|
| 45 |
-
- [Citation Information](#citation-information)
|
| 46 |
-
|
| 47 |
-
## Dataset Description
|
| 48 |
-
|
| 49 |
-
- **Homepage:** http://www.sciencedirect.com/science/article/pii/S0893608012000457
|
| 50 |
-
- **Repository:** https://github.com/bazylhorsey/gtsrb/
|
| 51 |
-
- **Paper:** Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition
|
| 52 |
-
- **Leaderboard:** https://benchmark.ini.rub.de/gtsrb_results.html
|
| 53 |
-
- **Point of Contact:** bhorsey16@gmail.com
|
| 54 |
-
|
| 55 |
-
### Dataset Summary
|
| 56 |
-
|
| 57 |
-
The German Traffic Sign Benchmark is a multi-class, single-image classification challenge held at the International Joint Conference on Neural Networks (IJCNN) 2011. We cordially invite researchers from relevant fields to participate: The competition is designed to allow for participation without special domain knowledge. Our benchmark has the following properties:
|
| 58 |
-
|
| 59 |
-
- Single-image, multi-class classification problem
|
| 60 |
-
- More than 40 classes
|
| 61 |
-
- More than 50,000 images in total
|
| 62 |
-
- Large, lifelike database
|
| 63 |
-
|
| 64 |
-
### Supported Tasks and Leaderboards
|
| 65 |
-
|
| 66 |
-
[Kaggle](https://www.kaggle.com/datasets/meowmeowmeowmeowmeow/gtsrb-german-traffic-sign) \
|
| 67 |
-
[Original](https://benchmark.ini.rub.de/gtsrb_results.html)
|
| 68 |
-
|
| 69 |
-
## Dataset Structure
|
| 70 |
-
|
| 71 |
-
### Data Instances
|
| 72 |
-
|
| 73 |
-
```
|
| 74 |
-
{
|
| 75 |
-
"Width": 31,
|
| 76 |
-
"Height": 31,
|
| 77 |
-
"Roi.X1": 6,
|
| 78 |
-
"Roi.Y1": 6,
|
| 79 |
-
"Roi.X2": 26,
|
| 80 |
-
"Roi.Y2": 26,
|
| 81 |
-
"ClassId": 20,
|
| 82 |
-
"Path": "Train/20/00020_00004_00002.png",
|
| 83 |
-
}
|
| 84 |
-
```
|
| 85 |
-
|
| 86 |
-
### Data Fields
|
| 87 |
-
|
| 88 |
-
- Width: width of image
|
| 89 |
-
- Height: Height of image
|
| 90 |
-
- Roi.X1: Upper left X coordinate
|
| 91 |
-
- Roi.Y1: Upper left Y coordinate
|
| 92 |
-
- Roi.X2: Lower right t X coordinate
|
| 93 |
-
- Roi.Y2: Lower right Y coordinate
|
| 94 |
-
- ClassId: Class of image
|
| 95 |
-
- Path: Path of image
|
| 96 |
-
|
| 97 |
-
### Data Splits
|
| 98 |
-
|
| 99 |
-
Categories: 42
|
| 100 |
-
Train: 39209
|
| 101 |
-
Test: 12630
|
| 102 |
-
|
| 103 |
-
## Dataset Creation
|
| 104 |
-
|
| 105 |
-
### Curation Rationale
|
| 106 |
-
|
| 107 |
-
Recognition of traffic signs is a challenging real-world problem of high industrial relevance. Although commercial systems have reached the market and several studies on this topic have been published, systematic unbiased comparisons of different approaches are missing and comprehensive benchmark datasets are not freely available.
|
| 108 |
-
|
| 109 |
-
Traffic sign recognition is a multi-class classification problem with unbalanced class frequencies. Traffic signs can provide a wide range of variations between classes in terms of color, shape, and the presence of pictograms or text. However, there exist subsets of classes (e. g., speed limit signs) that are very similar to each other.
|
| 110 |
-
|
| 111 |
-
The classifier has to cope with large variations in visual appearances due to illumination changes, partial occlusions, rotations, weather conditions, etc.
|
| 112 |
-
|
| 113 |
-
Humans are capable of recognizing the large variety of existing road signs with close to 100% correctness. This does not only apply to real-world driving, which provides both context and multiple views of a single traffic sign, but also to the recognition from single images.
|
| 114 |
-
|
| 115 |
-
<!-- ### Source Data
|
| 116 |
-
|
| 117 |
-
#### Initial Data Collection and Normalization
|
| 118 |
-
|
| 119 |
-
[Needs More Information]
|
| 120 |
-
|
| 121 |
-
#### Who are the source language producers?
|
| 122 |
-
|
| 123 |
-
[Needs More Information]
|
| 124 |
-
|
| 125 |
-
### Annotations
|
| 126 |
-
|
| 127 |
-
#### Annotation process
|
| 128 |
-
|
| 129 |
-
[Needs More Information]
|
| 130 |
-
|
| 131 |
-
#### Who are the annotators?
|
| 132 |
-
|
| 133 |
-
[Needs More Information]
|
| 134 |
-
|
| 135 |
-
### Personal and Sensitive Information
|
| 136 |
-
|
| 137 |
-
[Needs More Information]
|
| 138 |
-
|
| 139 |
-
## Considerations for Using the Data
|
| 140 |
-
|
| 141 |
-
### Social Impact of Dataset
|
| 142 |
-
|
| 143 |
-
[Needs More Information]
|
| 144 |
-
|
| 145 |
-
### Discussion of Biases
|
| 146 |
-
|
| 147 |
-
[Needs More Information]
|
| 148 |
-
|
| 149 |
-
### Other Known Limitations
|
| 150 |
-
|
| 151 |
-
[Needs More Information]
|
| 152 |
-
|
| 153 |
-
## Additional Information
|
| 154 |
-
|
| 155 |
-
### Dataset Curators
|
| 156 |
-
|
| 157 |
-
[Needs More Information]
|
| 158 |
-
|
| 159 |
-
### Licensing Information
|
| 160 |
-
|
| 161 |
-
[Needs More Information]
|
| 162 |
-
|
| 163 |
-
### Citation Information
|
| 164 |
-
|
| 165 |
-
[Needs More Information] -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Test.csv → bazyl--GTSRB/parquet-test.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:8e0317669ab8a41173d0a29778c3fbc86ca1384c726beb0d51c6dc5851922a79
|
| 3 |
+
size 76273240
|
Train.csv → bazyl--GTSRB/parquet-train.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:707df6c8c1fe395eb19eb63b21a8a601fc96a3e41d96dc23b8d142f66df2cfdb
|
| 3 |
+
size 236366849
|
data/test-00000-of-00001-747a54d4a6461a97.parquet
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:979ca6fe6db32b8f2721181c1cbc58417f2dd175fe28b0e1b8a0d3d32a718e46
|
| 3 |
-
size 76188823
|
|
|
|
|
|
|
|
|
|
|
|
data/train-00000-of-00001-dc762c064c221993.parquet
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:6fbb17c156897e8d852e1a7a8304381dbc0d26cc628fdb46fa5bb2f457e7d588
|
| 3 |
-
size 236068919
|
|
|
|
|
|
|
|
|
|
|
|
dataset_infos.json
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ed227f6d23108ae82e3d53e1f27aa23183c456f6d8dc50fc40e843dd7701ea0a
|
| 3 |
-
size 3456
|
|
|
|
|
|
|
|
|
|
|
|
dummy/gtsrb/0.0.0/dummy_data.zip
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:61cb8c9824a59a6fa68b29f6fcaa85103f1bb90f34a984fe901bce78a3292773
|
| 3 |
-
size 120
|
|
|
|
|
|
|
|
|
|
|
|
gtsrb.py
DELETED
|
@@ -1,201 +0,0 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
| 3 |
-
#
|
| 4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
-
# you may not use this file except in compliance with the License.
|
| 6 |
-
# You may obtain a copy of the License at
|
| 7 |
-
#
|
| 8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
-
#
|
| 10 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
-
# See the License for the specific language governing permissions and
|
| 14 |
-
# limitations under the License.
|
| 15 |
-
|
| 16 |
-
# Lint as: python3
|
| 17 |
-
"""GTSRB: German Traffic Sign Recognition Benchmark."""
|
| 18 |
-
import csv
|
| 19 |
-
|
| 20 |
-
import datasets
|
| 21 |
-
from datasets import Dataset, DatasetDict
|
| 22 |
-
|
| 23 |
-
import os
|
| 24 |
-
from datasets.tasks import ImageClassification
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
logger = datasets.logging.get_logger(__name__)
|
| 28 |
-
|
| 29 |
-
# df_train = pd.read_csv('Test.csv')
|
| 30 |
-
# df_test = pd.read_csv('Train.csv')
|
| 31 |
-
|
| 32 |
-
# train = Dataset.from_pandas(df_train)
|
| 33 |
-
# test = Dataset.from_pandas(df_test)
|
| 34 |
-
|
| 35 |
-
# dataset = DatasetDict()
|
| 36 |
-
|
| 37 |
-
# dataset['train'] = train
|
| 38 |
-
# dataset['test'] = test
|
| 39 |
-
|
| 40 |
-
_CITATION = """\
|
| 41 |
-
@article
|
| 42 |
-
{
|
| 43 |
-
Stallkamp2012,
|
| 44 |
-
title = "Man vs. computer: Benchmarking machine learning algorithms for traffic sign recognition",
|
| 45 |
-
journal = "Neural Networks",
|
| 46 |
-
volume = "",
|
| 47 |
-
number = "0",
|
| 48 |
-
pages = " - ",
|
| 49 |
-
year = "2012",
|
| 50 |
-
note = "",
|
| 51 |
-
issn = "0893-6080",
|
| 52 |
-
doi = "10.1016/j.neunet.2012.02.016",
|
| 53 |
-
url = "http://www.sciencedirect.com/science/article/pii/S0893608012000457",
|
| 54 |
-
author = "J. Stallkamp and M. Schlipsing and J. Salmen and C. Igel",
|
| 55 |
-
keywords = "Traffic sign recognition",
|
| 56 |
-
keywords = "Machine learning",
|
| 57 |
-
keywords = "Convolutional neural networks",
|
| 58 |
-
keywords = "Benchmarking"
|
| 59 |
-
}
|
| 60 |
-
"""
|
| 61 |
-
|
| 62 |
-
_DESCRIPTION = """\
|
| 63 |
-
Recognition of traffic signs is a challenging real-world problem of high industrial relevance. Although commercial systems have reached the market and several studies on this topic have been published, systematic unbiased comparisons of different approaches are missing and comprehensive benchmark datasets are not freely available. \
|
| 64 |
-
Traffic sign recognition is a multi-class classification problem with unbalanced class frequencies. Traffic signs can provide a wide range of variations between classes in terms of color, shape, and the presence of pictograms or text. However, there exist subsets of classes (e. g., speed limit signs) that are very similar to each other. \
|
| 65 |
-
The classifier has to cope with large variations in visual appearances due to illumination changes, partial occlusions, rotations, weather conditions, etc. \
|
| 66 |
-
Humans are capable of recognizing the large variety of existing road signs with close to 100% correctness. This does not only apply to real-world driving, which provides both context and multiple views of a single traffic sign, but also to the recognition from single images.
|
| 67 |
-
"""
|
| 68 |
-
|
| 69 |
-
_FEATURES = datasets.Features({
|
| 70 |
-
"Width": datasets.Value("uint16"),
|
| 71 |
-
"Height": datasets.Value("uint8"),
|
| 72 |
-
"Roi.X1": datasets.Value("uint8"),
|
| 73 |
-
"Roi.Y1": datasets.Value("uint8"),
|
| 74 |
-
"Roi.X2": datasets.Value("uint8"),
|
| 75 |
-
"Roi.Y2": datasets.Value("uint8"),
|
| 76 |
-
"ClassId": datasets.ClassLabel(num_classes=43),
|
| 77 |
-
"Path": datasets.Image("png"),
|
| 78 |
-
# "Path": datasets.Value("string"),
|
| 79 |
-
})
|
| 80 |
-
|
| 81 |
-
_IMAGES_DIR = "GTSRB/Images"
|
| 82 |
-
|
| 83 |
-
_URL = "https://github.com/bazylhorsey/gtsrb/archive/refs/tags/0.0.0.tar.gz"
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
# importing the "tarfile" module
|
| 87 |
-
|
| 88 |
-
# open file
|
| 89 |
-
# file = tarfile.open("https://github.com/bazylhorsey/gtsrb/archive/refs/tags/0.0.0.tar.gz")
|
| 90 |
-
# file.extractall('temp')
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
class GTSRBConfig(datasets.BuilderConfig):
|
| 94 |
-
"""BuilderConfig for GTSRB."""
|
| 95 |
-
|
| 96 |
-
def __init__(self, **kwargs):
|
| 97 |
-
"""BuilderConfig for GTSRB.
|
| 98 |
-
Args:
|
| 99 |
-
**kwargs: keyword arguments forwarded to super.
|
| 100 |
-
"""
|
| 101 |
-
super(GTSRBConfig, self).__init__(**kwargs)
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
class GTSRB(datasets.GeneratorBasedBuilder):
|
| 105 |
-
"""GTSRB: German Traffic Sign Recognition Benchmark."""
|
| 106 |
-
|
| 107 |
-
BUILDER_CONFIGS = [
|
| 108 |
-
GTSRBConfig(
|
| 109 |
-
name="gtsrb",
|
| 110 |
-
version=datasets.Version("0.0.0", ""),
|
| 111 |
-
description="GTSRB: German Traffic Sign Recognition Benchmark.",
|
| 112 |
-
),
|
| 113 |
-
]
|
| 114 |
-
|
| 115 |
-
def _info(self):
|
| 116 |
-
return datasets.DatasetInfo(
|
| 117 |
-
description=_DESCRIPTION,
|
| 118 |
-
features=_FEATURES,
|
| 119 |
-
# No default supervised_keys (as we have to pass both question
|
| 120 |
-
# and context as input).
|
| 121 |
-
supervised_keys=["ClassId"],
|
| 122 |
-
homepage="https://benchmark.ini.rub.de/gtsrb_news.html",
|
| 123 |
-
citation=_CITATION,
|
| 124 |
-
license="gnu public license",
|
| 125 |
-
task_templates=[ImageClassification(image_column="Path", label_column="ClassId")],
|
| 126 |
-
|
| 127 |
-
)
|
| 128 |
-
|
| 129 |
-
def _split_generators(self, dl_manager):
|
| 130 |
-
archive_path = dl_manager.download(_URL)
|
| 131 |
-
|
| 132 |
-
return [
|
| 133 |
-
datasets.SplitGenerator(
|
| 134 |
-
name=datasets.Split.TRAIN,
|
| 135 |
-
gen_kwargs={
|
| 136 |
-
"filepath": "Train.csv",
|
| 137 |
-
"images": dl_manager.startswith("GTSRB/Train/").iter_archive(archive_path),
|
| 138 |
-
},
|
| 139 |
-
),
|
| 140 |
-
datasets.SplitGenerator(
|
| 141 |
-
name=datasets.Split.TEST,
|
| 142 |
-
gen_kwargs={
|
| 143 |
-
"filepath": "Test.csv",
|
| 144 |
-
"images": dl_manager.startswith("GTSRB/Test/").iter_archive(archive_path),
|
| 145 |
-
}
|
| 146 |
-
),
|
| 147 |
-
]
|
| 148 |
-
|
| 149 |
-
def _generate_examples(self, images, filepath):
|
| 150 |
-
"""This function returns the examples in the raw (text) form."""
|
| 151 |
-
# logger.info("generating examples from = %s", filepath)
|
| 152 |
-
# key = 0
|
| 153 |
-
# with open(filepath, encoding="utf-8") as f:
|
| 154 |
-
# GTSRB = csv.reader(f)
|
| 155 |
-
# for article in GTSRB["data"]:
|
| 156 |
-
# title = article.get("title", "")
|
| 157 |
-
# for paragraph in article["paragraphs"]:
|
| 158 |
-
# context = paragraph["context"] # do not strip leading blank spaces GH-2585
|
| 159 |
-
# for qa in paragraph["qas"]:
|
| 160 |
-
# answer_starts = [answer["answer_start"] for answer in qa["answers"]]
|
| 161 |
-
# answers = [answer["text"] for answer in qa["answers"]]
|
| 162 |
-
# # Features currently used are "context", "question", and "answers".
|
| 163 |
-
# # Others are extracted here for the ease of future expansions.
|
| 164 |
-
# yield key, {
|
| 165 |
-
# "title": title,
|
| 166 |
-
# "context": context,
|
| 167 |
-
# "question": qa["question"],
|
| 168 |
-
# "id": qa["id"],
|
| 169 |
-
# "answers": {
|
| 170 |
-
# "answer_start": answer_starts,
|
| 171 |
-
# "text": answers,
|
| 172 |
-
# },
|
| 173 |
-
# }
|
| 174 |
-
# key += 1
|
| 175 |
-
# with open(filepath, encoding="utf-8") as f:
|
| 176 |
-
# reader = csv.reader(f)
|
| 177 |
-
# for id_, row in enumerate(reader):
|
| 178 |
-
# if id_ == 0:
|
| 179 |
-
# continue
|
| 180 |
-
# yield id_, {
|
| 181 |
-
# "Width": int(row[0]),
|
| 182 |
-
# "Height": int(row[1]),
|
| 183 |
-
# "Roi.X1": int(row[2]),
|
| 184 |
-
# "Roi.Y1": int(row[3]),
|
| 185 |
-
# "Roi.X2": int(row[4]),
|
| 186 |
-
# "Roi.Y2": int(row[5]),
|
| 187 |
-
# "ClassId": int(row[6]),
|
| 188 |
-
# "Path": str(row[7]),
|
| 189 |
-
# }
|
| 190 |
-
|
| 191 |
-
with open(filepath, encoding="utf-8") as f:
|
| 192 |
-
files_to_keep = set(f.read().split("\n"))
|
| 193 |
-
for file_path, file_obj in images:
|
| 194 |
-
print(file_path, file_obj)
|
| 195 |
-
if file_path.startswith(_IMAGES_DIR):
|
| 196 |
-
if file_path[len(_IMAGES_DIR) : -len(".jpg")] in files_to_keep:
|
| 197 |
-
label = file_path.split("/")[2]
|
| 198 |
-
yield file_path, {
|
| 199 |
-
"image": {"path": file_path, "bytes": file_obj.read()},
|
| 200 |
-
"label": label,
|
| 201 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
aiohttp==3.8.1
|
| 2 |
-
aiosignal==1.2.0
|
| 3 |
-
async-timeout==4.0.2
|
| 4 |
-
certifi==2022.6.15
|
| 5 |
-
charset-normalizer==2.0.12
|
| 6 |
-
datasets==2.3.2
|
| 7 |
-
dill==0.3.5.1
|
| 8 |
-
filelock==3.7.1
|
| 9 |
-
frozenlist==1.3.0
|
| 10 |
-
fsspec==2022.5.0
|
| 11 |
-
huggingface-hub==0.8.1
|
| 12 |
-
idna==3.3
|
| 13 |
-
multidict==6.0.2
|
| 14 |
-
multiprocess==0.70.13
|
| 15 |
-
numpy==1.23.0
|
| 16 |
-
packaging==21.3
|
| 17 |
-
pandas==1.4.3
|
| 18 |
-
pyaml==21.10.1
|
| 19 |
-
pyarrow==8.0.0
|
| 20 |
-
pyparsing==3.0.9
|
| 21 |
-
PyYAML==6.0
|
| 22 |
-
requests==2.28.0
|
| 23 |
-
responses==0.18.0
|
| 24 |
-
tqdm==4.64.0
|
| 25 |
-
typing_extensions==4.2.0
|
| 26 |
-
urllib3==1.26.9
|
| 27 |
-
xxhash==3.0.0
|
| 28 |
-
yarl==1.7.2
|
| 29 |
-
|
| 30 |
-
--extra-index-url=https://packagecloud.io/github/git-lfs/pypi/simple
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|