PriyePrabhakar commited on
Commit
0c717d3
·
1 Parent(s): 6d460b7

Add application file 1

Browse files
.DS_Store ADDED
Binary file (6.15 kB). View file
 
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Install Python dependencies
11
+ COPY pyproject.toml .
12
+ RUN pip install poetry && \
13
+ poetry config virtualenvs.create false && \
14
+ poetry install --no-dev
15
+
16
+ # Copy project files
17
+ COPY src/ src/
18
+ COPY README.md .
19
+
20
+ # Set environment variables
21
+ ENV PYTHONPATH=/app
22
+
23
+ # Default command
24
+ CMD ["python", "src/train.py"]
LOC_synset_mapping.txt ADDED
@@ -0,0 +1,1000 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ n01440764 : tench, Tinca tinca
2
+ n01443537 : goldfish, Carassius auratus
3
+ n01484850 : great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias
4
+ n01491361 : tiger shark, Galeocerdo cuvieri
5
+ n01494475 : hammerhead, hammerhead shark
6
+ n01496331 : electric ray, crampfish, numbfish, torpedo
7
+ n01498041 : stingray
8
+ n01514668 : cock
9
+ n01514859 : hen
10
+ n01518878 : ostrich, Struthio camelus
11
+ n01530575 : brambling, Fringilla montifringilla
12
+ n01531178 : goldfinch, Carduelis carduelis
13
+ n01532829 : house finch, linnet, Carpodacus mexicanus
14
+ n01534433 : junco, snowbird
15
+ n01537544 : indigo bunting, indigo finch, indigo bird, Passerina cyanea
16
+ n01558993 : robin, American robin, Turdus migratorius
17
+ n01560419 : bulbul
18
+ n01580077 : jay
19
+ n01582220 : magpie
20
+ n01592084 : chickadee
21
+ n01601694 : water ouzel, dipper
22
+ n01608432 : kite
23
+ n01614925 : bald eagle, American eagle, Haliaeetus leucocephalus
24
+ n01616318 : vulture
25
+ n01622779 : great grey owl, great gray owl, Strix nebulosa
26
+ n01629819 : European fire salamander, Salamandra salamandra
27
+ n01630670 : common newt, Triturus vulgaris
28
+ n01631663 : eft
29
+ n01632458 : spotted salamander, Ambystoma maculatum
30
+ n01632777 : axolotl, mud puppy, Ambystoma mexicanum
31
+ n01641577 : bullfrog, Rana catesbeiana
32
+ n01644373 : tree frog, tree-frog
33
+ n01644900 : tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui
34
+ n01664065 : loggerhead, loggerhead turtle, Caretta caretta
35
+ n01665541 : leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea
36
+ n01667114 : mud turtle
37
+ n01667778 : terrapin
38
+ n01669191 : box turtle, box tortoise
39
+ n01675722 : banded gecko
40
+ n01677366 : common iguana, iguana, Iguana iguana
41
+ n01682714 : American chameleon, anole, Anolis carolinensis
42
+ n01685808 : whiptail, whiptail lizard
43
+ n01687978 : agama
44
+ n01688243 : frilled lizard, Chlamydosaurus kingi
45
+ n01689811 : alligator lizard
46
+ n01692333 : Gila monster, Heloderma suspectum
47
+ n01693334 : green lizard, Lacerta viridis
48
+ n01694178 : African chameleon, Chamaeleo chamaeleon
49
+ n01695060 : Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis
50
+ n01697457 : African crocodile, Nile crocodile, Crocodylus niloticus
51
+ n01698640 : American alligator, Alligator mississipiensis
52
+ n01704323 : triceratops
53
+ n01728572 : thunder snake, worm snake, Carphophis amoenus
54
+ n01728920 : ringneck snake, ring-necked snake, ring snake
55
+ n01729322 : hognose snake, puff adder, sand viper
56
+ n01729977 : green snake, grass snake
57
+ n01734418 : king snake, kingsnake
58
+ n01735189 : garter snake, grass snake
59
+ n01737021 : water snake
60
+ n01739381 : vine snake
61
+ n01740131 : night snake, Hypsiglena torquata
62
+ n01742172 : boa constrictor, Constrictor constrictor
63
+ n01744401 : rock python, rock snake, Python sebae
64
+ n01748264 : Indian cobra, Naja naja
65
+ n01749939 : green mamba
66
+ n01751748 : sea snake
67
+ n01753488 : horned viper, cerastes, sand viper, horned asp, Cerastes cornutus
68
+ n01755581 : diamondback, diamondback rattlesnake, Crotalus adamanteus
69
+ n01756291 : sidewinder, horned rattlesnake, Crotalus cerastes
70
+ n01768244 : trilobite
71
+ n01770081 : harvestman, daddy longlegs, Phalangium opilio
72
+ n01770393 : scorpion
73
+ n01773157 : black and gold garden spider, Argiope aurantia
74
+ n01773549 : barn spider, Araneus cavaticus
75
+ n01773797 : garden spider, Aranea diademata
76
+ n01774384 : black widow, Latrodectus mactans
77
+ n01774750 : tarantula
78
+ n01775062 : wolf spider, hunting spider
79
+ n01776313 : tick
80
+ n01784675 : centipede
81
+ n01795545 : black grouse
82
+ n01796340 : ptarmigan
83
+ n01797886 : ruffed grouse, partridge, Bonasa umbellus
84
+ n01798484 : prairie chicken, prairie grouse, prairie fowl
85
+ n01806143 : peacock
86
+ n01806567 : quail
87
+ n01807496 : partridge
88
+ n01817953 : African grey, African gray, Psittacus erithacus
89
+ n01818515 : macaw
90
+ n01819313 : sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita
91
+ n01820546 : lorikeet
92
+ n01824575 : coucal
93
+ n01828970 : bee eater
94
+ n01829413 : hornbill
95
+ n01833805 : hummingbird
96
+ n01843065 : jacamar
97
+ n01843383 : toucan
98
+ n01847000 : drake
99
+ n01855032 : red-breasted merganser, Mergus serrator
100
+ n01855672 : goose
101
+ n01860187 : black swan, Cygnus atratus
102
+ n01871265 : tusker
103
+ n01872401 : echidna, spiny anteater, anteater
104
+ n01873310 : platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus
105
+ n01877812 : wallaby, brush kangaroo
106
+ n01882714 : koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus
107
+ n01883070 : wombat
108
+ n01910747 : jellyfish
109
+ n01914609 : sea anemone, anemone
110
+ n01917289 : brain coral
111
+ n01924916 : flatworm, platyhelminth
112
+ n01930112 : nematode, nematode worm, roundworm
113
+ n01943899 : conch
114
+ n01944390 : snail
115
+ n01945685 : slug
116
+ n01950731 : sea slug, nudibranch
117
+ n01955084 : chiton, coat-of-mail shell, sea cradle, polyplacophore
118
+ n01968897 : chambered nautilus, pearly nautilus, nautilus
119
+ n01978287 : Dungeness crab, Cancer magister
120
+ n01978455 : rock crab, Cancer irroratus
121
+ n01980166 : fiddler crab
122
+ n01981276 : king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica
123
+ n01983481 : American lobster, Northern lobster, Maine lobster, Homarus americanus
124
+ n01984695 : spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish
125
+ n01985128 : crayfish, crawfish, crawdad, crawdaddy
126
+ n01986214 : hermit crab
127
+ n01990800 : isopod
128
+ n02002556 : white stork, Ciconia ciconia
129
+ n02002724 : black stork, Ciconia nigra
130
+ n02006656 : spoonbill
131
+ n02007558 : flamingo
132
+ n02009229 : little blue heron, Egretta caerulea
133
+ n02009912 : American egret, great white heron, Egretta albus
134
+ n02011460 : bittern
135
+ n02012849 : crane
136
+ n02013706 : limpkin, Aramus pictus
137
+ n02017213 : European gallinule, Porphyrio porphyrio
138
+ n02018207 : American coot, marsh hen, mud hen, water hen, Fulica americana
139
+ n02018795 : bustard
140
+ n02025239 : ruddy turnstone, Arenaria interpres
141
+ n02027492 : red-backed sandpiper, dunlin, Erolia alpina
142
+ n02028035 : redshank, Tringa totanus
143
+ n02033041 : dowitcher
144
+ n02037110 : oystercatcher, oyster catcher
145
+ n02051845 : pelican
146
+ n02056570 : king penguin, Aptenodytes patagonica
147
+ n02058221 : albatross, mollymawk
148
+ n02066245 : grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus
149
+ n02071294 : killer whale, killer, orca, grampus, sea wolf, Orcinus orca
150
+ n02074367 : dugong, Dugong dugon
151
+ n02077923 : sea lion
152
+ n02085620 : Chihuahua
153
+ n02085782 : Japanese spaniel
154
+ n02085936 : Maltese dog, Maltese terrier, Maltese
155
+ n02086079 : Pekinese, Pekingese, Peke
156
+ n02086240 : Shih-Tzu
157
+ n02086646 : Blenheim spaniel
158
+ n02086910 : papillon
159
+ n02087046 : toy terrier
160
+ n02087394 : Rhodesian ridgeback
161
+ n02088094 : Afghan hound, Afghan
162
+ n02088238 : basset, basset hound
163
+ n02088364 : beagle
164
+ n02088466 : bloodhound, sleuthhound
165
+ n02088632 : bluetick
166
+ n02089078 : black-and-tan coonhound
167
+ n02089867 : Walker hound, Walker foxhound
168
+ n02089973 : English foxhound
169
+ n02090379 : redbone
170
+ n02090622 : borzoi, Russian wolfhound
171
+ n02090721 : Irish wolfhound
172
+ n02091032 : Italian greyhound
173
+ n02091134 : whippet
174
+ n02091244 : Ibizan hound, Ibizan Podenco
175
+ n02091467 : Norwegian elkhound, elkhound
176
+ n02091635 : otterhound, otter hound
177
+ n02091831 : Saluki, gazelle hound
178
+ n02092002 : Scottish deerhound, deerhound
179
+ n02092339 : Weimaraner
180
+ n02093256 : Staffordshire bullterrier, Staffordshire bull terrier
181
+ n02093428 : American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier
182
+ n02093647 : Bedlington terrier
183
+ n02093754 : Border terrier
184
+ n02093859 : Kerry blue terrier
185
+ n02093991 : Irish terrier
186
+ n02094114 : Norfolk terrier
187
+ n02094258 : Norwich terrier
188
+ n02094433 : Yorkshire terrier
189
+ n02095314 : wire-haired fox terrier
190
+ n02095570 : Lakeland terrier
191
+ n02095889 : Sealyham terrier, Sealyham
192
+ n02096051 : Airedale, Airedale terrier
193
+ n02096177 : cairn, cairn terrier
194
+ n02096294 : Australian terrier
195
+ n02096437 : Dandie Dinmont, Dandie Dinmont terrier
196
+ n02096585 : Boston bull, Boston terrier
197
+ n02097047 : miniature schnauzer
198
+ n02097130 : giant schnauzer
199
+ n02097209 : standard schnauzer
200
+ n02097298 : Scotch terrier, Scottish terrier, Scottie
201
+ n02097474 : Tibetan terrier, chrysanthemum dog
202
+ n02097658 : silky terrier, Sydney silky
203
+ n02098105 : soft-coated wheaten terrier
204
+ n02098286 : West Highland white terrier
205
+ n02098413 : Lhasa, Lhasa apso
206
+ n02099267 : flat-coated retriever
207
+ n02099429 : curly-coated retriever
208
+ n02099601 : golden retriever
209
+ n02099712 : Labrador retriever
210
+ n02099849 : Chesapeake Bay retriever
211
+ n02100236 : German short-haired pointer
212
+ n02100583 : vizsla, Hungarian pointer
213
+ n02100735 : English setter
214
+ n02100877 : Irish setter, red setter
215
+ n02101006 : Gordon setter
216
+ n02101388 : Brittany spaniel
217
+ n02101556 : clumber, clumber spaniel
218
+ n02102040 : English springer, English springer spaniel
219
+ n02102177 : Welsh springer spaniel
220
+ n02102318 : cocker spaniel, English cocker spaniel, cocker
221
+ n02102480 : Sussex spaniel
222
+ n02102973 : Irish water spaniel
223
+ n02104029 : kuvasz
224
+ n02104365 : schipperke
225
+ n02105056 : groenendael
226
+ n02105162 : malinois
227
+ n02105251 : briard
228
+ n02105412 : kelpie
229
+ n02105505 : komondor
230
+ n02105641 : Old English sheepdog, bobtail
231
+ n02105855 : Shetland sheepdog, Shetland sheep dog, Shetland
232
+ n02106030 : collie
233
+ n02106166 : Border collie
234
+ n02106382 : Bouvier des Flandres, Bouviers des Flandres
235
+ n02106550 : Rottweiler
236
+ n02106662 : German shepherd, German shepherd dog, German police dog, alsatian
237
+ n02107142 : Doberman, Doberman pinscher
238
+ n02107312 : miniature pinscher
239
+ n02107574 : Greater Swiss Mountain dog
240
+ n02107683 : Bernese mountain dog
241
+ n02107908 : Appenzeller
242
+ n02108000 : EntleBucher
243
+ n02108089 : boxer
244
+ n02108422 : bull mastiff
245
+ n02108551 : Tibetan mastiff
246
+ n02108915 : French bulldog
247
+ n02109047 : Great Dane
248
+ n02109525 : Saint Bernard, St Bernard
249
+ n02109961 : Eskimo dog, husky
250
+ n02110063 : malamute, malemute, Alaskan malamute
251
+ n02110185 : Siberian husky
252
+ n02110341 : dalmatian, coach dog, carriage dog
253
+ n02110627 : affenpinscher, monkey pinscher, monkey dog
254
+ n02110806 : basenji
255
+ n02110958 : pug, pug-dog
256
+ n02111129 : Leonberg
257
+ n02111277 : Newfoundland, Newfoundland dog
258
+ n02111500 : Great Pyrenees
259
+ n02111889 : Samoyed, Samoyede
260
+ n02112018 : Pomeranian
261
+ n02112137 : chow, chow chow
262
+ n02112350 : keeshond
263
+ n02112706 : Brabancon griffon
264
+ n02113023 : Pembroke, Pembroke Welsh corgi
265
+ n02113186 : Cardigan, Cardigan Welsh corgi
266
+ n02113624 : toy poodle
267
+ n02113712 : miniature poodle
268
+ n02113799 : standard poodle
269
+ n02113978 : Mexican hairless
270
+ n02114367 : timber wolf, grey wolf, gray wolf, Canis lupus
271
+ n02114548 : white wolf, Arctic wolf, Canis lupus tundrarum
272
+ n02114712 : red wolf, maned wolf, Canis rufus, Canis niger
273
+ n02114855 : coyote, prairie wolf, brush wolf, Canis latrans
274
+ n02115641 : dingo, warrigal, warragal, Canis dingo
275
+ n02115913 : dhole, Cuon alpinus
276
+ n02116738 : African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus
277
+ n02117135 : hyena, hyaena
278
+ n02119022 : red fox, Vulpes vulpes
279
+ n02119789 : kit fox, Vulpes macrotis
280
+ n02120079 : Arctic fox, white fox, Alopex lagopus
281
+ n02120505 : grey fox, gray fox, Urocyon cinereoargenteus
282
+ n02123045 : tabby, tabby cat
283
+ n02123159 : tiger cat
284
+ n02123394 : Persian cat
285
+ n02123597 : Siamese cat, Siamese
286
+ n02124075 : Egyptian cat
287
+ n02125311 : cougar, puma, catamount, mountain lion, painter, panther, Felis concolor
288
+ n02127052 : lynx, catamount
289
+ n02128385 : leopard, Panthera pardus
290
+ n02128757 : snow leopard, ounce, Panthera uncia
291
+ n02128925 : jaguar, panther, Panthera onca, Felis onca
292
+ n02129165 : lion, king of beasts, Panthera leo
293
+ n02129604 : tiger, Panthera tigris
294
+ n02130308 : cheetah, chetah, Acinonyx jubatus
295
+ n02132136 : brown bear, bruin, Ursus arctos
296
+ n02133161 : American black bear, black bear, Ursus americanus, Euarctos americanus
297
+ n02134084 : ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus
298
+ n02134418 : sloth bear, Melursus ursinus, Ursus ursinus
299
+ n02137549 : mongoose
300
+ n02138441 : meerkat, mierkat
301
+ n02165105 : tiger beetle
302
+ n02165456 : ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle
303
+ n02167151 : ground beetle, carabid beetle
304
+ n02168699 : long-horned beetle, longicorn, longicorn beetle
305
+ n02169497 : leaf beetle, chrysomelid
306
+ n02172182 : dung beetle
307
+ n02174001 : rhinoceros beetle
308
+ n02177972 : weevil
309
+ n02190166 : fly
310
+ n02206856 : bee
311
+ n02219486 : ant, emmet, pismire
312
+ n02226429 : grasshopper, hopper
313
+ n02229544 : cricket
314
+ n02231487 : walking stick, walkingstick, stick insect
315
+ n02233338 : cockroach, roach
316
+ n02236044 : mantis, mantid
317
+ n02256656 : cicada, cicala
318
+ n02259212 : leafhopper
319
+ n02264363 : lacewing, lacewing fly
320
+ n02268443 : dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk
321
+ n02268853 : damselfly
322
+ n02276258 : admiral
323
+ n02277742 : ringlet, ringlet butterfly
324
+ n02279972 : monarch, monarch butterfly, milkweed butterfly, Danaus plexippus
325
+ n02280649 : cabbage butterfly
326
+ n02281406 : sulphur butterfly, sulfur butterfly
327
+ n02281787 : lycaenid, lycaenid butterfly
328
+ n02317335 : starfish, sea star
329
+ n02319095 : sea urchin
330
+ n02321529 : sea cucumber, holothurian
331
+ n02325366 : wood rabbit, cottontail, cottontail rabbit
332
+ n02326432 : hare
333
+ n02328150 : Angora, Angora rabbit
334
+ n02342885 : hamster
335
+ n02346627 : porcupine, hedgehog
336
+ n02356798 : fox squirrel, eastern fox squirrel, Sciurus niger
337
+ n02361337 : marmot
338
+ n02363005 : beaver
339
+ n02364673 : guinea pig, Cavia cobaya
340
+ n02389026 : sorrel
341
+ n02391049 : zebra
342
+ n02395406 : hog, pig, grunter, squealer, Sus scrofa
343
+ n02396427 : wild boar, boar, Sus scrofa
344
+ n02397096 : warthog
345
+ n02398521 : hippopotamus, hippo, river horse, Hippopotamus amphibius
346
+ n02403003 : ox
347
+ n02408429 : water buffalo, water ox, Asiatic buffalo, Bubalus bubalis
348
+ n02410509 : bison
349
+ n02412080 : ram, tup
350
+ n02415577 : bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis
351
+ n02417914 : ibex, Capra ibex
352
+ n02422106 : hartebeest
353
+ n02422699 : impala, Aepyceros melampus
354
+ n02423022 : gazelle
355
+ n02437312 : Arabian camel, dromedary, Camelus dromedarius
356
+ n02437616 : llama
357
+ n02441942 : weasel
358
+ n02442845 : mink
359
+ n02443114 : polecat, fitch, foulmart, foumart, Mustela putorius
360
+ n02443484 : black-footed ferret, ferret, Mustela nigripes
361
+ n02444819 : otter
362
+ n02445715 : skunk, polecat, wood pussy
363
+ n02447366 : badger
364
+ n02454379 : armadillo
365
+ n02457408 : three-toed sloth, ai, Bradypus tridactylus
366
+ n02480495 : orangutan, orang, orangutang, Pongo pygmaeus
367
+ n02480855 : gorilla, Gorilla gorilla
368
+ n02481823 : chimpanzee, chimp, Pan troglodytes
369
+ n02483362 : gibbon, Hylobates lar
370
+ n02483708 : siamang, Hylobates syndactylus, Symphalangus syndactylus
371
+ n02484975 : guenon, guenon monkey
372
+ n02486261 : patas, hussar monkey, Erythrocebus patas
373
+ n02486410 : baboon
374
+ n02487347 : macaque
375
+ n02488291 : langur
376
+ n02488702 : colobus, colobus monkey
377
+ n02489166 : proboscis monkey, Nasalis larvatus
378
+ n02490219 : marmoset
379
+ n02492035 : capuchin, ringtail, Cebus capucinus
380
+ n02492660 : howler monkey, howler
381
+ n02493509 : titi, titi monkey
382
+ n02493793 : spider monkey, Ateles geoffroyi
383
+ n02494079 : squirrel monkey, Saimiri sciureus
384
+ n02497673 : Madagascar cat, ring-tailed lemur, Lemur catta
385
+ n02500267 : indri, indris, Indri indri, Indri brevicaudatus
386
+ n02504013 : Indian elephant, Elephas maximus
387
+ n02504458 : African elephant, Loxodonta africana
388
+ n02509815 : lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens
389
+ n02510455 : giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca
390
+ n02514041 : barracouta, snoek
391
+ n02526121 : eel
392
+ n02536864 : coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch
393
+ n02606052 : rock beauty, Holocanthus tricolor
394
+ n02607072 : anemone fish
395
+ n02640242 : sturgeon
396
+ n02641379 : gar, garfish, garpike, billfish, Lepisosteus osseus
397
+ n02643566 : lionfish
398
+ n02655020 : puffer, pufferfish, blowfish, globefish
399
+ n02666196 : abacus
400
+ n02667093 : abaya
401
+ n02669723 : academic gown, academic robe, judge's robe
402
+ n02672831 : accordion, piano accordion, squeeze box
403
+ n02676566 : acoustic guitar
404
+ n02687172 : aircraft carrier, carrier, flattop, attack aircraft carrier
405
+ n02690373 : airliner
406
+ n02692877 : airship, dirigible
407
+ n02699494 : altar
408
+ n02701002 : ambulance
409
+ n02704792 : amphibian, amphibious vehicle
410
+ n02708093 : analog clock
411
+ n02727426 : apiary, bee house
412
+ n02730930 : apron
413
+ n02747177 : ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin
414
+ n02749479 : assault rifle, assault gun
415
+ n02769748 : backpack, back pack, knapsack, packsack, rucksack, haversack
416
+ n02776631 : bakery, bakeshop, bakehouse
417
+ n02777292 : balance beam, beam
418
+ n02782093 : balloon
419
+ n02783161 : ballpoint, ballpoint pen, ballpen, Biro
420
+ n02786058 : Band Aid
421
+ n02787622 : banjo
422
+ n02788148 : bannister, banister, balustrade, balusters, handrail
423
+ n02790996 : barbell
424
+ n02791124 : barber chair
425
+ n02791270 : barbershop
426
+ n02793495 : barn
427
+ n02794156 : barometer
428
+ n02795169 : barrel, cask
429
+ n02797295 : barrow, garden cart, lawn cart, wheelbarrow
430
+ n02799071 : baseball
431
+ n02802426 : basketball
432
+ n02804414 : bassinet
433
+ n02804610 : bassoon
434
+ n02807133 : bathing cap, swimming cap
435
+ n02808304 : bath towel
436
+ n02808440 : bathtub, bathing tub, bath, tub
437
+ n02814533 : beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon
438
+ n02814860 : beacon, lighthouse, beacon light, pharos
439
+ n02815834 : beaker
440
+ n02817516 : bearskin, busby, shako
441
+ n02823428 : beer bottle
442
+ n02823750 : beer glass
443
+ n02825657 : bell cote, bell cot
444
+ n02834397 : bib
445
+ n02835271 : bicycle-built-for-two, tandem bicycle, tandem
446
+ n02837789 : bikini, two-piece
447
+ n02840245 : binder, ring-binder
448
+ n02841315 : binoculars, field glasses, opera glasses
449
+ n02843684 : birdhouse
450
+ n02859443 : boathouse
451
+ n02860847 : bobsled, bobsleigh, bob
452
+ n02865351 : bolo tie, bolo, bola tie, bola
453
+ n02869837 : bonnet, poke bonnet
454
+ n02870880 : bookcase
455
+ n02871525 : bookshop, bookstore, bookstall
456
+ n02877765 : bottlecap
457
+ n02879718 : bow
458
+ n02883205 : bow tie, bow-tie, bowtie
459
+ n02892201 : brass, memorial tablet, plaque
460
+ n02892767 : brassiere, bra, bandeau
461
+ n02894605 : breakwater, groin, groyne, mole, bulwark, seawall, jetty
462
+ n02895154 : breastplate, aegis, egis
463
+ n02906734 : broom
464
+ n02909870 : bucket, pail
465
+ n02910353 : buckle
466
+ n02916936 : bulletproof vest
467
+ n02917067 : bullet train, bullet
468
+ n02927161 : butcher shop, meat market
469
+ n02930766 : cab, hack, taxi, taxicab
470
+ n02939185 : caldron, cauldron
471
+ n02948072 : candle, taper, wax light
472
+ n02950826 : cannon
473
+ n02951358 : canoe
474
+ n02951585 : can opener, tin opener
475
+ n02963159 : cardigan
476
+ n02965783 : car mirror
477
+ n02966193 : carousel, carrousel, merry-go-round, roundabout, whirligig
478
+ n02966687 : carpenter's kit, tool kit
479
+ n02971356 : carton
480
+ n02974003 : car wheel
481
+ n02977058 : cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM
482
+ n02978881 : cassette
483
+ n02979186 : cassette player
484
+ n02980441 : castle
485
+ n02981792 : catamaran
486
+ n02988304 : CD player
487
+ n02992211 : cello, violoncello
488
+ n02992529 : cellular telephone, cellular phone, cellphone, cell, mobile phone
489
+ n02999410 : chain
490
+ n03000134 : chainlink fence
491
+ n03000247 : chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour
492
+ n03000684 : chain saw, chainsaw
493
+ n03014705 : chest
494
+ n03016953 : chiffonier, commode
495
+ n03017168 : chime, bell, gong
496
+ n03018349 : china cabinet, china closet
497
+ n03026506 : Christmas stocking
498
+ n03028079 : church, church building
499
+ n03032252 : cinema, movie theater, movie theatre, movie house, picture palace
500
+ n03041632 : cleaver, meat cleaver, chopper
501
+ n03042490 : cliff dwelling
502
+ n03045698 : cloak
503
+ n03047690 : clog, geta, patten, sabot
504
+ n03062245 : cocktail shaker
505
+ n03063599 : coffee mug
506
+ n03063689 : coffeepot
507
+ n03065424 : coil, spiral, volute, whorl, helix
508
+ n03075370 : combination lock
509
+ n03085013 : computer keyboard, keypad
510
+ n03089624 : confectionery, confectionary, candy store
511
+ n03095699 : container ship, containership, container vessel
512
+ n03100240 : convertible
513
+ n03109150 : corkscrew, bottle screw
514
+ n03110669 : cornet, horn, trumpet, trump
515
+ n03124043 : cowboy boot
516
+ n03124170 : cowboy hat, ten-gallon hat
517
+ n03125729 : cradle
518
+ n03126707 : crane
519
+ n03127747 : crash helmet
520
+ n03127925 : crate
521
+ n03131574 : crib, cot
522
+ n03133878 : Crock Pot
523
+ n03134739 : croquet ball
524
+ n03141823 : crutch
525
+ n03146219 : cuirass
526
+ n03160309 : dam, dike, dyke
527
+ n03179701 : desk
528
+ n03180011 : desktop computer
529
+ n03187595 : dial telephone, dial phone
530
+ n03188531 : diaper, nappy, napkin
531
+ n03196217 : digital clock
532
+ n03197337 : digital watch
533
+ n03201208 : dining table, board
534
+ n03207743 : dishrag, dishcloth
535
+ n03207941 : dishwasher, dish washer, dishwashing machine
536
+ n03208938 : disk brake, disc brake
537
+ n03216828 : dock, dockage, docking facility
538
+ n03218198 : dogsled, dog sled, dog sleigh
539
+ n03220513 : dome
540
+ n03223299 : doormat, welcome mat
541
+ n03240683 : drilling platform, offshore rig
542
+ n03249569 : drum, membranophone, tympan
543
+ n03250847 : drumstick
544
+ n03255030 : dumbbell
545
+ n03259280 : Dutch oven
546
+ n03271574 : electric fan, blower
547
+ n03272010 : electric guitar
548
+ n03272562 : electric locomotive
549
+ n03290653 : entertainment center
550
+ n03291819 : envelope
551
+ n03297495 : espresso maker
552
+ n03314780 : face powder
553
+ n03325584 : feather boa, boa
554
+ n03337140 : file, file cabinet, filing cabinet
555
+ n03344393 : fireboat
556
+ n03345487 : fire engine, fire truck
557
+ n03347037 : fire screen, fireguard
558
+ n03355925 : flagpole, flagstaff
559
+ n03372029 : flute, transverse flute
560
+ n03376595 : folding chair
561
+ n03379051 : football helmet
562
+ n03384352 : forklift
563
+ n03388043 : fountain
564
+ n03388183 : fountain pen
565
+ n03388549 : four-poster
566
+ n03393912 : freight car
567
+ n03394916 : French horn, horn
568
+ n03400231 : frying pan, frypan, skillet
569
+ n03404251 : fur coat
570
+ n03417042 : garbage truck, dustcart
571
+ n03424325 : gasmask, respirator, gas helmet
572
+ n03425413 : gas pump, gasoline pump, petrol pump, island dispenser
573
+ n03443371 : goblet
574
+ n03444034 : go-kart
575
+ n03445777 : golf ball
576
+ n03445924 : golfcart, golf cart
577
+ n03447447 : gondola
578
+ n03447721 : gong, tam-tam
579
+ n03450230 : gown
580
+ n03452741 : grand piano, grand
581
+ n03457902 : greenhouse, nursery, glasshouse
582
+ n03459775 : grille, radiator grille
583
+ n03461385 : grocery store, grocery, food market, market
584
+ n03467068 : guillotine
585
+ n03476684 : hair slide
586
+ n03476991 : hair spray
587
+ n03478589 : half track
588
+ n03481172 : hammer
589
+ n03482405 : hamper
590
+ n03483316 : hand blower, blow dryer, blow drier, hair dryer, hair drier
591
+ n03485407 : hand-held computer, hand-held microcomputer
592
+ n03485794 : handkerchief, hankie, hanky, hankey
593
+ n03492542 : hard disc, hard disk, fixed disk
594
+ n03494278 : harmonica, mouth organ, harp, mouth harp
595
+ n03495258 : harp
596
+ n03496892 : harvester, reaper
597
+ n03498962 : hatchet
598
+ n03527444 : holster
599
+ n03529860 : home theater, home theatre
600
+ n03530642 : honeycomb
601
+ n03532672 : hook, claw
602
+ n03534580 : hoopskirt, crinoline
603
+ n03535780 : horizontal bar, high bar
604
+ n03538406 : horse cart, horse-cart
605
+ n03544143 : hourglass
606
+ n03584254 : iPod
607
+ n03584829 : iron, smoothing iron
608
+ n03590841 : jack-o'-lantern
609
+ n03594734 : jean, blue jean, denim
610
+ n03594945 : jeep, landrover
611
+ n03595614 : jersey, T-shirt, tee shirt
612
+ n03598930 : jigsaw puzzle
613
+ n03599486 : jinrikisha, ricksha, rickshaw
614
+ n03602883 : joystick
615
+ n03617480 : kimono
616
+ n03623198 : knee pad
617
+ n03627232 : knot
618
+ n03630383 : lab coat, laboratory coat
619
+ n03633091 : ladle
620
+ n03637318 : lampshade, lamp shade
621
+ n03642806 : laptop, laptop computer
622
+ n03649909 : lawn mower, mower
623
+ n03657121 : lens cap, lens cover
624
+ n03658185 : letter opener, paper knife, paperknife
625
+ n03661043 : library
626
+ n03662601 : lifeboat
627
+ n03666591 : lighter, light, igniter, ignitor
628
+ n03670208 : limousine, limo
629
+ n03673027 : liner, ocean liner
630
+ n03676483 : lipstick, lip rouge
631
+ n03680355 : Loafer
632
+ n03690938 : lotion
633
+ n03691459 : loudspeaker, speaker, speaker unit, loudspeaker system, speaker system
634
+ n03692522 : loupe, jeweler's loupe
635
+ n03697007 : lumbermill, sawmill
636
+ n03706229 : magnetic compass
637
+ n03709823 : mailbag, postbag
638
+ n03710193 : mailbox, letter box
639
+ n03710637 : maillot
640
+ n03710721 : maillot, tank suit
641
+ n03717622 : manhole cover
642
+ n03720891 : maraca
643
+ n03721384 : marimba, xylophone
644
+ n03724870 : mask
645
+ n03729826 : matchstick
646
+ n03733131 : maypole
647
+ n03733281 : maze, labyrinth
648
+ n03733805 : measuring cup
649
+ n03742115 : medicine chest, medicine cabinet
650
+ n03743016 : megalith, megalithic structure
651
+ n03759954 : microphone, mike
652
+ n03761084 : microwave, microwave oven
653
+ n03763968 : military uniform
654
+ n03764736 : milk can
655
+ n03769881 : minibus
656
+ n03770439 : miniskirt, mini
657
+ n03770679 : minivan
658
+ n03773504 : missile
659
+ n03775071 : mitten
660
+ n03775546 : mixing bowl
661
+ n03776460 : mobile home, manufactured home
662
+ n03777568 : Model T
663
+ n03777754 : modem
664
+ n03781244 : monastery
665
+ n03782006 : monitor
666
+ n03785016 : moped
667
+ n03786901 : mortar
668
+ n03787032 : mortarboard
669
+ n03788195 : mosque
670
+ n03788365 : mosquito net
671
+ n03791053 : motor scooter, scooter
672
+ n03792782 : mountain bike, all-terrain bike, off-roader
673
+ n03792972 : mountain tent
674
+ n03793489 : mouse, computer mouse
675
+ n03794056 : mousetrap
676
+ n03796401 : moving van
677
+ n03803284 : muzzle
678
+ n03804744 : nail
679
+ n03814639 : neck brace
680
+ n03814906 : necklace
681
+ n03825788 : nipple
682
+ n03832673 : notebook, notebook computer
683
+ n03837869 : obelisk
684
+ n03838899 : oboe, hautboy, hautbois
685
+ n03840681 : ocarina, sweet potato
686
+ n03841143 : odometer, hodometer, mileometer, milometer
687
+ n03843555 : oil filter
688
+ n03854065 : organ, pipe organ
689
+ n03857828 : oscilloscope, scope, cathode-ray oscilloscope, CRO
690
+ n03866082 : overskirt
691
+ n03868242 : oxcart
692
+ n03868863 : oxygen mask
693
+ n03871628 : packet
694
+ n03873416 : paddle, boat paddle
695
+ n03874293 : paddlewheel, paddle wheel
696
+ n03874599 : padlock
697
+ n03876231 : paintbrush
698
+ n03877472 : pajama, pyjama, pj's, jammies
699
+ n03877845 : palace
700
+ n03884397 : panpipe, pandean pipe, syrinx
701
+ n03887697 : paper towel
702
+ n03888257 : parachute, chute
703
+ n03888605 : parallel bars, bars
704
+ n03891251 : park bench
705
+ n03891332 : parking meter
706
+ n03895866 : passenger car, coach, carriage
707
+ n03899768 : patio, terrace
708
+ n03902125 : pay-phone, pay-station
709
+ n03903868 : pedestal, plinth, footstall
710
+ n03908618 : pencil box, pencil case
711
+ n03908714 : pencil sharpener
712
+ n03916031 : perfume, essence
713
+ n03920288 : Petri dish
714
+ n03924679 : photocopier
715
+ n03929660 : pick, plectrum, plectron
716
+ n03929855 : pickelhaube
717
+ n03930313 : picket fence, paling
718
+ n03930630 : pickup, pickup truck
719
+ n03933933 : pier
720
+ n03935335 : piggy bank, penny bank
721
+ n03937543 : pill bottle
722
+ n03938244 : pillow
723
+ n03942813 : ping-pong ball
724
+ n03944341 : pinwheel
725
+ n03947888 : pirate, pirate ship
726
+ n03950228 : pitcher, ewer
727
+ n03954731 : plane, carpenter's plane, woodworking plane
728
+ n03956157 : planetarium
729
+ n03958227 : plastic bag
730
+ n03961711 : plate rack
731
+ n03967562 : plow, plough
732
+ n03970156 : plunger, plumber's helper
733
+ n03976467 : Polaroid camera, Polaroid Land camera
734
+ n03976657 : pole
735
+ n03977966 : police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria
736
+ n03980874 : poncho
737
+ n03982430 : pool table, billiard table, snooker table
738
+ n03983396 : pop bottle, soda bottle
739
+ n03991062 : pot, flowerpot
740
+ n03992509 : potter's wheel
741
+ n03995372 : power drill
742
+ n03998194 : prayer rug, prayer mat
743
+ n04004767 : printer
744
+ n04005630 : prison, prison house
745
+ n04008634 : projectile, missile
746
+ n04009552 : projector
747
+ n04019541 : puck, hockey puck
748
+ n04023962 : punching bag, punch bag, punching ball, punchball
749
+ n04026417 : purse
750
+ n04033901 : quill, quill pen
751
+ n04033995 : quilt, comforter, comfort, puff
752
+ n04037443 : racer, race car, racing car
753
+ n04039381 : racket, racquet
754
+ n04040759 : radiator
755
+ n04041544 : radio, wireless
756
+ n04044716 : radio telescope, radio reflector
757
+ n04049303 : rain barrel
758
+ n04065272 : recreational vehicle, RV, R.V.
759
+ n04067472 : reel
760
+ n04069434 : reflex camera
761
+ n04070727 : refrigerator, icebox
762
+ n04074963 : remote control, remote
763
+ n04081281 : restaurant, eating house, eating place, eatery
764
+ n04086273 : revolver, six-gun, six-shooter
765
+ n04090263 : rifle
766
+ n04099969 : rocking chair, rocker
767
+ n04111531 : rotisserie
768
+ n04116512 : rubber eraser, rubber, pencil eraser
769
+ n04118538 : rugby ball
770
+ n04118776 : rule, ruler
771
+ n04120489 : running shoe
772
+ n04125021 : safe
773
+ n04127249 : safety pin
774
+ n04131690 : saltshaker, salt shaker
775
+ n04133789 : sandal
776
+ n04136333 : sarong
777
+ n04141076 : sax, saxophone
778
+ n04141327 : scabbard
779
+ n04141975 : scale, weighing machine
780
+ n04146614 : school bus
781
+ n04147183 : schooner
782
+ n04149813 : scoreboard
783
+ n04152593 : screen, CRT screen
784
+ n04153751 : screw
785
+ n04154565 : screwdriver
786
+ n04162706 : seat belt, seatbelt
787
+ n04179913 : sewing machine
788
+ n04192698 : shield, buckler
789
+ n04200800 : shoe shop, shoe-shop, shoe store
790
+ n04201297 : shoji
791
+ n04204238 : shopping basket
792
+ n04204347 : shopping cart
793
+ n04208210 : shovel
794
+ n04209133 : shower cap
795
+ n04209239 : shower curtain
796
+ n04228054 : ski
797
+ n04229816 : ski mask
798
+ n04235860 : sleeping bag
799
+ n04238763 : slide rule, slipstick
800
+ n04239074 : sliding door
801
+ n04243546 : slot, one-armed bandit
802
+ n04251144 : snorkel
803
+ n04252077 : snowmobile
804
+ n04252225 : snowplow, snowplough
805
+ n04254120 : soap dispenser
806
+ n04254680 : soccer ball
807
+ n04254777 : sock
808
+ n04258138 : solar dish, solar collector, solar furnace
809
+ n04259630 : sombrero
810
+ n04263257 : soup bowl
811
+ n04264628 : space bar
812
+ n04265275 : space heater
813
+ n04266014 : space shuttle
814
+ n04270147 : spatula
815
+ n04273569 : speedboat
816
+ n04275548 : spider web, spider's web
817
+ n04277352 : spindle
818
+ n04285008 : sports car, sport car
819
+ n04286575 : spotlight, spot
820
+ n04296562 : stage
821
+ n04310018 : steam locomotive
822
+ n04311004 : steel arch bridge
823
+ n04311174 : steel drum
824
+ n04317175 : stethoscope
825
+ n04325704 : stole
826
+ n04326547 : stone wall
827
+ n04328186 : stopwatch, stop watch
828
+ n04330267 : stove
829
+ n04332243 : strainer
830
+ n04335435 : streetcar, tram, tramcar, trolley, trolley car
831
+ n04336792 : stretcher
832
+ n04344873 : studio couch, day bed
833
+ n04346328 : stupa, tope
834
+ n04347754 : submarine, pigboat, sub, U-boat
835
+ n04350905 : suit, suit of clothes
836
+ n04355338 : sundial
837
+ n04355933 : sunglass
838
+ n04356056 : sunglasses, dark glasses, shades
839
+ n04357314 : sunscreen, sunblock, sun blocker
840
+ n04366367 : suspension bridge
841
+ n04367480 : swab, swob, mop
842
+ n04370456 : sweatshirt
843
+ n04371430 : swimming trunks, bathing trunks
844
+ n04371774 : swing
845
+ n04372370 : switch, electric switch, electrical switch
846
+ n04376876 : syringe
847
+ n04380533 : table lamp
848
+ n04389033 : tank, army tank, armored combat vehicle, armoured combat vehicle
849
+ n04392985 : tape player
850
+ n04398044 : teapot
851
+ n04399382 : teddy, teddy bear
852
+ n04404412 : television, television system
853
+ n04409515 : tennis ball
854
+ n04417672 : thatch, thatched roof
855
+ n04418357 : theater curtain, theatre curtain
856
+ n04423845 : thimble
857
+ n04428191 : thresher, thrasher, threshing machine
858
+ n04429376 : throne
859
+ n04435653 : tile roof
860
+ n04442312 : toaster
861
+ n04443257 : tobacco shop, tobacconist shop, tobacconist
862
+ n04447861 : toilet seat
863
+ n04456115 : torch
864
+ n04458633 : totem pole
865
+ n04461696 : tow truck, tow car, wrecker
866
+ n04462240 : toyshop
867
+ n04465501 : tractor
868
+ n04467665 : trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi
869
+ n04476259 : tray
870
+ n04479046 : trench coat
871
+ n04482393 : tricycle, trike, velocipede
872
+ n04483307 : trimaran
873
+ n04485082 : tripod
874
+ n04486054 : triumphal arch
875
+ n04487081 : trolleybus, trolley coach, trackless trolley
876
+ n04487394 : trombone
877
+ n04493381 : tub, vat
878
+ n04501370 : turnstile
879
+ n04505470 : typewriter keyboard
880
+ n04507155 : umbrella
881
+ n04509417 : unicycle, monocycle
882
+ n04515003 : upright, upright piano
883
+ n04517823 : vacuum, vacuum cleaner
884
+ n04522168 : vase
885
+ n04523525 : vault
886
+ n04525038 : velvet
887
+ n04525305 : vending machine
888
+ n04532106 : vestment
889
+ n04532670 : viaduct
890
+ n04536866 : violin, fiddle
891
+ n04540053 : volleyball
892
+ n04542943 : waffle iron
893
+ n04548280 : wall clock
894
+ n04548362 : wallet, billfold, notecase, pocketbook
895
+ n04550184 : wardrobe, closet, press
896
+ n04552348 : warplane, military plane
897
+ n04553703 : washbasin, handbasin, washbowl, lavabo, wash-hand basin
898
+ n04554684 : washer, automatic washer, washing machine
899
+ n04557648 : water bottle
900
+ n04560804 : water jug
901
+ n04562935 : water tower
902
+ n04579145 : whiskey jug
903
+ n04579432 : whistle
904
+ n04584207 : wig
905
+ n04589890 : window screen
906
+ n04590129 : window shade
907
+ n04591157 : Windsor tie
908
+ n04591713 : wine bottle
909
+ n04592741 : wing
910
+ n04596742 : wok
911
+ n04597913 : wooden spoon
912
+ n04599235 : wool, woolen, woollen
913
+ n04604644 : worm fence, snake fence, snake-rail fence, Virginia fence
914
+ n04606251 : wreck
915
+ n04612504 : yawl
916
+ n04613696 : yurt
917
+ n06359193 : web site, website, internet site, site
918
+ n06596364 : comic book
919
+ n06785654 : crossword puzzle, crossword
920
+ n06794110 : street sign
921
+ n06874185 : traffic light, traffic signal, stoplight
922
+ n07248320 : book jacket, dust cover, dust jacket, dust wrapper
923
+ n07565083 : menu
924
+ n07579787 : plate
925
+ n07583066 : guacamole
926
+ n07584110 : consomme
927
+ n07590611 : hot pot, hotpot
928
+ n07613480 : trifle
929
+ n07614500 : ice cream, icecream
930
+ n07615774 : ice lolly, lolly, lollipop, popsicle
931
+ n07684084 : French loaf
932
+ n07693725 : bagel, beigel
933
+ n07695742 : pretzel
934
+ n07697313 : cheeseburger
935
+ n07697537 : hotdog, hot dog, red hot
936
+ n07711569 : mashed potato
937
+ n07714571 : head cabbage
938
+ n07714990 : broccoli
939
+ n07715103 : cauliflower
940
+ n07716358 : zucchini, courgette
941
+ n07716906 : spaghetti squash
942
+ n07717410 : acorn squash
943
+ n07717556 : butternut squash
944
+ n07718472 : cucumber, cuke
945
+ n07718747 : artichoke, globe artichoke
946
+ n07720875 : bell pepper
947
+ n07730033 : cardoon
948
+ n07734744 : mushroom
949
+ n07742313 : Granny Smith
950
+ n07745940 : strawberry
951
+ n07747607 : orange
952
+ n07749582 : lemon
953
+ n07753113 : fig
954
+ n07753275 : pineapple, ananas
955
+ n07753592 : banana
956
+ n07754684 : jackfruit, jak, jack
957
+ n07760859 : custard apple
958
+ n07768694 : pomegranate
959
+ n07802026 : hay
960
+ n07831146 : carbonara
961
+ n07836838 : chocolate sauce, chocolate syrup
962
+ n07860988 : dough
963
+ n07871810 : meat loaf, meatloaf
964
+ n07873807 : pizza, pizza pie
965
+ n07875152 : potpie
966
+ n07880968 : burrito
967
+ n07892512 : red wine
968
+ n07920052 : espresso
969
+ n07930864 : cup
970
+ n07932039 : eggnog
971
+ n09193705 : alp
972
+ n09229709 : bubble
973
+ n09246464 : cliff, drop, drop-off
974
+ n09256479 : coral reef
975
+ n09288635 : geyser
976
+ n09332890 : lakeside, lakeshore
977
+ n09399592 : promontory, headland, head, foreland
978
+ n09421951 : sandbar, sand bar
979
+ n09428293 : seashore, coast, seacoast, sea-coast
980
+ n09468604 : valley, vale
981
+ n09472597 : volcano
982
+ n09835506 : ballplayer, baseball player
983
+ n10148035 : groom, bridegroom
984
+ n10565667 : scuba diver
985
+ n11879895 : rapeseed
986
+ n11939491 : daisy
987
+ n12057211 : yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum
988
+ n12144580 : corn
989
+ n12267677 : acorn
990
+ n12620546 : hip, rose hip, rosehip
991
+ n12768682 : buckeye, horse chestnut, conker
992
+ n12985857 : coral fungus
993
+ n12998815 : agaric
994
+ n13037406 : gyromitra
995
+ n13040303 : stinkhorn, carrion fungus
996
+ n13044778 : earthstar
997
+ n13052670 : hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa
998
+ n13054560 : bolete
999
+ n13133613 : ear, spike, capitulum
1000
+ n15075141 : toilet tissue, toilet paper, bathroom tissue
app.py ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pandas as pd
3
+ import torch
4
+ import torchvision.transforms as transforms
5
+ from PIL import Image
6
+ import lightning as L
7
+ from src.models.classifier import ImageNetClassifier
8
+
9
+ # Define the class names (replace with your actual class names)
10
+ # Add your dog breed classes here
11
+ # Example:
12
+ # "Labrador", "German Shepherd", "Golden Retriever", etc.
13
+ class_names = [
14
+ "n01443537", "n01828970", "n02093859", "n02115913", "n02480495", "n02879718", "n03272562", "n03710637", "n03961711", "n04310018" "n04599235"
15
+ "n01440764", "n01824575", "n02093754", "n02115641", "n02457408", "n02877765", "n03272010", "n03710193", "n03958227", "n04296562" "n04597913"
16
+ "n01484850", "n01829413", "n02093991", "n02116738", "n02480855", "n02883205", "n03290653", "n03710721", "n03967562", "n04311004" "n04604644"
17
+ "n01491361", "n01833805", "n02094114", "n02117135", "n02481823", "n02892201", "n03291819", "n03717622", "n03970156", "n04311174" "n04606251"
18
+ "n01494475", "n01843065", "n02094258", "n02119022", "n02483362", "n02892767", "n03297495", "n03720891", "n03976467", "n04317175" "n04612504"
19
+ "n01496331", "n01843383", "n02094433", "n02119789", "n02483708", "n02894605", "n03314780", "n03721384", "n03976657", "n04325704" "n04613696"
20
+ "n01498041", "n01847000", "n02095314", "n02120079", "n02484975", "n02895154", "n03325584", "n03724870", "n03977966", "n04326547" "n06359193"
21
+ "n01514668", "n01855032", "n02095570", "n02120505", "n02486261", "n02906734", "n03337140", "n03729826", "n03980874", "n04328186" "n06596364"
22
+ "n01514859", "n01855672", "n02095889", "n02123045", "n02486410", "n02909870", "n03344393", "n03733131", "n03982430", "n04330267" "n06785654"
23
+ "n01518878", "n01860187", "n02096051", "n02123159", "n02487347", "n02910353", "n03345487", "n03733281", "n03983396", "n04332243" "n06794110"
24
+ "n01530575", "n01871265", "n02096177", "n02123394", "n02488291", "n02916936", "n03347037", "n03733805", "n03991062", "n04335435" "n06874185"
25
+ "n01531178", "n01872401", "n02096294", "n02123597", "n02488702", "n02917067", "n03355925", "n03742115", "n03992509", "n04336792" "n07248320"
26
+ "n01532829", "n01873310", "n02096437", "n02124075", "n02489166", "n02927161", "n03372029", "n03743016", "n03995372", "n04344873" "n07565083"
27
+ "n01534433", "n01877812", "n02096585", "n02125311", "n02490219", "n02930766", "n03376595", "n03759954", "n03998194", "n04346328" "n07579787"
28
+ "n01537544", "n01882714", "n02097047", "n02127052", "n02492035", "n02939185", "n03379051", "n03761084", "n04004767", "n04347754" "n07583066"
29
+ "n01558993", "n01883070", "n02097130", "n02128385", "n02492660", "n02948072", "n03384352", "n03763968", "n04005630", "n04350905" "n07584110"
30
+ "n01560419", "n01910747", "n02097209", "n02128757", "n02493509", "n02950826", "n03388043", "n03764736", "n04008634", "n04355338" "n07590611"
31
+ "n01580077", "n01914609", "n02097298", "n02128925", "n02493793", "n02951358", "n03388183", "n03769881", "n04009552", "n04355933" "n07613480"
32
+ "n01582220", "n01917289", "n02097474", "n02129165", "n02494079", "n02951585", "n03388549", "n03770439", "n04019541", "n04356056" "n07614500"
33
+ "n01592084", "n01924916", "n02097658", "n02129604", "n02497673", "n02963159", "n03393912", "n03770679", "n04023962", "n04357314" "n07615774"
34
+ "n01601694", "n01930112", "n02098105", "n02130308", "n02500267", "n02965783", "n03394916", "n03773504", "n04026417", "n04366367" "n07684084"
35
+ "n01608432", "n01943899", "n02098286", "n02132136", "n02504013", "n02966193", "n03400231", "n03775071", "n04033901", "n04367480" "n07693725"
36
+ "n01614925", "n01944390", "n02098413", "n02133161", "n02504458", "n02966687", "n03404251", "n03775546", "n04033995", "n04370456" "n07695742"
37
+ "n01616318", "n01945685", "n02099267", "n02134084", "n02509815", "n02971356", "n03417042", "n03776460", "n04037443", "n04371430" "n07697313"
38
+ "n01622779", "n01950731", "n02099429", "n02134418", "n02510455", "n02974003", "n03424325", "n03777568", "n04039381", "n04371774" "n07697537"
39
+ "n01629819", "n01955084", "n02099601", "n02137549", "n02514041", "n02977058", "n03425413", "n03777754", "n04040759", "n04372370" "n07711569"
40
+ "n01630670", "n01968897", "n02099712", "n02138441", "n02526121", "n02978881", "n03443371", "n03781244", "n04041544", "n04376876" "n07714571"
41
+ "n01631663", "n01978287", "n02099849", "n02165105", "n02536864", "n02979186", "n03444034", "n03782006", "n04044716", "n04380533" "n07714990"
42
+ "n01632458", "n01978455", "n02100236", "n02165456", "n02606052", "n02980441", "n03445777", "n03785016", "n04049303", "n04389033" "n07715103"
43
+ "n01632777", "n01980166", "n02100583", "n02167151", "n02607072", "n02981792", "n03445924", "n03786901", "n04065272", "n04392985" "n07716358"
44
+ "n01641577", "n01981276", "n02100735", "n02168699", "n02640242", "n02988304", "n03447447", "n03787032", "n04067472", "n04398044" "n07716906"
45
+ "n01644373", "n01983481", "n02100877", "n02169497", "n02641379", "n02992211", "n03447721", "n03788195", "n04069434", "n04399382" "n07717410"
46
+ "n01644900", "n01984695", "n02101006", "n02172182", "n02643566", "n02992529", "n03450230", "n03788365", "n04070727", "n04404412" "n07717556"
47
+ "n01664065", "n01985128", "n02101388", "n02174001", "n02655020", "n02999410", "n03452741", "n03791053", "n04074963", "n04409515" "n07718472"
48
+ "n01665541", "n01986214", "n02101556", "n02177972", "n02666196", "n03000134", "n03457902", "n03792782", "n04081281", "n04417672" "n07718747"
49
+ "n01667114", "n01990800", "n02102040", "n02190166", "n02667093", "n03000247", "n03459775", "n03792972", "n04086273", "n04418357" "n07720875"
50
+ "n01667778", "n02002556", "n02102177", "n02206856", "n02669723", "n03000684", "n03461385", "n03793489", "n04090263", "n04423845" "n07730033"
51
+ "n01669191", "n02002724", "n02102318", "n02219486", "n02672831", "n03014705", "n03467068", "n03794056", "n04099969", "n04428191" "n07734744"
52
+ "n01675722", "n02006656", "n02102480", "n02226429", "n02676566", "n03016953", "n03476684", "n03796401", "n04111531", "n04429376" "n07742313"
53
+ "n01677366", "n02007558", "n02102973", "n02229544", "n02687172", "n03017168", "n03476991", "n03803284", "n04116512", "n04435653" "n07745940"
54
+ "n01682714", "n02009229", "n02104029", "n02231487", "n02690373", "n03018349", "n03478589", "n03804744", "n04118538", "n04442312" "n07747607"
55
+ "n01685808", "n02009912", "n02104365", "n02233338", "n02692877", "n03026506", "n03481172", "n03814639", "n04118776", "n04443257" "n07749582"
56
+ "n01687978", "n02011460", "n02105056", "n02236044", "n02699494", "n03028079", "n03482405", "n03814906", "n04120489", "n04447861" "n07753113"
57
+ "n01688243", "n02012849", "n02105162", "n02256656", "n02701002", "n03032252", "n03483316", "n03825788", "n04125021", "n04456115" "n07753275"
58
+ "n01689811", "n02013706", "n02105251", "n02259212", "n02704792", "n03041632", "n03485407", "n03832673", "n04127249", "n04458633" "n07753592"
59
+ "n01692333", "n02017213", "n02105412", "n02264363", "n02708093", "n03042490", "n03485794", "n03837869", "n04131690", "n04461696" "n07754684"
60
+ "n01693334", "n02018207", "n02105505", "n02268443", "n02727426", "n03045698", "n03492542", "n03838899", "n04133789", "n04462240" "n07760859"
61
+ "n01694178", "n02018795", "n02105641", "n02268853", "n02730930", "n03047690", "n03494278", "n03840681", "n04136333", "n04465501" "n07768694"
62
+ "n01695060", "n02025239", "n02105855", "n02276258", "n02747177", "n03062245", "n03495258", "n03841143", "n04141076", "n04467665" "n07802026"
63
+ "n01697457", "n02027492", "n02106030", "n02277742", "n02749479", "n03063599", "n03496892", "n03843555", "n04141327", "n04476259" "n07831146"
64
+ "n01698640", "n02028035", "n02106166", "n02279972", "n02769748", "n03063689", "n03498962", "n03854065", "n04141975", "n04479046" "n07836838"
65
+ "n01704323", "n02033041", "n02106382", "n02280649", "n02776631", "n03065424", "n03527444", "n03857828", "n04146614", "n04482393" "n07860988"
66
+ "n01728572", "n02037110", "n02106550", "n02281406", "n02777292", "n03075370", "n03529860", "n03866082", "n04147183", "n04483307" "n07871810"
67
+ "n01728920", "n02051845", "n02106662", "n02281787", "n02782093", "n03085013", "n03530642", "n03868242", "n04149813", "n04485082" "n07873807"
68
+ "n01729322", "n02056570", "n02107142", "n02317335", "n02783161", "n03089624", "n03532672", "n03868863", "n04152593", "n04486054" "n07875152"
69
+ "n01729977", "n02058221", "n02107312", "n02319095", "n02786058", "n03095699", "n03534580", "n03871628", "n04153751", "n04487081" "n07880968"
70
+ "n01734418", "n02066245", "n02107574", "n02321529", "n02787622", "n03100240", "n03535780", "n03873416", "n04154565", "n04487394" "n07892512"
71
+ "n01735189", "n02071294", "n02107683", "n02325366", "n02788148", "n03109150", "n03538406", "n03874293", "n04162706", "n04493381" "n07920052"
72
+ "n01737021", "n02074367", "n02107908", "n02326432", "n02790996", "n03110669", "n03544143", "n03874599", "n04179913", "n04501370" "n07930864"
73
+ "n01739381", "n02077923", "n02108000", "n02328150", "n02791124", "n03124043", "n03584254", "n03876231", "n04192698", "n04505470" "n07932039"
74
+ "n01740131", "n02085620", "n02108089", "n02342885", "n02791270", "n03124170", "n03584829", "n03877472", "n04200800", "n04507155" "n09193705"
75
+ "n01742172", "n02085782", "n02108422", "n02346627", "n02793495", "n03125729", "n03590841", "n03877845", "n04201297", "n04509417" "n09229709"
76
+ "n01744401", "n02085936", "n02108551", "n02356798", "n02794156", "n03126707", "n03594734", "n03884397", "n04204238", "n04515003" "n09246464"
77
+ "n01748264", "n02086079", "n02108915", "n02361337", "n02795169", "n03127747", "n03594945", "n03887697", "n04204347", "n04517823" "n09256479"
78
+ "n01749939", "n02086240", "n02109047", "n02363005", "n02797295", "n03127925", "n03595614", "n03888257", "n04208210", "n04522168" "n09288635"
79
+ "n01751748", "n02086646", "n02109525", "n02364673", "n02799071", "n03131574", "n03598930", "n03888605", "n04209133", "n04523525" "n09332890"
80
+ "n01753488", "n02086910", "n02109961", "n02389026", "n02802426", "n03133878", "n03599486", "n03891251", "n04209239", "n04525038" "n09399592"
81
+ "n01755581", "n02087046", "n02110063", "n02391049", "n02804414", "n03134739", "n03602883", "n03891332", "n04228054", "n04525305" "n09421951"
82
+ "n01756291", "n02087394", "n02110185", "n02395406", "n02804610", "n03141823", "n03617480", "n03895866", "n04229816", "n04532106" "n09428293"
83
+ "n01768244", "n02088094", "n02110341", "n02396427", "n02807133", "n03146219", "n03623198", "n03899768", "n04235860", "n04532670" "n09468604"
84
+ "n01770081", "n02088238", "n02110627", "n02397096", "n02808304", "n03160309", "n03627232", "n03902125", "n04238763", "n04536866" "n09472597"
85
+ "n01770393", "n02088364", "n02110806", "n02398521", "n02808440", "n03179701", "n03630383", "n03903868", "n04239074", "n04540053" "n09835506"
86
+ "n01773157", "n02088466", "n02110958", "n02403003", "n02814533", "n03180011", "n03633091", "n03908618", "n04243546", "n04542943" "n10148035"
87
+ "n01773549", "n02088632", "n02111129", "n02408429", "n02814860", "n03187595", "n03637318", "n03908714", "n04251144", "n04548280" "n10565667"
88
+ "n01773797", "n02089078", "n02111277", "n02410509", "n02815834", "n03188531", "n03642806", "n03916031", "n04252077", "n04548362" "n11879895"
89
+ "n01774384", "n02089867", "n02111500", "n02412080", "n02817516", "n03196217", "n03649909", "n03920288", "n04252225", "n04550184" "n11939491"
90
+ "n01774750", "n02089973", "n02111889", "n02415577", "n02823428", "n03197337", "n03657121", "n03924679", "n04254120", "n04552348" "n12057211"
91
+ "n01775062", "n02090379", "n02112018", "n02417914", "n02823750", "n03201208", "n03658185", "n03929660", "n04254680", "n04553703" "n12144580"
92
+ "n01776313", "n02090622", "n02112137", "n02422106", "n02825657", "n03207743", "n03661043", "n03929855", "n04254777", "n04554684" "n12267677"
93
+ "n01784675", "n02090721", "n02112350", "n02422699", "n02834397", "n03207941", "n03662601", "n03930313", "n04258138", "n04557648" "n12620546"
94
+ "n01795545", "n02091032", "n02112706", "n02423022", "n02835271", "n03208938", "n03666591", "n03930630", "n04259630", "n04560804" "n12768682"
95
+ "n01796340", "n02091134", "n02113023", "n02437312", "n02837789", "n03216828", "n03670208", "n03933933", "n04263257", "n04562935" "n12985857"
96
+ "n01797886", "n02091244", "n02113186", "n02437616", "n02840245", "n03218198", "n03673027", "n03935335", "n04264628", "n04579145" "n12998815"
97
+ "n01798484", "n02091467", "n02113624", "n02441942", "n02841315", "n03220513", "n03676483", "n03937543", "n04265275", "n04579432" "n13037406"
98
+ "n01806143", "n02091635", "n02113712", "n02442845", "n02843684", "n03223299", "n03680355", "n03938244", "n04266014", "n04584207" "n13040303"
99
+ "n01806567", "n02091831", "n02113799", "n02443114", "n02859443", "n03240683", "n03690938", "n03942813", "n04270147", "n04589890" "n13044778"
100
+ "n01807496", "n02092002", "n02113978", "n02443484", "n02860847", "n03249569", "n03691459", "n03944341", "n04273569", "n04590129" "n13052670"
101
+ "n01817953", "n02092339", "n02114367", "n02444819", "n02865351", "n03250847", "n03692522", "n03947888", "n04275548", "n04591157" "n13054560"
102
+ "n01818515", "n02093256", "n02114548", "n02445715", "n02869837", "n03255030", "n03697007", "n03950228", "n04277352", "n04591713" "n13133613"
103
+ "n01819313", "n02093428", "n02114712", "n02447366", "n02870880", "n03259280", "n03706229", "n03954731", "n04285008", "n04592741" "n15075141"
104
+ "n01820546", "n02093647", "n02114855", "n02454379", "n02871525", "n03271574", "n03709823", "n03956157", "n04286575", "n04596742"]
105
+ mapping_file = 'LOC_synset_mapping.txt'
106
+ mapping_file_df = pd.read_csv(mapping_file, header = None, sep =':')
107
+ mapping_file_dict = dict(zip(mapping_file_df.iloc[:, 0].str.strip(), mapping_file_df.iloc[:, 1].str.strip()))
108
+ class_names_dict = {'n01440764': 0, 'n01443537': 1, 'n01484850': 2, 'n01491361': 3, 'n01494475': 4, 'n01496331': 5, 'n01498041': 6, 'n01514668': 7, 'n01514859': 8
109
+ , 'n01518878': 9, 'n01530575': 10, 'n01531178': 11, 'n01532829': 12, 'n01534433': 13, 'n01537544': 14, 'n01558993': 15, 'n01560419': 16
110
+ , 'n01580077': 17, 'n01582220': 18, 'n01592084': 19, 'n01601694': 20, 'n01608432': 21, 'n01614925': 22, 'n01616318': 23, 'n01622779': 24
111
+ , 'n01629819': 25, 'n01630670': 26, 'n01631663': 27, 'n01632458': 28, 'n01632777': 29, 'n01641577': 30, 'n01644373': 31, 'n01644900': 32
112
+ , 'n01664065': 33, 'n01665541': 34, 'n01667114': 35, 'n01667778': 36, 'n01669191': 37, 'n01675722': 38, 'n01677366': 39, 'n01682714': 40
113
+ , 'n01685808': 41, 'n01687978': 42, 'n01688243': 43, 'n01689811': 44, 'n01692333': 45, 'n01693334': 46, 'n01694178': 47, 'n01695060': 48
114
+ , 'n01697457': 49, 'n01698640': 50, 'n01704323': 51, 'n01728572': 52, 'n01728920': 53, 'n01729322': 54, 'n01729977': 55, 'n01734418': 56
115
+ , 'n01735189': 57, 'n01737021': 58, 'n01739381': 59, 'n01740131': 60, 'n01742172': 61, 'n01744401': 62, 'n01748264': 63, 'n01749939': 64
116
+ , 'n01751748': 65, 'n01753488': 66, 'n01755581': 67, 'n01756291': 68, 'n01768244': 69, 'n01770081': 70, 'n01770393': 71, 'n01773157': 72
117
+ , 'n01773549': 73, 'n01773797': 74, 'n01774384': 75, 'n01774750': 76, 'n01775062': 77, 'n01776313': 78, 'n01784675': 79, 'n01795545': 80
118
+ , 'n01796340': 81, 'n01797886': 82, 'n01798484': 83, 'n01806143': 84, 'n01806567': 85, 'n01807496': 86, 'n01817953': 87, 'n01818515': 88
119
+ , 'n01819313': 89, 'n01820546': 90, 'n01824575': 91, 'n01828970': 92, 'n01829413': 93, 'n01833805': 94, 'n01843065': 95, 'n01843383': 96
120
+ , 'n01847000': 97, 'n01855032': 98, 'n01855672': 99, 'n01860187': 100, 'n01871265': 101, 'n01872401': 102, 'n01873310': 103, 'n01877812': 104
121
+ , 'n01882714': 105, 'n01883070': 106, 'n01910747': 107, 'n01914609': 108, 'n01917289': 109, 'n01924916': 110, 'n01930112': 111, 'n01943899': 112
122
+ , 'n01944390': 113, 'n01945685': 114, 'n01950731': 115, 'n01955084': 116, 'n01968897': 117, 'n01978287': 118, 'n01978455': 119, 'n01980166': 120
123
+ , 'n01981276': 121, 'n01983481': 122, 'n01984695': 123, 'n01985128': 124, 'n01986214': 125, 'n01990800': 126, 'n02002556': 127, 'n02002724': 128
124
+ , 'n02006656': 129, 'n02007558': 130, 'n02009229': 131, 'n02009912': 132, 'n02011460': 133, 'n02012849': 134, 'n02013706': 135, 'n02017213': 136
125
+ , 'n02018207': 137, 'n02018795': 138, 'n02025239': 139, 'n02027492': 140, 'n02028035': 141, 'n02033041': 142, 'n02037110': 143, 'n02051845': 144, 'n02056570': 145, 'n02058221': 146, 'n02066245': 147, 'n02071294': 148, 'n02074367': 149, 'n02077923': 150
126
+ , 'n02085620': 151, 'n02085782': 152, 'n02085936': 153, 'n02086079': 154, 'n02086240': 155, 'n02086646': 156, 'n02086910': 157, 'n02087046': 158, 'n02087394': 159, 'n02088094': 160, 'n02088238': 161, 'n02088364': 162, 'n02088466': 163, 'n02088632': 164
127
+ , 'n02089078': 165, 'n02089867': 166, 'n02089973': 167, 'n02090379': 168, 'n02090622': 169, 'n02090721': 170, 'n02091032': 171, 'n02091134': 172, 'n02091244': 173, 'n02091467': 174, 'n02091635': 175, 'n02091831': 176, 'n02092002': 177, 'n02092339': 178
128
+ , 'n02093256': 179, 'n02093428': 180, 'n02093647': 181, 'n02093754': 182, 'n02093859': 183, 'n02093991': 184, 'n02094114': 185, 'n02094258': 186, 'n02094433': 187, 'n02095314': 188, 'n02095570': 189, 'n02095889': 190, 'n02096051': 191, 'n02096177': 192
129
+ , 'n02096294': 193, 'n02096437': 194, 'n02096585': 195, 'n02097047': 196, 'n02097130': 197, 'n02097209': 198, 'n02097298': 199, 'n02097474': 200, 'n02097658': 201, 'n02098105': 202, 'n02098286': 203, 'n02098413': 204, 'n02099267': 205, 'n02099429': 206
130
+ , 'n02099601': 207, 'n02099712': 208, 'n02099849': 209, 'n02100236': 210, 'n02100583': 211, 'n02100735': 212, 'n02100877': 213, 'n02101006': 214, 'n02101388': 215, 'n02101556': 216, 'n02102040': 217, 'n02102177': 218, 'n02102318': 219, 'n02102480': 220
131
+ , 'n02102973': 221, 'n02104029': 222, 'n02104365': 223, 'n02105056': 224, 'n02105162': 225, 'n02105251': 226, 'n02105412': 227, 'n02105505': 228, 'n02105641': 229, 'n02105855': 230, 'n02106030': 231, 'n02106166': 232, 'n02106382': 233, 'n02106550': 234
132
+ , 'n02106662': 235, 'n02107142': 236, 'n02107312': 237, 'n02107574': 238, 'n02107683': 239, 'n02107908': 240, 'n02108000': 241, 'n02108089': 242, 'n02108422': 243, 'n02108551': 244, 'n02108915': 245, 'n02109047': 246, 'n02109525': 247, 'n02109961': 248
133
+ , 'n02110063': 249, 'n02110185': 250, 'n02110341': 251, 'n02110627': 252, 'n02110806': 253, 'n02110958': 254, 'n02111129': 255, 'n02111277': 256, 'n02111500': 257, 'n02111889': 258, 'n02112018': 259, 'n02112137': 260, 'n02112350': 261, 'n02112706': 262
134
+ , 'n02113023': 263, 'n02113186': 264, 'n02113624': 265, 'n02113712': 266, 'n02113799': 267, 'n02113978': 268, 'n02114367': 269, 'n02114548': 270, 'n02114712': 271, 'n02114855': 272, 'n02115641': 273, 'n02115913': 274, 'n02116738': 275, 'n02117135': 276
135
+ , 'n02119022': 277, 'n02119789': 278, 'n02120079': 279, 'n02120505': 280, 'n02123045': 281, 'n02123159': 282, 'n02123394': 283, 'n02123597': 284, 'n02124075': 285, 'n02125311': 286, 'n02127052': 287, 'n02128385': 288, 'n02128757': 289, 'n02128925': 290
136
+ , 'n02129165': 291, 'n02129604': 292, 'n02130308': 293, 'n02132136': 294, 'n02133161': 295, 'n02134084': 296, 'n02134418': 297, 'n02137549': 298, 'n02138441': 299, 'n02165105': 300, 'n02165456': 301, 'n02167151': 302, 'n02168699': 303, 'n02169497': 304
137
+ , 'n02172182': 305, 'n02174001': 306, 'n02177972': 307, 'n02190166': 308, 'n02206856': 309
138
+ , 'n02219486': 310, 'n02226429': 311, 'n02229544': 312, 'n02231487': 313, 'n02233338': 314, 'n02236044': 315, 'n02256656': 316, 'n02259212': 317, 'n02264363': 318, 'n02268443': 319, 'n02268853': 320, 'n02276258': 321, 'n02277742': 322, 'n02279972': 323, 'n02280649': 324, 'n02281406': 325
139
+ , 'n02281787': 326, 'n02317335': 327, 'n02319095': 328, 'n02321529': 329, 'n02325366': 330, 'n02326432': 331, 'n02328150': 332, 'n02342885': 333, 'n02346627': 334, 'n02356798': 335, 'n02361337': 336, 'n02363005': 337, 'n02364673': 338, 'n02389026': 339, 'n02391049': 340, 'n02395406': 341
140
+ , 'n02396427': 342, 'n02397096': 343, 'n02398521': 344, 'n02403003': 345, 'n02408429': 346, 'n02410509': 347, 'n02412080': 348, 'n02415577': 349, 'n02417914': 350, 'n02422106': 351, 'n02422699': 352, 'n02423022': 353, 'n02437312': 354, 'n02437616': 355, 'n02441942': 356, 'n02442845': 357
141
+ , 'n02443114': 358, 'n02443484': 359, 'n02444819': 360, 'n02445715': 361, 'n02447366': 362, 'n02454379': 363, 'n02457408': 364, 'n02480495': 365, 'n02480855': 366, 'n02481823': 367, 'n02483362': 368, 'n02483708': 369, 'n02484975': 370, 'n02486261': 371, 'n02486410': 372, 'n02487347': 373
142
+ , 'n02488291': 374, 'n02488702': 375, 'n02489166': 376, 'n02490219': 377, 'n02492035': 378, 'n02492660': 379, 'n02493509': 380, 'n02493793': 381, 'n02494079': 382, 'n02497673': 383, 'n02500267': 384, 'n02504013': 385, 'n02504458': 386, 'n02509815': 387, 'n02510455': 388, 'n02514041': 389
143
+ , 'n02526121': 390, 'n02536864': 391, 'n02606052': 392, 'n02607072': 393, 'n02640242': 394, 'n02641379': 395, 'n02643566': 396, 'n02655020': 397, 'n02666196': 398, 'n02667093': 399, 'n02669723': 400, 'n02672831': 401, 'n02676566': 402, 'n02687172': 403, 'n02690373': 404, 'n02692877': 405
144
+ , 'n02699494': 406, 'n02701002': 407, 'n02704792': 408, 'n02708093': 409, 'n02727426': 410, 'n02730930': 411, 'n02747177': 412, 'n02749479': 413, 'n02769748': 414, 'n02776631': 415, 'n02777292': 416, 'n02782093': 417, 'n02783161': 418, 'n02786058': 419, 'n02787622': 420, 'n02788148': 421
145
+ , 'n02790996': 422, 'n02791124': 423, 'n02791270': 424, 'n02793495': 425, 'n02794156': 426, 'n02795169': 427, 'n02797295': 428, 'n02799071': 429, 'n02802426': 430, 'n02804414': 431, 'n02804610': 432, 'n02807133': 433, 'n02808304': 434, 'n02808440': 435, 'n02814533': 436, 'n02814860': 437
146
+ , 'n02815834': 438, 'n02817516': 439, 'n02823428': 440, 'n02823750': 441, 'n02825657': 442, 'n02834397': 443, 'n02835271': 444, 'n02837789': 445, 'n02840245': 446, 'n02841315': 447, 'n02843684': 448, 'n02859443': 449, 'n02860847': 450, 'n02865351': 451, 'n02869837': 452, 'n02870880': 453
147
+ , 'n02871525': 454, 'n02877765': 455, 'n02879718': 456, 'n02883205': 457, 'n02892201': 458, 'n02892767': 459, 'n02894605': 460, 'n02895154': 461, 'n02906734': 462, 'n02909870': 463, 'n02910353': 464, 'n02916936': 465, 'n02917067': 466, 'n02927161': 467, 'n02930766': 468, 'n02939185': 469
148
+ , 'n02948072': 470, 'n02950826': 471, 'n02951358': 472, 'n02951585': 473, 'n02963159': 474, 'n02965783': 475, 'n02966193': 476, 'n02966687': 477, 'n02971356': 478, 'n02974003': 479, 'n02977058': 480, 'n02978881': 481, 'n02979186': 482, 'n02980441': 483, 'n02981792': 484, 'n02988304': 485
149
+ , 'n02992211': 486, 'n02992529': 487, 'n02999410': 488, 'n03000134': 489, 'n03000247': 490, 'n03000684': 491, 'n03014705': 492, 'n03016953': 493, 'n03017168': 494, 'n03018349': 495, 'n03026506': 496, 'n03028079': 497, 'n03032252': 498, 'n03041632': 499, 'n03042490': 500
150
+ , 'n03045698': 501, 'n03047690': 502, 'n03062245': 503, 'n03063599': 504, 'n03063689': 505, 'n03065424': 506, 'n03075370': 507, 'n03085013': 508, 'n03089624': 509, 'n03095699': 510, 'n03100240': 511, 'n03109150': 512, 'n03110669': 513, 'n03124043': 514, 'n03124170': 515, 'n03125729': 516
151
+ , 'n03126707': 517, 'n03127747': 518, 'n03127925': 519, 'n03131574': 520, 'n03133878': 521, 'n03134739': 522, 'n03141823': 523, 'n03146219': 524, 'n03160309': 525, 'n03179701': 526, 'n03180011': 527, 'n03187595': 528, 'n03188531': 529, 'n03196217': 530, 'n03197337': 531, 'n03201208': 532
152
+ , 'n03207743': 533, 'n03207941': 534, 'n03208938': 535, 'n03216828': 536, 'n03218198': 537, 'n03220513': 538, 'n03223299': 539, 'n03240683': 540, 'n03249569': 541, 'n03250847': 542, 'n03255030': 543, 'n03259280': 544, 'n03271574': 545, 'n03272010': 546, 'n03272562': 547, 'n03290653': 548
153
+ , 'n03291819': 549, 'n03297495': 550, 'n03314780': 551, 'n03325584': 552, 'n03337140': 553, 'n03344393': 554, 'n03345487': 555, 'n03347037': 556, 'n03355925': 557, 'n03372029': 558, 'n03376595': 559, 'n03379051': 560, 'n03384352': 561, 'n03388043': 562, 'n03388183': 563, 'n03388549': 564
154
+ , 'n03393912': 565, 'n03394916': 566, 'n03400231': 567, 'n03404251': 568, 'n03417042': 569, 'n03424325': 570, 'n03425413': 571, 'n03443371': 572, 'n03444034': 573, 'n03445777': 574, 'n03445924': 575, 'n03447447': 576, 'n03447721': 577, 'n03450230': 578, 'n03452741': 579, 'n03457902': 580
155
+ , 'n03459775': 581, 'n03461385': 582, 'n03467068': 583, 'n03476684': 584, 'n03476991': 585, 'n03478589': 586, 'n03481172': 587, 'n03482405': 588, 'n03483316': 589, 'n03485407': 590, 'n03485794': 591, 'n03492542': 592, 'n03494278': 593, 'n03495258': 594, 'n03496892': 595, 'n03498962': 596
156
+ , 'n03527444': 597, 'n03529860': 598, 'n03530642': 599,
157
+ 'n03532672': 600, 'n03534580': 601, 'n03535780': 602, 'n03538406': 603, 'n03544143': 604, 'n03584254': 605, 'n03584829': 606, 'n03590841': 607, 'n03594734': 608, 'n03594945': 609, 'n03595614': 610, 'n03598930': 611, 'n03599486': 612, 'n03602883': 613, 'n03617480': 614, 'n03623198': 615
158
+ , 'n03627232': 616, 'n03630383': 617, 'n03633091': 618, 'n03637318': 619, 'n03642806': 620, 'n03649909': 621, 'n03657121': 622, 'n03658185': 623, 'n03661043': 624, 'n03662601': 625, 'n03666591': 626, 'n03670208': 627, 'n03673027': 628, 'n03676483': 629, 'n03680355': 630, 'n03690938': 631
159
+ , 'n03691459': 632, 'n03692522': 633, 'n03697007': 634, 'n03706229': 635, 'n03709823': 636, 'n03710193': 637, 'n03710637': 638, 'n03710721': 639, 'n03717622': 640, 'n03720891': 641, 'n03721384': 642, 'n03724870': 643, 'n03729826': 644, 'n03733131': 645, 'n03733281': 646, 'n03733805': 647
160
+ , 'n03742115': 648, 'n03743016': 649, 'n03759954': 650, 'n03761084': 651, 'n03763968': 652, 'n03764736': 653, 'n03769881': 654, 'n03770439': 655, 'n03770679': 656, 'n03773504': 657, 'n03775071': 658, 'n03775546': 659, 'n03776460': 660, 'n03777568': 661, 'n03777754': 662, 'n03781244': 663, 'n03782006': 664, 'n03785016': 665
161
+ , 'n03786901': 666, 'n03787032': 667, 'n03788195': 668, 'n03788365': 669, 'n03791053': 670, 'n03792782': 671, 'n03792972': 672, 'n03793489': 673, 'n03794056': 674, 'n03796401': 675, 'n03803284': 676, 'n03804744': 677, 'n03814639': 678, 'n03814906': 679, 'n03825788': 680, 'n03832673': 681
162
+ , 'n03837869': 682, 'n03838899': 683, 'n03840681': 684, 'n03841143': 685, 'n03843555': 686, 'n03854065': 687, 'n03857828': 688, 'n03866082': 689, 'n03868242': 690, 'n03868863': 691, 'n03871628': 692, 'n03873416': 693, 'n03874293': 694, 'n03874599': 695, 'n03876231': 696, 'n03877472': 697
163
+ , 'n03877845': 698, 'n03884397': 699, 'n03887697': 700, 'n03888257': 701, 'n03888605': 702, 'n03891251': 703, 'n03891332': 704, 'n03895866': 705, 'n03899768': 706, 'n03902125': 707, 'n03903868': 708, 'n03908618': 709, 'n03908714': 710, 'n03916031': 711, 'n03920288': 712, 'n03924679': 713
164
+ , 'n03929660': 714, 'n03929855': 715, 'n03930313': 716, 'n03930630': 717, 'n03933933': 718, 'n03935335': 719, 'n03937543': 720, 'n03938244': 721, 'n03942813': 722, 'n03944341': 723, 'n03947888': 724, 'n03950228': 725, 'n03954731': 726, 'n03956157': 727, 'n03958227': 728, 'n03961711': 729
165
+ , 'n03967562': 730, 'n03970156': 731, 'n03976467': 732, 'n03976657': 733, 'n03977966': 734, 'n03980874': 735, 'n03982430': 736, 'n03983396': 737, 'n03991062': 738, 'n03992509': 739, 'n03995372': 740, 'n03998194': 741, 'n04004767': 742, 'n04005630': 743, 'n04008634': 744, 'n04009552': 745
166
+ , 'n04019541': 746, 'n04023962': 747, 'n04026417': 748, 'n04033901': 749, 'n04033995': 750, 'n04037443': 751, 'n04039381': 752, 'n04040759': 753, 'n04041544': 754, 'n04044716': 755, 'n04049303': 756, 'n04065272': 757, 'n04067472': 758, 'n04069434': 759, 'n04070727': 760, 'n04074963': 761
167
+ , 'n04081281': 762, 'n04086273': 763, 'n04090263': 764, 'n04099969': 765, 'n04111531': 766, 'n04116512': 767, 'n04118538': 768, 'n04118776': 769, 'n04120489': 770, 'n04125021': 771, 'n04127249': 772, 'n04131690': 773, 'n04133789': 774, 'n04136333': 775, 'n04141076': 776, 'n04141327': 777
168
+ , 'n04141975': 778, 'n04146614': 779, 'n04147183': 780, 'n04149813': 781, 'n04152593': 782, 'n04153751': 783, 'n04154565': 784, 'n04162706': 785, 'n04179913': 786, 'n04192698': 787, 'n04200800': 788, 'n04201297': 789, 'n04204238': 790, 'n04204347': 791, 'n04208210': 792, 'n04209133': 793
169
+ , 'n04209239': 794, 'n04228054': 795, 'n04229816': 796, 'n04235860': 797, 'n04238763': 798, 'n04239074': 799, 'n04243546': 800, 'n04251144': 801, 'n04252077': 802, 'n04252225': 803, 'n04254120': 804, 'n04254680': 805, 'n04254777': 806, 'n04258138': 807, 'n04259630': 808, 'n04263257': 809
170
+ , 'n04264628': 810, 'n04265275': 811, 'n04266014': 812, 'n04270147': 813, 'n04273569': 814, 'n04275548': 815, 'n04277352': 816, 'n04285008': 817, 'n04286575': 818, 'n04296562': 819, 'n04310018': 820, 'n04311004': 821, 'n04311174': 822, 'n04317175': 823, 'n04325704': 824, 'n04326547': 825
171
+ , 'n04328186': 826, 'n04330267': 827, 'n04332243': 828, 'n04335435': 829, 'n04336792': 830, 'n04344873': 831, 'n04346328': 832, 'n04347754': 833, 'n04350905': 834, 'n04355338': 835, 'n04355933': 836, 'n04356056': 837, 'n04357314': 838, 'n04366367': 839, 'n04367480': 840, 'n04370456': 841
172
+ , 'n04371430': 842, 'n04371774': 843, 'n04372370': 844, 'n04376876': 845, 'n04380533': 846, 'n04389033': 847, 'n04392985': 848, 'n04398044': 849, 'n04399382': 850, 'n04404412': 851, 'n04409515': 852, 'n04417672': 853, 'n04418357': 854, 'n04423845': 855, 'n04428191': 856, 'n04429376': 857
173
+ , 'n04435653': 858, 'n04442312': 859, 'n04443257': 860, 'n04447861': 861, 'n04456115': 862, 'n04458633': 863, 'n04461696': 864, 'n04462240': 865, 'n04465501': 866, 'n04467665': 867, 'n04476259': 868, 'n04479046': 869, 'n04482393': 870, 'n04483307': 871, 'n04485082': 872, 'n04486054': 873
174
+ , 'n04487081': 874, 'n04487394': 875, 'n04493381': 876, 'n04501370': 877, 'n04505470': 878, 'n04507155': 879, 'n04509417': 880, 'n04515003': 881, 'n04517823': 882, 'n04522168': 883, 'n04523525': 884, 'n04525038': 885, 'n04525305': 886, 'n04532106': 887, 'n04532670': 888, 'n04536866': 889
175
+ , 'n04540053': 890, 'n04542943': 891, 'n04548280': 892, 'n04548362': 893, 'n04550184': 894, 'n04552348': 895, 'n04553703': 896, 'n04554684': 897, 'n04557648': 898, 'n04560804': 899
176
+ , 'n04562935': 900, 'n04579145': 901, 'n04579432': 902, 'n04584207': 903, 'n04589890': 904, 'n04590129': 905, 'n04591157': 906, 'n04591713': 907, 'n04592741': 908, 'n04596742': 909, 'n04597913': 910, 'n04599235': 911, 'n04604644': 912, 'n04606251': 913, 'n04612504': 914, 'n04613696': 915
177
+ , 'n06359193': 916, 'n06596364': 917, 'n06785654': 918, 'n06794110': 919, 'n06874185': 920, 'n07248320': 921, 'n07565083': 922, 'n07579787': 923, 'n07583066': 924, 'n07584110': 925, 'n07590611': 926, 'n07613480': 927, 'n07614500': 928, 'n07615774': 929, 'n07684084': 930, 'n07693725': 931
178
+ , 'n07695742': 932, 'n07697313': 933, 'n07697537': 934, 'n07711569': 935, 'n07714571': 936, 'n07714990': 937, 'n07715103': 938, 'n07716358': 939, 'n07716906': 940, 'n07717410': 941, 'n07717556': 942, 'n07718472': 943, 'n07718747': 944, 'n07720875': 945, 'n07730033': 946, 'n07734744': 947
179
+ , 'n07742313': 948, 'n07745940': 949, 'n07747607': 950, 'n07749582': 951, 'n07753113': 952, 'n07753275': 953, 'n07753592': 954, 'n07754684': 955, 'n07760859': 956, 'n07768694': 957, 'n07802026': 958, 'n07831146': 959, 'n07836838': 960, 'n07860988': 961, 'n07871810': 962, 'n07873807': 963
180
+ , 'n07875152': 964, 'n07880968': 965, 'n07892512': 966, 'n07920052': 967, 'n07930864': 968, 'n07932039': 969, 'n09193705': 970, 'n09229709': 971, 'n09246464': 972, 'n09256479': 973, 'n09288635': 974, 'n09332890': 975, 'n09399592': 976, 'n09421951': 977, 'n09428293': 978, 'n09468604': 979
181
+ , 'n09472597': 980, 'n09835506': 981, 'n10148035': 982, 'n10565667': 983, 'n11879895': 984, 'n11939491': 985, 'n12057211': 986, 'n12144580': 987, 'n12267677': 988, 'n12620546': 989, 'n12768682': 990, 'n12985857': 991, 'n12998815': 992, 'n13037406': 993, 'n13040303': 994, 'n13044778': 995
182
+ , 'n13052670': 996, 'n13054560': 997, 'n13133613': 998, 'n15075141': 999}
183
+
184
+ class_names_dict = dict(sorted(class_names_dict.items(), key=lambda x: x[1]))
185
+ class_names_2 = list(class_names_dict.keys())
186
+ def load_model():
187
+ # Load the trained model
188
+ model = ImageNetClassifier.load_from_checkpoint(
189
+ "logs/checkpoints/epoch=58-val_loss=1.46.ckpt",
190
+ map_location="cuda" if torch.cuda.is_available() else "cpu",
191
+ #lr=6.28E-02, # This parameter is required but won't be used for inference
192
+ num_classes=1000 # Make sure this matches your trained model
193
+ )
194
+ model.eval()
195
+ return model
196
+
197
+ # Initialize the model
198
+ model = load_model()
199
+ model.eval()
200
+
201
+ # Define the preprocessing transforms
202
+ transform = transforms.Compose([
203
+ transforms.Resize(size=256, antialias=True),
204
+ transforms.CenterCrop(224),
205
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
206
+ transforms.ToTensor(),
207
+ ])
208
+
209
+ def predict_breed(image):
210
+ # Convert to PIL Image if needed
211
+ if not isinstance(image, Image.Image):
212
+ image = Image.fromarray(image)
213
+
214
+ # Preprocess the image
215
+ # Convert to tensor
216
+ to_tensor = transforms.ToTensor()
217
+ img_tensor = to_tensor(image).unsqueeze(0)
218
+
219
+ # Make prediction
220
+ with torch.no_grad():
221
+ outputs = model(img_tensor)
222
+ probabilities = torch.nn.functional.softmax(outputs, dim=1)
223
+
224
+ # Get top 5 predictions
225
+ top5_prob, top5_indices = torch.topk(probabilities, 5)
226
+ print('top5_prob', top5_prob)
227
+ print('top5_indices', top5_indices)
228
+ # Create results dictionary
229
+ results = {
230
+ class_names_2[idx.item()]: prob.item()
231
+ for prob, idx in zip(top5_prob[0], top5_indices[0])
232
+ }
233
+ print(results)
234
+ results = {mapping_file_dict[old_key]: results[old_key] for old_key in results.keys()}
235
+ print(results)
236
+
237
+ return results
238
+
239
+ # Create Gradio interface
240
+ iface = gr.Interface(
241
+ fn=predict_breed,
242
+ inputs=gr.Image(),
243
+ outputs=gr.Label(num_top_classes=5),
244
+ title="ImageNet-1K ResNet50 Classifier",
245
+ description="Upload a image to identify its classification!",
246
+ examples=[
247
+ # Add paths to example images here
248
+ # ["examples/dog1.jpg"],
249
+ # ["examples/dog2.jpg"]
250
+ # ['data/test/ILSVRC2012_test_00000004.JPEG'],
251
+ # ['data/test/ILSVRC2012_test_00000178.JPEG'],
252
+ # ["data/test/ILSVRC2012_test_00000188.JPEG"],
253
+ # ["data/test/ILSVRC2012_test_00000158.JPEG"],
254
+ ]
255
+ )
256
+
257
+ # Launch the app
258
+ if __name__ == "__main__":
259
+ iface.launch()
260
+
data/.DS_Store ADDED
Binary file (8.2 kB). View file
 
