Delete loading script
Browse files
dtd.py
DELETED
|
@@ -1,94 +0,0 @@
|
|
| 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 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|