Upload folder using huggingface_hub
Browse files- README.md +95 -0
- data/test.zip +3 -0
- data/train.zip +3 -0
- dtd.py +94 -0
README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
features:
|
| 4 |
+
- name: image
|
| 5 |
+
dtype: image
|
| 6 |
+
- name: label
|
| 7 |
+
dtype:
|
| 8 |
+
class_label:
|
| 9 |
+
names:
|
| 10 |
+
'0': banded
|
| 11 |
+
'1': blotchy
|
| 12 |
+
'2': braided
|
| 13 |
+
'3': bubbly
|
| 14 |
+
'4': bumpy
|
| 15 |
+
'5': chequered
|
| 16 |
+
'6': cobwebbed
|
| 17 |
+
'7': cracked
|
| 18 |
+
'8': crosshatched
|
| 19 |
+
'9': crystalline
|
| 20 |
+
'10': dotted
|
| 21 |
+
'11': fibrous
|
| 22 |
+
'12': flecked
|
| 23 |
+
'13': freckled
|
| 24 |
+
'14': frilly
|
| 25 |
+
'15': gauzy
|
| 26 |
+
'16': grid
|
| 27 |
+
'17': grooved
|
| 28 |
+
'18': honeycombed
|
| 29 |
+
'19': interlaced
|
| 30 |
+
'20': knitted
|
| 31 |
+
'21': lacelike
|
| 32 |
+
'22': lined
|
| 33 |
+
'23': marbled
|
| 34 |
+
'24': matted
|
| 35 |
+
'25': meshed
|
| 36 |
+
'26': paisley
|
| 37 |
+
'27': perforated
|
| 38 |
+
'28': pitted
|
| 39 |
+
'29': pleated
|
| 40 |
+
'30': polka-dotted
|
| 41 |
+
'31': porous
|
| 42 |
+
'32': potholed
|
| 43 |
+
'33': scaly
|
| 44 |
+
'34': smeared
|
| 45 |
+
'35': spiralled
|
| 46 |
+
'36': sprinkled
|
| 47 |
+
'37': stained
|
| 48 |
+
'38': stratified
|
| 49 |
+
'39': striped
|
| 50 |
+
'40': studded
|
| 51 |
+
'41': swirly
|
| 52 |
+
'42': veined
|
| 53 |
+
'43': waffled
|
| 54 |
+
'44': woven
|
| 55 |
+
'45': wrinkled
|
| 56 |
+
'46': zigzagged
|
| 57 |
+
splits:
|
| 58 |
+
- name: train
|
| 59 |
+
num_bytes: 448550
|
| 60 |
+
num_examples: 3760
|
| 61 |
+
- name: test
|
| 62 |
+
num_bytes: 220515
|
| 63 |
+
num_examples: 1880
|
| 64 |
+
download_size: 625712354
|
| 65 |
+
dataset_size: 669065
|
| 66 |
+
---
|
| 67 |
+
|
| 68 |
+
# [DTD: Describable Textures Dataset](https://www.robots.ox.ac.uk/~vgg/data/dtd/)
|
| 69 |
+
|
| 70 |
+
The Describable Textures Dataset (DTD) is an evolving collection of textural images in the wild, annotated with a series of human-centric attributes, inspired by the perceptual properties of textures.
|
| 71 |
+
This data is made available to the computer vision community for research purposes
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from datasets import load_dataset
|
| 77 |
+
|
| 78 |
+
dataset = load_dataset('tanganke/dtd')
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
- **Features:**
|
| 82 |
+
- **Image**: The primary data type, which is a digital image used for classification. The format and dimensions of the images are not specified in this snippet but should be included if available.
|
| 83 |
+
- **Label**: A categorical feature representing the texture or pattern class of each image. The dataset includes 46 classes with descriptive names ranging from 'banded' to 'zigzagged'.
|
| 84 |
+
- **Class Labels**:
|
| 85 |
+
- '0': banded
|
| 86 |
+
- '1': blotchy
|
| 87 |
+
- '2': braided
|
| 88 |
+
- ...
|
| 89 |
+
- '45': wrinkled
|
| 90 |
+
- '46': zigzagged
|
| 91 |
+
|
| 92 |
+
- **Splits**: The dataset is divided into training and test subsets for model evaluation.
|
| 93 |
+
- **Training**: containing 3760 examples with a total size of 448,550 bytes.
|
| 94 |
+
- **Test**: containing 1880 examples with a total size of 220,515 bytes.
|
| 95 |
+
|
data/test.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:173d40121e4f4ee90e09e5082ab76e124355297b3b72670aec49463115c953bd
|
| 3 |
+
size 177943979
|
data/train.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81bc25a565bf38343376b04f55d1fd81c0e03fb5a2005734d3c06d16ef99ade2
|
| 3 |
+
size 447768375
|
dtd.py
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import datasets
|
| 2 |
+
from datasets.data_files import DataFilesDict
|
| 3 |
+
from datasets.packaged_modules.imagefolder.imagefolder import ImageFolder, ImageFolderConfig
|
| 4 |
+
|
| 5 |
+
logger = datasets.logging.get_logger(__name__)
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
class GTSRB(ImageFolder):
|
| 9 |
+
R"""
|
| 10 |
+
DTD dataset for image classification.
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
BUILDER_CONFIG_CLASS = ImageFolderConfig
|
| 14 |
+
BUILDER_CONFIGS = [
|
| 15 |
+
ImageFolderConfig(
|
| 16 |
+
name="default",
|
| 17 |
+
features=("images", "labels"),
|
| 18 |
+
data_files=DataFilesDict({split: f"data/{split}.zip" for split in ["train", "test"]}),
|
| 19 |
+
)
|
| 20 |
+
]
|
| 21 |
+
|
| 22 |
+
classnames = [
|
| 23 |
+
"banded",
|
| 24 |
+
"blotchy",
|
| 25 |
+
"braided",
|
| 26 |
+
"bubbly",
|
| 27 |
+
"bumpy",
|
| 28 |
+
"chequered",
|
| 29 |
+
"cobwebbed",
|
| 30 |
+
"cracked",
|
| 31 |
+
"crosshatched",
|
| 32 |
+
"crystalline",
|
| 33 |
+
"dotted",
|
| 34 |
+
"fibrous",
|
| 35 |
+
"flecked",
|
| 36 |
+
"freckled",
|
| 37 |
+
"frilly",
|
| 38 |
+
"gauzy",
|
| 39 |
+
"grid",
|
| 40 |
+
"grooved",
|
| 41 |
+
"honeycombed",
|
| 42 |
+
"interlaced",
|
| 43 |
+
"knitted",
|
| 44 |
+
"lacelike",
|
| 45 |
+
"lined",
|
| 46 |
+
"marbled",
|
| 47 |
+
"matted",
|
| 48 |
+
"meshed",
|
| 49 |
+
"paisley",
|
| 50 |
+
"perforated",
|
| 51 |
+
"pitted",
|
| 52 |
+
"pleated",
|
| 53 |
+
"polka-dotted",
|
| 54 |
+
"porous",
|
| 55 |
+
"potholed",
|
| 56 |
+
"scaly",
|
| 57 |
+
"smeared",
|
| 58 |
+
"spiralled",
|
| 59 |
+
"sprinkled",
|
| 60 |
+
"stained",
|
| 61 |
+
"stratified",
|
| 62 |
+
"striped",
|
| 63 |
+
"studded",
|
| 64 |
+
"swirly",
|
| 65 |
+
"veined",
|
| 66 |
+
"waffled",
|
| 67 |
+
"woven",
|
| 68 |
+
"wrinkled",
|
| 69 |
+
"zigzagged",
|
| 70 |
+
]
|
| 71 |
+
|
| 72 |
+
clip_templates = [
|
| 73 |
+
lambda c: f"a photo of a {c} texture.",
|
| 74 |
+
lambda c: f"a photo of a {c} pattern.",
|
| 75 |
+
lambda c: f"a photo of a {c} thing.",
|
| 76 |
+
lambda c: f"a photo of a {c} object.",
|
| 77 |
+
lambda c: f"a photo of the {c} texture.",
|
| 78 |
+
lambda c: f"a photo of the {c} pattern.",
|
| 79 |
+
lambda c: f"a photo of the {c} thing.",
|
| 80 |
+
lambda c: f"a photo of the {c} object.",
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
+
def _info(self):
|
| 84 |
+
return datasets.DatasetInfo(
|
| 85 |
+
description="DTD dataset for image classification.",
|
| 86 |
+
features=datasets.Features(
|
| 87 |
+
{
|
| 88 |
+
"image": datasets.Image(),
|
| 89 |
+
"label": datasets.ClassLabel(names=self.classnames),
|
| 90 |
+
}
|
| 91 |
+
),
|
| 92 |
+
supervised_keys=("image", "label"),
|
| 93 |
+
task_templates=[datasets.ImageClassification(image_column="image", label_column="label")],
|
| 94 |
+
)
|