data/test/.DS_Store ADDED
Binary file (6.15 kB). View file
 
logs/.DS_Store ADDED
Binary file (8.2 kB). View file
 
logs/checkpoints/.DS_Store ADDED
Binary file (6.15 kB). View file
 
logs/checkpoints/epoch=58-val_loss=1.46.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6759f10d8a0d9f99681446be1794a905b29d3d2f74a1f20a5ff1efb7efb80d7c
3
+ size 307147814
logs/image_net_classifications/.DS_Store ADDED
Binary file (6.15 kB). View file
 
logs/image_net_classifications/version_0/events.out.tfevents.1735769543.ip-172-31-33-164.61673.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8a08847e84fc8fb37c80a78a50c1ea34729b16035a241de89f32818ac475a9b
3
+ size 393
logs/image_net_classifications/version_0/hparams.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ lr: 0.01
logs/image_net_classifications/version_1/events.out.tfevents.1735770290.ip-172-31-33-164.62686.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9ade3dd1f1ca8922e623b66ce98ef5da97d691b55d611133c8bdaaec40996d1
3
+ size 16563
logs/image_net_classifications/version_1/hparams.yaml ADDED
@@ -0,0 +1 @@
 
 
1
+ lr: 0.01
pyproject.toml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.poetry]
2
+ name = "dog-breed-classifier"
3
+ version = "0.1.0"
4
+ description = "Dog Breed Classification using PyTorch Lightning"
5
+ authors = ["Your Name <your.email@example.com>"]
6
+
7
+ [tool.poetry.dependencies]
8
+ python = "^3.8"
9
+ pytorch-lightning = "2.4.0"
10
+ torchviz = "0.0.2"
11
+ timm = "1.0.9"
12
+ split-folders = "0.5.1"
13
+ torch = "^2.0.0"
14
+ torchvision = "^0.15.0"
15
+ pillow = "^9.0.0"
16
+ matplotlib = "^3.5.0"
17
+ black>="24.10.0",
18
+ lightning[extra]>=2.4.0",
19
+ "loguru>=0.7.2",
20
+ "rich>=13.9.4",
21
+ "tensorboard>=2.18.0",
22
+ "timm>=1.0.11",
23
+ "torch>=2.5.1",
24
+ "torchvision>=0.20.1",
25
+ ]
26
+
27
+ [build-system]
28
+ requires = ["poetry-core>=1.0.0"]
29
+ build-backend = "poetry.core.masonry.api"
requirements.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ torch
2
+ torchvision
3
+ pytorch-lightning>=2.4.0
4
+ torch-lr-finder>=0.2.1
5
+ tensorboard>=2.18.0
6
+ pillow>=9.0.0
7
+ matplotlib>=3.5.0
8
+ timm>=1.0.11
9
+ split-folders>=0.5.1
10
+ loguru>=0.7.2
11
+ rich>=13.9.4
12
+ torch-lr-finder
13
+ lightning[extra]
14
+ setuptools[core]
15
+ gradio
src/.DS_Store ADDED
Binary file (6.15 kB). View file
 
