Delete loading script
Browse files- resisc45.py +0 -108
resisc45.py
DELETED
@@ -1,108 +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 RESISC45(ImageFolder):
|
9 |
-
R"""
|
10 |
-
RESISC45 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(
|
19 |
-
{
|
20 |
-
split: f"data/{split}.zip"
|
21 |
-
for split in ["train", "test"]
|
22 |
-
+ ["contrast", "gaussian_noise", "impulse_noise", "jpeg_compression", "motion_blur", "pixelate", "spatter"]
|
23 |
-
}
|
24 |
-
),
|
25 |
-
)
|
26 |
-
]
|
27 |
-
|
28 |
-
classnames = [
|
29 |
-
"airplane",
|
30 |
-
"airport",
|
31 |
-
"baseball diamond",
|
32 |
-
"basketball court",
|
33 |
-
"beach",
|
34 |
-
"bridge",
|
35 |
-
"chaparral",
|
36 |
-
"church",
|
37 |
-
"circular farmland",
|
38 |
-
"cloud",
|
39 |
-
"commercial area",
|
40 |
-
"dense residential",
|
41 |
-
"desert",
|
42 |
-
"forest",
|
43 |
-
"freeway",
|
44 |
-
"golf course",
|
45 |
-
"ground track field",
|
46 |
-
"harbor",
|
47 |
-
"industrial area",
|
48 |
-
"intersection",
|
49 |
-
"island",
|
50 |
-
"lake",
|
51 |
-
"meadow",
|
52 |
-
"medium residential",
|
53 |
-
"mobile home park",
|
54 |
-
"mountain",
|
55 |
-
"overpass",
|
56 |
-
"palace",
|
57 |
-
"parking lot",
|
58 |
-
"railway",
|
59 |
-
"railway station",
|
60 |
-
"rectangular farmland",
|
61 |
-
"river",
|
62 |
-
"roundabout",
|
63 |
-
"runway",
|
64 |
-
"sea ice",
|
65 |
-
"ship",
|
66 |
-
"snowberg",
|
67 |
-
"sparse residential",
|
68 |
-
"stadium",
|
69 |
-
"storage tank",
|
70 |
-
"tennis court",
|
71 |
-
"terrace",
|
72 |
-
"thermal power station",
|
73 |
-
"wetland",
|
74 |
-
]
|
75 |
-
|
76 |
-
clip_templates = [
|
77 |
-
lambda c: f"satellite imagery of {c}.",
|
78 |
-
lambda c: f"aerial imagery of {c}.",
|
79 |
-
lambda c: f"satellite photo of {c}.",
|
80 |
-
lambda c: f"aerial photo of {c}.",
|
81 |
-
lambda c: f"satellite view of {c}.",
|
82 |
-
lambda c: f"aerial view of {c}.",
|
83 |
-
lambda c: f"satellite imagery of a {c}.",
|
84 |
-
lambda c: f"aerial imagery of a {c}.",
|
85 |
-
lambda c: f"satellite photo of a {c}.",
|
86 |
-
lambda c: f"aerial photo of a {c}.",
|
87 |
-
lambda c: f"satellite view of a {c}.",
|
88 |
-
lambda c: f"aerial view of a {c}.",
|
89 |
-
lambda c: f"satellite imagery of the {c}.",
|
90 |
-
lambda c: f"aerial imagery of the {c}.",
|
91 |
-
lambda c: f"satellite photo of the {c}.",
|
92 |
-
lambda c: f"aerial photo of the {c}.",
|
93 |
-
lambda c: f"satellite view of the {c}.",
|
94 |
-
lambda c: f"aerial view of the {c}.",
|
95 |
-
]
|
96 |
-
|
97 |
-
def _info(self):
|
98 |
-
return datasets.DatasetInfo(
|
99 |
-
description="RESISC45 dataset for image classification.",
|
100 |
-
features=datasets.Features(
|
101 |
-
{
|
102 |
-
"image": datasets.Image(),
|
103 |
-
"label": datasets.ClassLabel(names=self.classnames),
|
104 |
-
}
|
105 |
-
),
|
106 |
-
supervised_keys=("image", "label"),
|
107 |
-
task_templates=[datasets.ImageClassification(image_column="image", label_column="label")],
|
108 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|