Datasets:
Delete loading script
Browse files- stanford_cars.py +0 -249
stanford_cars.py
DELETED
@@ -1,249 +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 StanfordCars(ImageFolder):
|
9 |
-
R"""
|
10 |
-
StanfordCars 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 |
-
"AM General Hummer SUV 2000",
|
30 |
-
"Acura RL Sedan 2012",
|
31 |
-
"Acura TL Sedan 2012",
|
32 |
-
"Acura TL Type-S 2008",
|
33 |
-
"Acura TSX Sedan 2012",
|
34 |
-
"Acura Integra Type R 2001",
|
35 |
-
"Acura ZDX Hatchback 2012",
|
36 |
-
"Aston Martin V8 Vantage Convertible 2012",
|
37 |
-
"Aston Martin V8 Vantage Coupe 2012",
|
38 |
-
"Aston Martin Virage Convertible 2012",
|
39 |
-
"Aston Martin Virage Coupe 2012",
|
40 |
-
"Audi RS 4 Convertible 2008",
|
41 |
-
"Audi A5 Coupe 2012",
|
42 |
-
"Audi TTS Coupe 2012",
|
43 |
-
"Audi R8 Coupe 2012",
|
44 |
-
"Audi V8 Sedan 1994",
|
45 |
-
"Audi 100 Sedan 1994",
|
46 |
-
"Audi 100 Wagon 1994",
|
47 |
-
"Audi TT Hatchback 2011",
|
48 |
-
"Audi S6 Sedan 2011",
|
49 |
-
"Audi S5 Convertible 2012",
|
50 |
-
"Audi S5 Coupe 2012",
|
51 |
-
"Audi S4 Sedan 2012",
|
52 |
-
"Audi S4 Sedan 2007",
|
53 |
-
"Audi TT RS Coupe 2012",
|
54 |
-
"BMW ActiveHybrid 5 Sedan 2012",
|
55 |
-
"BMW 1 Series Convertible 2012",
|
56 |
-
"BMW 1 Series Coupe 2012",
|
57 |
-
"BMW 3 Series Sedan 2012",
|
58 |
-
"BMW 3 Series Wagon 2012",
|
59 |
-
"BMW 6 Series Convertible 2007",
|
60 |
-
"BMW X5 SUV 2007",
|
61 |
-
"BMW X6 SUV 2012",
|
62 |
-
"BMW M3 Coupe 2012",
|
63 |
-
"BMW M5 Sedan 2010",
|
64 |
-
"BMW M6 Convertible 2010",
|
65 |
-
"BMW X3 SUV 2012",
|
66 |
-
"BMW Z4 Convertible 2012",
|
67 |
-
"Bentley Continental Supersports Conv. Convertible 2012",
|
68 |
-
"Bentley Arnage Sedan 2009",
|
69 |
-
"Bentley Mulsanne Sedan 2011",
|
70 |
-
"Bentley Continental GT Coupe 2012",
|
71 |
-
"Bentley Continental GT Coupe 2007",
|
72 |
-
"Bentley Continental Flying Spur Sedan 2007",
|
73 |
-
"Bugatti Veyron 16.4 Convertible 2009",
|
74 |
-
"Bugatti Veyron 16.4 Coupe 2009",
|
75 |
-
"Buick Regal GS 2012",
|
76 |
-
"Buick Rainier SUV 2007",
|
77 |
-
"Buick Verano Sedan 2012",
|
78 |
-
"Buick Enclave SUV 2012",
|
79 |
-
"Cadillac CTS-V Sedan 2012",
|
80 |
-
"Cadillac SRX SUV 2012",
|
81 |
-
"Cadillac Escalade EXT Crew Cab 2007",
|
82 |
-
"Chevrolet Silverado 1500 Hybrid Crew Cab 2012",
|
83 |
-
"Chevrolet Corvette Convertible 2012",
|
84 |
-
"Chevrolet Corvette ZR1 2012",
|
85 |
-
"Chevrolet Corvette Ron Fellows Edition Z06 2007",
|
86 |
-
"Chevrolet Traverse SUV 2012",
|
87 |
-
"Chevrolet Camaro Convertible 2012",
|
88 |
-
"Chevrolet HHR SS 2010",
|
89 |
-
"Chevrolet Impala Sedan 2007",
|
90 |
-
"Chevrolet Tahoe Hybrid SUV 2012",
|
91 |
-
"Chevrolet Sonic Sedan 2012",
|
92 |
-
"Chevrolet Express Cargo Van 2007",
|
93 |
-
"Chevrolet Avalanche Crew Cab 2012",
|
94 |
-
"Chevrolet Cobalt SS 2010",
|
95 |
-
"Chevrolet Malibu Hybrid Sedan 2010",
|
96 |
-
"Chevrolet TrailBlazer SS 2009",
|
97 |
-
"Chevrolet Silverado 2500HD Regular Cab 2012",
|
98 |
-
"Chevrolet Silverado 1500 Classic Extended Cab 2007",
|
99 |
-
"Chevrolet Express Van 2007",
|
100 |
-
"Chevrolet Monte Carlo Coupe 2007",
|
101 |
-
"Chevrolet Malibu Sedan 2007",
|
102 |
-
"Chevrolet Silverado 1500 Extended Cab 2012",
|
103 |
-
"Chevrolet Silverado 1500 Regular Cab 2012",
|
104 |
-
"Chrysler Aspen SUV 2009",
|
105 |
-
"Chrysler Sebring Convertible 2010",
|
106 |
-
"Chrysler Town and Country Minivan 2012",
|
107 |
-
"Chrysler 300 SRT-8 2010",
|
108 |
-
"Chrysler Crossfire Convertible 2008",
|
109 |
-
"Chrysler PT Cruiser Convertible 2008",
|
110 |
-
"Daewoo Nubira Wagon 2002",
|
111 |
-
"Dodge Caliber Wagon 2012",
|
112 |
-
"Dodge Caliber Wagon 2007",
|
113 |
-
"Dodge Caravan Minivan 1997",
|
114 |
-
"Dodge Ram Pickup 3500 Crew Cab 2010",
|
115 |
-
"Dodge Ram Pickup 3500 Quad Cab 2009",
|
116 |
-
"Dodge Sprinter Cargo Van 2009",
|
117 |
-
"Dodge Journey SUV 2012",
|
118 |
-
"Dodge Dakota Crew Cab 2010",
|
119 |
-
"Dodge Dakota Club Cab 2007",
|
120 |
-
"Dodge Magnum Wagon 2008",
|
121 |
-
"Dodge Challenger SRT8 2011",
|
122 |
-
"Dodge Durango SUV 2012",
|
123 |
-
"Dodge Durango SUV 2007",
|
124 |
-
"Dodge Charger Sedan 2012",
|
125 |
-
"Dodge Charger SRT-8 2009",
|
126 |
-
"Eagle Talon Hatchback 1998",
|
127 |
-
"FIAT 500 Abarth 2012",
|
128 |
-
"FIAT 500 Convertible 2012",
|
129 |
-
"Ferrari FF Coupe 2012",
|
130 |
-
"Ferrari California Convertible 2012",
|
131 |
-
"Ferrari 458 Italia Convertible 2012",
|
132 |
-
"Ferrari 458 Italia Coupe 2012",
|
133 |
-
"Fisker Karma Sedan 2012",
|
134 |
-
"Ford F-450 Super Duty Crew Cab 2012",
|
135 |
-
"Ford Mustang Convertible 2007",
|
136 |
-
"Ford Freestar Minivan 2007",
|
137 |
-
"Ford Expedition EL SUV 2009",
|
138 |
-
"Ford Edge SUV 2012",
|
139 |
-
"Ford Ranger SuperCab 2011",
|
140 |
-
"Ford GT Coupe 2006",
|
141 |
-
"Ford F-150 Regular Cab 2012",
|
142 |
-
"Ford F-150 Regular Cab 2007",
|
143 |
-
"Ford Focus Sedan 2007",
|
144 |
-
"Ford E-Series Wagon Van 2012",
|
145 |
-
"Ford Fiesta Sedan 2012",
|
146 |
-
"GMC Terrain SUV 2012",
|
147 |
-
"GMC Savana Van 2012",
|
148 |
-
"GMC Yukon Hybrid SUV 2012",
|
149 |
-
"GMC Acadia SUV 2012",
|
150 |
-
"GMC Canyon Extended Cab 2012",
|
151 |
-
"Geo Metro Convertible 1993",
|
152 |
-
"HUMMER H3T Crew Cab 2010",
|
153 |
-
"HUMMER H2 SUT Crew Cab 2009",
|
154 |
-
"Honda Odyssey Minivan 2012",
|
155 |
-
"Honda Odyssey Minivan 2007",
|
156 |
-
"Honda Accord Coupe 2012",
|
157 |
-
"Honda Accord Sedan 2012",
|
158 |
-
"Hyundai Veloster Hatchback 2012",
|
159 |
-
"Hyundai Santa Fe SUV 2012",
|
160 |
-
"Hyundai Tucson SUV 2012",
|
161 |
-
"Hyundai Veracruz SUV 2012",
|
162 |
-
"Hyundai Sonata Hybrid Sedan 2012",
|
163 |
-
"Hyundai Elantra Sedan 2007",
|
164 |
-
"Hyundai Accent Sedan 2012",
|
165 |
-
"Hyundai Genesis Sedan 2012",
|
166 |
-
"Hyundai Sonata Sedan 2012",
|
167 |
-
"Hyundai Elantra Touring Hatchback 2012",
|
168 |
-
"Hyundai Azera Sedan 2012",
|
169 |
-
"Infiniti G Coupe IPL 2012",
|
170 |
-
"Infiniti QX56 SUV 2011",
|
171 |
-
"Isuzu Ascender SUV 2008",
|
172 |
-
"Jaguar XK XKR 2012",
|
173 |
-
"Jeep Patriot SUV 2012",
|
174 |
-
"Jeep Wrangler SUV 2012",
|
175 |
-
"Jeep Liberty SUV 2012",
|
176 |
-
"Jeep Grand Cherokee SUV 2012",
|
177 |
-
"Jeep Compass SUV 2012",
|
178 |
-
"Lamborghini Reventon Coupe 2008",
|
179 |
-
"Lamborghini Aventador Coupe 2012",
|
180 |
-
"Lamborghini Gallardo LP 570-4 Superleggera 2012",
|
181 |
-
"Lamborghini Diablo Coupe 2001",
|
182 |
-
"Land Rover Range Rover SUV 2012",
|
183 |
-
"Land Rover LR2 SUV 2012",
|
184 |
-
"Lincoln Town Car Sedan 2011",
|
185 |
-
"MINI Cooper Roadster Convertible 2012",
|
186 |
-
"Maybach Landaulet Convertible 2012",
|
187 |
-
"Mazda Tribute SUV 2011",
|
188 |
-
"McLaren MP4-12C Coupe 2012",
|
189 |
-
"Mercedes-Benz 300-Class Convertible 1993",
|
190 |
-
"Mercedes-Benz C-Class Sedan 2012",
|
191 |
-
"Mercedes-Benz SL-Class Coupe 2009",
|
192 |
-
"Mercedes-Benz E-Class Sedan 2012",
|
193 |
-
"Mercedes-Benz S-Class Sedan 2012",
|
194 |
-
"Mercedes-Benz Sprinter Van 2012",
|
195 |
-
"Mitsubishi Lancer Sedan 2012",
|
196 |
-
"Nissan Leaf Hatchback 2012",
|
197 |
-
"Nissan NV Passenger Van 2012",
|
198 |
-
"Nissan Juke Hatchback 2012",
|
199 |
-
"Nissan 240SX Coupe 1998",
|
200 |
-
"Plymouth Neon Coupe 1999",
|
201 |
-
"Porsche Panamera Sedan 2012",
|
202 |
-
"Ram C/V Cargo Van Minivan 2012",
|
203 |
-
"Rolls-Royce Phantom Drophead Coupe Convertible 2012",
|
204 |
-
"Rolls-Royce Ghost Sedan 2012",
|
205 |
-
"Rolls-Royce Phantom Sedan 2012",
|
206 |
-
"Scion xD Hatchback 2012",
|
207 |
-
"Spyker C8 Convertible 2009",
|
208 |
-
"Spyker C8 Coupe 2009",
|
209 |
-
"Suzuki Aerio Sedan 2007",
|
210 |
-
"Suzuki Kizashi Sedan 2012",
|
211 |
-
"Suzuki SX4 Hatchback 2012",
|
212 |
-
"Suzuki SX4 Sedan 2012",
|
213 |
-
"Tesla Model S Sedan 2012",
|
214 |
-
"Toyota Sequoia SUV 2012",
|
215 |
-
"Toyota Camry Sedan 2012",
|
216 |
-
"Toyota Corolla Sedan 2012",
|
217 |
-
"Toyota 4Runner SUV 2012",
|
218 |
-
"Volkswagen Golf Hatchback 2012",
|
219 |
-
"Volkswagen Golf Hatchback 1991",
|
220 |
-
"Volkswagen Beetle Hatchback 2012",
|
221 |
-
"Volvo C30 Hatchback 2012",
|
222 |
-
"Volvo 240 Sedan 1993",
|
223 |
-
"Volvo XC90 SUV 2007",
|
224 |
-
"smart fortwo Convertible 2012",
|
225 |
-
]
|
226 |
-
|
227 |
-
clip_templates = [
|
228 |
-
lambda c: f"a photo of a {c}.",
|
229 |
-
lambda c: f"a photo of the {c}.",
|
230 |
-
lambda c: f"a photo of my {c}.",
|
231 |
-
lambda c: f"i love my {c}!",
|
232 |
-
lambda c: f"a photo of my dirty {c}.",
|
233 |
-
lambda c: f"a photo of my clean {c}.",
|
234 |
-
lambda c: f"a photo of my new {c}.",
|
235 |
-
lambda c: f"a photo of my old {c}.",
|
236 |
-
]
|
237 |
-
|
238 |
-
def _info(self):
|
239 |
-
return datasets.DatasetInfo(
|
240 |
-
description="StanfordCars dataset for image classification.",
|
241 |
-
features=datasets.Features(
|
242 |
-
{
|
243 |
-
"image": datasets.Image(),
|
244 |
-
"label": datasets.ClassLabel(names=self.classnames),
|
245 |
-
}
|
246 |
-
),
|
247 |
-
supervised_keys=("image", "label"),
|
248 |
-
task_templates=[datasets.ImageClassification(image_column="image", label_column="label")],
|
249 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|