src/datamodules/.DS_Store ADDED
Binary file (6.15 kB). View file
 
src/datamodules/__pycache__/dog_breed_datamodule.cpython-311.pyc ADDED
Binary file (5.27 kB). View file
 
src/datamodules/__pycache__/dog_breed_datamodule.cpython-312.pyc ADDED
Binary file (4.85 kB). View file
 
src/datamodules/__pycache__/imagenet_datamodule.cpython-311.pyc ADDED
Binary file (4.69 kB). View file
 
src/datamodules/imagenet_datamodule.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import lightning as L
2
+ from pathlib import Path
3
+ from typing import Union
4
+ import splitfolders
5
+ from torch.utils.data import DataLoader
6
+ from torchvision import transforms
7
+ from torchvision.datasets import ImageFolder
8
+ from torchvision.datasets.utils import extract_archive
9
+
10
+ class ImageNetDataModule(L.LightningDataModule):
11
+ def __init__(self, dl_path: Union[str, Path] = "data", num_workers: int = 0, batch_size: int = 8):
12
+ super().__init__()
13
+ self._dl_path = dl_path
14
+ self._num_workers = num_workers
15
+ self._batch_size = batch_size
16
+
17
+ # def prepare_data(self):
18
+ # extract_archive(
19
+ # from_path="dog-breed-image-dataset.zip",
20
+ # to_path=self._dl_path,
21
+ # remove_finished=False
22
+ # )
23
+ # splitfolders.ratio(
24
+ # Path(self._dl_path).joinpath('dataset'),
25
+ # output="data/dogs_filtered",
26
+ # ratio=(.8, .1, .1)
27
+ # )
28
+
29
+ @property
30
+ def data_path(self):
31
+ return Path(self._dl_path).joinpath("imagenet-dataset")
32
+
33
+ @property
34
+ def normalize_transform(self):
35
+ return transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
36
+
37
+
38
+ @property
39
+ def train_transform(self):
40
+ return transforms.Compose([
41
+ transforms.RandomResizedCrop(224, interpolation=transforms.InterpolationMode.BILINEAR, antialias=True),
42
+ transforms.RandomHorizontalFlip(0.5),
43
+ transforms.ToTensor(),
44
+ self.normalize_transform,
45
+ ])
46
+
47
+ @property
48
+ def valid_transform(self):
49
+ return transforms.Compose([
50
+ transforms.Resize((224, 224)),
51
+ transforms.Resize(size=256, antialias=True),
52
+ transforms.CenterCrop(224),
53
+ transforms.ToTensor(),
54
+ self.normalize_transform
55
+ ])
56
+
57
+ def create_dataset(self, root, transform):
58
+ return ImageFolder(root=root, transform=transform)
59
+
60
+ def __dataloader(self, train: bool):
61
+ if train:
62
+ dataset = self.create_dataset(self.data_path.joinpath("train"), self.train_transform)
63
+ else:
64
+ dataset = self.create_dataset(self.data_path.joinpath("val"), self.valid_transform)
65
+ return DataLoader(
66
+ dataset=dataset,
67
+ batch_size=self._batch_size,
68
+ num_workers=self._num_workers,
69
+ shuffle=train
70
+ )
71
+
72
+ def train_dataloader(self):
73
+ return self.__dataloader(train=True)
74
+
75
+ def val_dataloader(self):
76
+ return self.__dataloader(train=False)
src/eval.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ from pathlib import Path
3
+ import torch
4
+ from torch.utils.data import DataLoader
5
+ from torchvision import transforms
6
+ from torchvision.datasets import ImageFolder
7
+ from models.classifier import DogBreedClassifier
8
+
9
+ def main():
10
+ parser = argparse.ArgumentParser()
11
+ parser.add_argument("--input_folder", type=str, required=True)
12
+ parser.add_argument("--ckpt_path", type=str, required=True)
13
+ args = parser.parse_args()
14
+
15
+ # Load model
16
+ model = DogBreedClassifier.load_from_checkpoint(args.ckpt_path)
17
+ model.eval()
18
+
19
+ # Create dataset
20
+ transform = transforms.Compose([
21
+ transforms.Resize((224, 224)),
22
+ transforms.ToTensor(),
23
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
24
+ ])
25
+
26
+ dataset = ImageFolder(root=args.input_folder, transform=transform)
27
+ dataloader = DataLoader(dataset, batch_size=32, shuffle=False)
28
+
29
+ # Evaluate
30
+ model.val_acc.reset()
31
+ for batch in dataloader:
32
+ images, labels = batch
33
+ with torch.no_grad():
34
+ outputs = model(images)
35
+ model.val_acc(outputs, labels)
36
+
37
+ print(f"Validation Accuracy: {model.val_acc.compute():.4f}")
38
+
39
+ if __name__ == "__main__":
40
+ main()
src/infer.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ from pathlib import Path
3
+ import torch
4
+ import torch.nn.functional as F
5
+ from PIL import Image
6
+ from torchvision import transforms
7
+ from models.classifier import DogBreedClassifier
8
+
9
+ def get_transform():
10
+ return transforms.Compose([
11
+ transforms.Resize((224, 224)),
12
+ transforms.ToTensor(),
13
+ transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
14
+ ])
15
+
16
+ def main():
17
+ parser = argparse.ArgumentParser()
18
+ parser.add_argument("--input_folder", type=str, required=True)
19
+ parser.add_argument("--output_folder", type=str, required=True)
20
+ parser.add_argument("--ckpt_path", type=str, required=True)
21
+ args = parser.parse_args()
22
+
23
+ # Create output directory
24
+ Path(args.output_folder).mkdir(exist_ok=True)
25
+
26
+ # Load model
27
+ model = DogBreedClassifier.load_from_checkpoint(args.ckpt_path)
28
+ model.eval()
29
+
30
+ # Process each image
31
+ transform = get_transform()
32
+ class_labels = ['Beagle', 'Boxer', 'Bulldog', 'Dachshund', 'German Shepherd',
33
+ 'Golden Retriever', 'Labrador Retriever', 'Poodle', 'Rottweiler',
34
+ 'Yorkshire Terrier']
35
+
36
+ for img_path in Path(args.input_folder).glob("*"):
37
+ if img_path.suffix.lower() not in ['.jpg', '.jpeg', '.png']:
38
+ continue
39
+
40
+ # Load and preprocess image
41
+ img = Image.open(img_path).convert('RGB')
42
+ img_tensor = transform(img).unsqueeze(0)
43
+
44
+ # Inference
45
+ with torch.no_grad():
46
+ output = model(img_tensor)
47
+ probs = F.softmax(output, dim=1)
48
+ pred_idx = torch.argmax(probs, dim=1).item()
49
+ confidence = probs[0][pred_idx].item()
50
+
51
+ # Save results
52
+ result = f"{img_path.name}: {class_labels[pred_idx]} ({confidence:.2f})\n"
53
+ with open(Path(args.output_folder) / "predictions.txt", "a") as f:
54
+ f.write(result)
55
+
56
+ if __name__ == "__main__":
57
+ main()
src/models/.DS_Store ADDED
Binary file (6.15 kB). View file
 
src/models/__pycache__/classifier.cpython-311.pyc ADDED
Binary file (3.9 kB). View file
 
src/models/__pycache__/classifier.cpython-312.pyc ADDED
Binary file (3.5 kB). View file
 
src/models/classifier.py ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import lightning as L
2
+ import torch
3
+ import torch.nn.functional as F
4
+ import timm
5
+ from torch import optim
6
+ from torchmetrics import Accuracy
7
+ from torch.optim.lr_scheduler import OneCycleLR
8
+
9
+
10
+ class ImageNetClassifier(L.LightningModule):
11
+ def __init__(self, lr: float = 1e-3):
12
+ super().__init__()
13
+ self.lr = lr
14
+ #self.model = timm.create_model('resnet18', pretrained=True, num_classes=10)
15
+ self.model = timm.create_model('resnet50', pretrained=False, num_classes=1000)
16
+ self.train_acc = Accuracy(task="multiclass", num_classes=1000)
17
+ self.val_acc = Accuracy(task="multiclass", num_classes=1000)
18
+ self.save_hyperparameters()
19
+
20
+ def forward(self, x):
21
+ return self.model(x)
22
+
23
+ def training_step(self, batch, batch_idx):
24
+ x, y = batch
25
+ logits = self(x)
26
+ loss = F.cross_entropy(logits, y)
27
+ preds = F.softmax(logits, dim=1)
28
+ self.train_acc(preds, y)
29
+ self.log("train_loss", loss, prog_bar=True, on_step=False, on_epoch=True)
30
+ self.log("train_acc", self.train_acc, prog_bar=True, on_step=False, on_epoch=True)
31
+ return loss
32
+
33
+ def validation_step(self, batch, batch_idx):
34
+ x, y = batch
35
+ logits = self(x)
36
+ loss = F.cross_entropy(logits, y)
37
+ preds = F.softmax(logits, dim=1)
38
+ self.val_acc(preds, y)
39
+ self.log("val_loss", loss, prog_bar=True, on_step=False, on_epoch=True)
40
+ self.log("val_acc", self.val_acc, prog_bar=True, on_step=False, on_epoch=True)
41
+
42
+ def configure_optimizers(self):
43
+ optimizer = torch.optim.Adam(self.parameters(), lr=self.lr)
44
+
45
+ # Calculate total steps
46
+ total_steps = self.trainer.estimated_stepping_batches
47
+
48
+ scheduler = OneCycleLR(
49
+ optimizer,
50
+ max_lr=self.lr,
51
+ total_steps=total_steps,
52
+ pct_start=0.3,
53
+ div_factor=25,
54
+ final_div_factor=1e4,
55
+ three_phase=False,
56
+ anneal_strategy='cos'
57
+ )
58
+
59
+ return {
60
+ "optimizer": optimizer,
61
+ "lr_scheduler": {
62
+ "scheduler": scheduler,
63
+ "interval": "step" # Update at every step
64
+ }
65
+ }
src/train.py ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import lightning as L
2
+ from lightning.pytorch.callbacks import ModelCheckpoint, TQDMProgressBar, Callback
3
+ from lightning.pytorch.loggers import TensorBoardLogger
4
+ from pathlib import Path
5
+ from torch.optim.lr_scheduler import OneCycleLR
6
+ from torch_lr_finder import LRFinder
7
+ import torch
8
+
9
+ from datamodules.imagenet_datamodule import ImageNetDataModule
10
+ from models.classifier import ImageNetClassifier
11
+
12
+ class NewLineProgressBar(Callback):
13
+ def on_train_epoch_start(self, trainer, pl_module):
14
+ print(f"\nEpoch {trainer.current_epoch}")
15
+
16
+ def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
17
+ metrics = trainer.callback_metrics
18
+ train_loss = metrics.get('train_loss', 0)
19
+ train_acc = metrics.get('train_acc', 0)
20
+ print(f"\rTraining - Loss: {train_loss:.4f}, Acc: {train_acc:.4f}", end="")
21
+
22
+ def on_validation_epoch_start(self, trainer, pl_module):
23
+ print("\n\nValidation:")
24
+
25
+ def on_validation_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
26
+ metrics = trainer.callback_metrics
27
+ val_loss = metrics.get('val_loss', 0)
28
+ val_acc = metrics.get('val_acc', 0)
29
+ print(f"\rValidation - Loss: {val_loss:.4f}, Acc: {val_acc:.4f}", end="")
30
+
31
+ def find_optimal_lr(model, data_module):
32
+ # Initialize LRFinder
33
+ optimizer = torch.optim.Adam(model.parameters(), lr=1e-7)
34
+ criterion = torch.nn.CrossEntropyLoss()
35
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
36
+ lr_finder = LRFinder(model, optimizer, criterion, device=device)
37
+
38
+ # Run LR finder with stage parameter
39
+ data_module.setup(stage='fit')
40
+ lr_finder.range_test(data_module.train_dataloader(), end_lr=1, num_iter=200, step_mode="exp")
41
+
42
+ # Get the learning rate with the steepest gradient
43
+ lrs = lr_finder.history['lr']
44
+ losses = lr_finder.history['loss']
45
+
46
+ # Find the learning rate with minimum loss
47
+ optimal_lr = lrs[losses.index(min(losses))]
48
+
49
+ # You might want to pick a learning rate slightly lower than the minimum
50
+ optimal_lr = optimal_lr * 0.1 # Common practice to use 1/10th of the value
51
+
52
+ print(f"Optimal learning rate: {optimal_lr}")
53
+
54
+ # Plot the LR finder results
55
+ lr_finder.plot() # Will save the plot
56
+ lr_finder.reset() # Reset the model and optimizer
57
+
58
+ return optimal_lr
59
+
60
+ def main(chkpoint_path=None):
61
+ if chkpoint_path is not None:
62
+ model = ImageNetClassifier(lr=1e-2)
63
+ data_module = ImageNetDataModule(batch_size=256, num_workers=8)
64
+ checkpoint_callback = ModelCheckpoint(
65
+ dirpath="logs/checkpoints",
66
+ filename="{epoch}-{val_loss:.2f}",
67
+ monitor="val_loss",
68
+ save_top_k=3
69
+ )
70
+
71
+ # Initialize Trainer
72
+ trainer = L.Trainer(resume_from_checkpoint=chkpoint_path,
73
+ max_epochs=epochs,
74
+ precision="bf16-mixed",
75
+ callbacks=[
76
+ checkpoint_callback,
77
+ NewLineProgressBar(),
78
+ TQDMProgressBar(refresh_rate=1)
79
+ ],
80
+ accelerator="auto",
81
+ logger=TensorBoardLogger(save_dir="logs", name="image_net_classifications"),
82
+ enable_progress_bar=True,
83
+ enable_model_summary=True,
84
+ log_every_n_steps=1,
85
+ val_check_interval=1.0,
86
+ check_val_every_n_epoch=1
87
+ )
88
+ trainer.fit(model, data_module)
89
+ else:
90
+ # Create directories
91
+ Path("logs").mkdir(exist_ok=True)
92
+ Path("data").mkdir(exist_ok=True)
93
+ # Initialize DataModule and Model
94
+ data_module = ImageNetDataModule(batch_size=256, num_workers=8)
95
+ model = ImageNetClassifier(lr=1e-2) # Initial lr will be overridden
96
+
97
+ # Find optimal learning rate
98
+ optimal_lr = find_optimal_lr(model, data_module)
99
+ #optimal_lr = 6.28E-02
100
+ # Calculate total steps for OneCycleLR
101
+ epochs = 60
102
+ data_module.setup(stage='fit')
103
+ steps_per_epoch = len(data_module.train_dataloader())
104
+ total_steps = epochs * steps_per_epoch
105
+
106
+ # # Initialize optimizer
107
+ # optimizer = torch.optim.Adam(model.parameters(), lr=optimal_lr)
108
+
109
+ # # Initialize OneCycleLR scheduler
110
+ # scheduler = OneCycleLR(
111
+ # optimizer,
112
+ # max_lr=optimal_lr,
113
+ # total_steps=total_steps,
114
+ # pct_start=0.3, # Spend 30% of time increasing LR
115
+ # div_factor=25, # Initial LR will be max_lr/25
116
+ # final_div_factor=1e4, # Final LR will be max_lr/10000
117
+ # three_phase=False, # Use one cycle policy
118
+ # anneal_strategy='cos' # Use cosine annealing
119
+ # )
120
+ model = ImageNetClassifier(lr=optimal_lr) # Initial lr will be overridden
121
+ # Initialize callbacks
122
+ checkpoint_callback = ModelCheckpoint(
123
+ dirpath="logs/checkpoints",
124
+ filename="{epoch}-{val_loss:.2f}",
125
+ monitor="val_loss",
126
+ save_top_k=3
127
+ )
128
+
129
+ # Initialize Trainer
130
+ trainer = L.Trainer(
131
+ max_epochs=epochs,
132
+ precision="bf16-mixed",
133
+ callbacks=[
134
+ checkpoint_callback,
135
+ NewLineProgressBar(),
136
+ TQDMProgressBar(refresh_rate=1)
137
+ ],
138
+ accelerator="auto",
139
+ logger=TensorBoardLogger(save_dir="logs", name="image_net_classifications"),
140
+ enable_progress_bar=True,
141
+ enable_model_summary=True,
142
+ log_every_n_steps=1,
143
+ val_check_interval=1.0,
144
+ check_val_every_n_epoch=1
145
+ )
146
+
147
+ # Train the model
148
+ trainer.fit(model, data_module)
149
+
150
+ if __name__ == "__main__":
151
+ main(chkpoint_path=None)