Repository navigation
Expand file tree
/
Copy pathtesa.py
More file actions
1715 lines (1641 loc) · 66 KB
/
Copy pathtesa.py
File metadata and controls
1715 lines (1641 loc) · 66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmengine.structures import PixelData
from mmseg.models.data_preprocessor import SegDataPreProcessor
from mmseg.models.segmentors import BaseSegmentor
from mmseg.registry import MODELS
import clip
from pamr import PAMR
from prompts.imagenet_template import openai_imagenet_template, get_prompt_bank, detect_dataset_from_path
# ============================================================================
# CTE: Contrastive Text Enhancement
# ============================================================================
# Use contrastive descriptions to improve class discrimination in CLIP space.
#
# Typical confusions include terrain/vegetation, wall/building, and
# rider/person.
#
# Each class receives descriptions that emphasize differences from its peers.
SEMANTIC_RELATIONS = {
# Format: class name -> contrastive descriptions.
# ============ Cityscapes classes ============
"terrain": [
"bare ground without any plants or grass",
"brown dirt or soil surface, not green vegetation",
"unpaved earth ground, distinct from grass or trees",
"muddy or sandy ground with no plant life",
],
"vegetation": [
"green plants, trees, bushes with leaves",
"living plants and foliage, not bare ground",
"green leafy vegetation, distinct from brown terrain",
],
"wall": [
"a standalone wall structure, not part of a building facade",
"a low barrier wall separate from buildings",
"a concrete or brick wall that is not a building",
"a retaining wall or boundary wall, distinct from building walls",
],
"building": [
"a multi-story building structure with windows",
"an architectural building, not a simple wall",
"a complete building facade, not just a wall segment",
],
"rider": [
"a person actively riding on a bicycle or motorcycle",
"someone sitting on and controlling a two-wheeled vehicle",
"a cyclist or motorcyclist, not a pedestrian walking",
],
"person": [
"a pedestrian walking on foot, not riding anything",
"a standing or walking person, not on a vehicle",
],
"sidewalk": [
"a paved pedestrian path beside the road",
"a walkway for people, distinct from the vehicle road",
"concrete pavement for walking, not for driving",
],
"road": [
"a paved surface for vehicles to drive on",
"the main driving lane, not the pedestrian sidewalk",
"asphalt road for cars, distinct from sidewalk",
],
# ============ VOC20 classes ============
# Confusion group: cat / dog (furry quadruped pets)
"cat": [
"a feline animal with a small face and pointed ears",
"a cat, not a dog, with a slender body and whiskers",
"a domestic cat distinct from a dog by its retractable claws",
],
"dog": [
"a canine animal with a snout and floppy or pointed ears",
"a dog, not a cat, with a loyal and expressive face",
"a domestic dog distinct from a cat by its larger muzzle",
],
# Confusion group: horse / cow / sheep (farm animals)
"horse": [
"a tall equine animal with a long mane and slender legs",
"a horse, not a cow or sheep, with a muscular athletic body",
"a horse with hooves and a flowing tail, distinct from cattle",
],
"cow": [
"a stocky bovine animal with a broad body and udder",
"a cow, not a horse or sheep, with a wide face and horns",
"a cattle animal with black-and-white or brown hide",
],
"sheep": [
"a woolly animal covered in thick fleece",
"a sheep, not a cow or horse, with a compact fluffy body",
"a sheep with curly wool coat, distinct from smooth-skinned cattle",
],
# Confusion group: chair / sofa / table (furniture)
"chair": [
"a single-seat furniture piece with a backrest",
"a chair, not a sofa or table, designed for one person to sit",
"a small rigid seat distinct from a cushioned couch",
],
"sofa": [
"a large cushioned seating furniture for multiple people",
"a sofa or couch, not a single chair, with soft upholstery",
"a wide padded couch distinct from a rigid single chair",
],
"table": [
"a flat-topped furniture piece supported by legs for placing objects",
"a table, not a chair or sofa, with a horizontal surface",
"a dining or work table distinct from seating furniture",
],
# Confusion group: bicycle / motorbike (two-wheeled vehicles)
"bicycle": [
"a human-powered two-wheeled vehicle with pedals",
"a bicycle, not a motorbike, propelled by pedaling",
"a lightweight pedal bike without an engine",
],
"motorbike": [
"a motorized two-wheeled vehicle with an engine",
"a motorbike, not a bicycle, powered by a motor",
"a heavy motorcycle with engine, distinct from a pedal bicycle",
],
# Confusion group: bus / car / train (vehicles)
"bus": [
"a large multi-passenger vehicle for public transit",
"a bus, not a car or train, with a long rectangular body",
"a big road vehicle carrying many passengers, distinct from small cars",
],
"car": [
"a small four-wheeled passenger automobile",
"a car, not a bus or train, compact enough for a few passengers",
"a personal motor vehicle distinct from large public transport",
],
"train": [
"a rail vehicle running on tracks with multiple carriages",
"a train, not a bus or car, moving along railway tracks",
"a long locomotive on rails, distinct from road vehicles",
],
# Confusion group: bird / aeroplane (flying objects)
"bird": [
"a living animal with feathers and wings that can fly",
"a bird, not an airplane, a small organic creature",
"a feathered bird distinct from a metallic aircraft",
],
"aeroplane": [
"a large metallic aircraft with fixed wings and jet engines",
"an airplane, not a bird, a man-made flying machine",
"a mechanical aircraft distinct from a living bird",
],
# ship (water vs land)
"ship": [
"a large vessel floating on water for transportation",
"a ship or boat on water, not a land vehicle",
"a watercraft distinct from cars, buses, and trains",
],
# Confusion group: bottle / pottedplant (small objects with similar silhouettes)
"bottle": [
"a narrow cylindrical container for holding liquids",
"a bottle, not a plant, a smooth manufactured object",
"a glass or plastic bottle distinct from a living potted plant",
],
"pottedplant": [
"a living plant growing in a pot or container",
"a potted plant, not a bottle, with green leaves and stems",
"a houseplant in a container distinct from a manufactured bottle",
],
# television monitor
"television monitor": [
"a flat electronic display screen for showing images",
"a TV or monitor with a glowing screen surface",
"an electronic screen device distinct from furniture",
],
# ============ VOC21 background scene elements ============
# These are aliases of the background class; CTE helps distinguish them
# from visually similar foreground classes.
# desk vs table (foreground) — most confusable pair
"desk": [
"a work desk or study desk, typically in an office or home",
"a desk for writing or working, not a dining table",
"an office desk with drawers, distinct from a dining table",
],
# bed vs sofa (foreground)
"bed": [
"a sleeping bed with mattress and pillows in a bedroom",
"a bed for sleeping, not a sofa for sitting",
"a bed frame with bedding, distinct from a living room couch",
],
# tree vs pottedplant (foreground)
"tree": [
"a large outdoor tree with a trunk and canopy of branches",
"a tall tree rooted in the ground, not a small potted plant",
"a tree growing outdoors, distinct from a houseplant in a pot",
],
# sky vs bird/aeroplane (foreground flying objects)
"sky": [
"the open sky above, a vast background area",
"sky without objects, distinct from birds or airplanes in it",
"blue or cloudy sky as the scene background",
],
# grass vs green foreground objects
"grass": [
"green grass covering the ground surface",
"a grassy lawn area, not a potted plant or tree",
"ground-level grass, distinct from tall trees or bushes",
],
# sea vs ship (foreground watercraft)
"sea": [
"a vast body of ocean water as scene background",
"sea water surface, not a ship or boat floating on it",
"the ocean or sea, distinct from watercraft vessels",
],
# river (water body, distinct from sea)
"river": [
"a flowing freshwater river or stream",
"a river, not the open sea, a narrow body of water inland",
"flowing river water, distinct from ocean waves",
],
# mountain vs hill
"mountain": [
"a tall rocky mountain with steep slopes and peaks",
"a mountain, not a small hill, with significant elevation",
"a large mountain in the background landscape",
],
"hill": [
"a gentle low-elevation hill or mound",
"a rolling hill, not a steep mountain, with gradual slopes",
"a small grassy hill distinct from a tall rocky mountain",
],
# door vs window
"door": [
"an entrance door in a wall for people to walk through",
"a door, not a window, opaque and full-height for entry",
"a door opening distinct from a glass window",
],
"window": [
"a glass window in a wall for letting in light",
"a window, not a door, with glass panes for seeing through",
"a window opening distinct from an entrance door",
],
# floor vs road (already has entry)
"floor": [
"an indoor floor surface of a room",
"a floor inside a building, not an outdoor road",
"tiled or wooden floor, distinct from outdoor pavement",
],
# fence vs wall (already has entry)
"fence": [
"an open or slatted barrier around a property",
"a fence, not a solid wall, with gaps between slats or wires",
"a lightweight fence barrier distinct from a solid concrete wall",
],
# ============ Context59 additional classes ============
# Ground/terrain surfaces (highly confusable group)
"ground": [
"bare outdoor ground or earth surface",
"ground, not grass or road, unpaved dirt or soil",
"exposed ground surface distinct from paved areas",
],
"rock": [
"a natural rock or stone formation",
"rock, not ground or mountain, a solid stone surface",
"rocky terrain distinct from bare dirt ground",
],
"snow": [
"white snow covering the ground or objects",
"snow, not water or cloud, frozen white precipitation",
"snowy surface distinct from other ground cover",
],
"water": [
"a body of water such as a lake, pond, or pool",
"water surface, not snow or sky, a liquid body",
"water in a natural or artificial setting",
],
"platform": [
"a raised flat surface for standing or boarding",
"a platform, not a floor or sidewalk, elevated above ground",
"a station platform or stage distinct from regular ground",
],
"track": [
"railway tracks or a running track on the ground",
"a track, not a road, with rails or lane markings",
"railroad tracks or athletic track distinct from a road",
],
# Seating (bench vs chair vs sofa)
"bench": [
"a long seat for multiple people, typically outdoors",
"a bench, not a chair, a wider seat without arms",
"a park or public bench distinct from an indoor chair",
],
# Fabric (cloth vs bedclothes vs curtain)
"cloth": [
"a piece of fabric or textile material",
"cloth, not curtain or bedding, a loose fabric",
"fabric material distinct from structured textiles",
],
"bedclothes": [
"bed sheets, blankets, and pillows on a bed",
"bedclothes, not curtain or loose cloth, bedding fabric",
"bed linens and covers distinct from other fabrics",
],
# Electronics (computer vs tvmonitor vs keyboard vs mouse)
"computer": [
"a computer tower or laptop device",
"a computer, not a TV monitor, a computing machine",
"a PC or laptop distinct from a display screen",
],
"tvmonitor": [
"a flat electronic display screen for showing images",
"a TV or monitor screen, not a computer tower",
"a display screen distinct from a computing device",
],
# Vehicles (truck vs bus)
"truck": [
"a cargo or freight truck for hauling goods",
"a truck, not a bus, designed for carrying cargo",
"a heavy truck distinct from a passenger bus",
],
"boat": [
"a small watercraft floating on water",
"a boat, not a car or bus, a vessel on water",
"a watercraft distinct from land vehicles",
],
# Storage (cabinet vs shelves)
"cabinet": [
"a closed storage furniture with doors",
"a cabinet, not open shelves, enclosed storage",
"a closed cabinet distinct from open shelving",
],
"shelves": [
"open horizontal shelving for storage or display",
"shelves, not a closed cabinet, open racks",
"open shelves distinct from enclosed cabinets",
],
# Plants (flower vs pottedplant vs tree)
"flower": [
"a blooming flower with colorful petals",
"a flower, not a potted plant or tree, just the blossom",
"flowers with petals distinct from green foliage plants",
],
# Wood vs tree
"wood": [
"wooden material or surface, processed timber",
"wood, not a living tree, cut or processed lumber",
"wooden surface distinct from a living tree with leaves",
],
# Ceiling vs sky vs floor
"ceiling": [
"the overhead surface inside a room",
"a ceiling, not the sky, an indoor overhead surface",
"an indoor ceiling distinct from the open sky above",
],
# Sign
"sign": [
"a posted sign with text or symbols for information",
"a sign, not a window or monitor, a flat board with writing",
"a signboard distinct from electronic displays",
],
# Light
"light": [
"a light fixture or lamp for illumination",
"a light source, not a window, an artificial lamp",
"a light fixture distinct from natural sunlight",
],
# ============ ADE20K additional classes (150 classes) ============
# Seating furniture (armchair vs chair vs sofa vs seat vs stool)
"armchair": [
"a comfortable chair with armrests",
"an armchair, not a regular chair, with padded arms",
"a cushioned armchair distinct from a simple chair",
],
"seat": [
"a generic seating surface or place to sit",
"a seat, not a specific chair or sofa, a sitting area",
"a seat surface distinct from a full chair",
],
"stool": [
"a backless seat typically at counter height",
"a stool, not a chair, without a backrest",
"a bar stool or kitchen stool distinct from a chair",
],
"ottoman": [
"a cushioned footstool or low seat",
"an ottoman, not a chair or sofa, a padded footrest",
"a low ottoman distinct from seating furniture",
],
"swivelchair": [
"a rotating office chair on wheels",
"a swivel chair, not a fixed chair, that rotates",
"an office swivel chair distinct from a regular chair",
],
# Tables (table vs desk vs coffeetable vs countertop vs counter)
"coffeetable": [
"a low table in a living room for drinks and magazines",
"a coffee table, not a dining table, low and small",
"a living room coffee table distinct from a work desk",
],
"countertop": [
"a flat work surface in a kitchen or bathroom",
"a countertop, not a table, a built-in work surface",
"a kitchen countertop distinct from a freestanding table",
],
"counter": [
"a service counter or bar counter",
"a counter, not a table, for serving or transactions",
"a shop counter distinct from a dining table",
],
"pooltable": [
"a billiard or pool table with green felt",
"a pool table, not a regular table, for playing billiards",
"a game table with pockets distinct from a dining table",
],
# Storage (wardrobe vs cabinet vs bookcase vs chestofdrawers vs buffet)
"wardrobe": [
"a tall cabinet for storing clothes",
"a wardrobe, not a cabinet, specifically for clothing",
"a clothes wardrobe distinct from a kitchen cabinet",
],
"bookcase": [
"a tall shelf unit for storing books",
"a bookcase, not a cabinet, with open shelves for books",
"a book shelf distinct from a closed cabinet",
],
"chestofdrawers": [
"a furniture piece with multiple drawers for storage",
"a chest of drawers, not a cabinet, with pull-out drawers",
"a dresser with drawers distinct from a wardrobe",
],
"buffet": [
"a sideboard or serving table in a dining room",
"a buffet, not a cabinet, for serving food",
"a dining room buffet distinct from a kitchen cabinet",
],
# Lighting (lamp vs chandelier vs sconce vs streetlight)
"lamp": [
"a portable light fixture with a shade",
"a lamp, not a ceiling light, a table or floor lamp",
"a lamp with shade distinct from overhead lighting",
],
"chandelier": [
"an ornate hanging light fixture with multiple lights",
"a chandelier, not a simple lamp, decorative ceiling light",
"a hanging chandelier distinct from a table lamp",
],
"sconce": [
"a wall-mounted light fixture",
"a sconce, not a lamp, attached to the wall",
"a wall sconce distinct from a ceiling light",
],
"streetlight": [
"a tall outdoor light pole for street illumination",
"a streetlight, not an indoor lamp, for outdoor lighting",
"a street lamp post distinct from indoor lighting",
],
# Water features (river vs lake vs sea vs swimmingpool vs fountain vs waterfall)
"lake": [
"a large inland body of still water",
"a lake, not a river, a calm body of water",
"a lake distinct from flowing river water",
],
"swimmingpool": [
"an artificial pool for swimming",
"a swimming pool, not a natural lake, a man-made pool",
"a pool with clear water distinct from natural water bodies",
],
"fountain": [
"a decorative water feature with jets",
"a fountain, not a pool, with water spraying upward",
"a water fountain distinct from a still pool",
],
"waterfall": [
"water cascading down from a height",
"a waterfall, not a river, water falling vertically",
"a waterfall distinct from flowing river water",
],
# Screens (screen vs crtscreen vs monitor vs televisionreceiver)
"screen": [
"a flat display surface or projection screen",
"a screen, not a monitor, a viewing surface",
"a projection screen distinct from a TV",
],
"crtscreen": [
"an old-style cathode ray tube display",
"a CRT screen, not a flat screen, a bulky old monitor",
"a CRT display distinct from a flat panel",
],
"monitor": [
"a computer display screen",
"a monitor, not a TV, for computer use",
"a computer monitor distinct from a television",
],
"televisionreceiver": [
"a television set for watching broadcasts",
"a TV, not a computer monitor, for entertainment",
"a television distinct from a computer monitor",
],
# Outdoor structures (bridge vs pier vs tower vs skyscraper)
"pier": [
"a platform extending into water for boats",
"a pier, not a bridge, a dock structure",
"a boat pier distinct from a bridge",
],
"tower": [
"a tall narrow structure or building",
"a tower, not a regular building, tall and narrow",
"a tower structure distinct from a wide building",
],
"skyscraper": [
"a very tall multi-story building",
"a skyscraper, not a regular building, extremely tall",
"a high-rise skyscraper distinct from low buildings",
],
# Ground surfaces (earth vs land vs field vs path vs dirttrack)
"earth": [
"bare soil or dirt ground",
"earth, not grass or rock, exposed soil",
"bare earth distinct from paved surfaces",
],
"land": [
"a general area of ground or terrain",
"land, not water, solid ground area",
"land surface distinct from water bodies",
],
"field": [
"an open area of grass or crops",
"a field, not a forest, an open grassy area",
"an agricultural or sports field distinct from a lawn",
],
"path": [
"a narrow walkway or trail",
"a path, not a road, a narrow walking route",
"a footpath distinct from a wide road",
],
"dirttrack": [
"an unpaved road or racing track",
"a dirt track, not a paved road, an unpaved surface",
"a dirt road distinct from asphalt",
],
# Plants (plant vs palm vs tree)
"plant": [
"a small plant or shrub",
"a plant, not a tree, a smaller vegetation",
"a small plant distinct from a tall tree",
],
"palm": [
"a palm tree with fronds",
"a palm, not a regular tree, with fan-like leaves",
"a palm tree distinct from deciduous trees",
],
# Bathroom (bathtub vs sink vs toilet vs shower)
"bathtub": [
"a large tub for bathing",
"a bathtub, not a sink, for full-body bathing",
"a bath tub distinct from a shower",
],
"shower": [
"a shower stall or enclosure",
"a shower, not a bathtub, for standing wash",
"a shower area distinct from a bathtub",
],
# Kitchen appliances (stove vs oven vs microwave vs refrigerator vs dishwasher vs washer)
"stove": [
"a cooking appliance with burners",
"a stove, not an oven, with cooktop burners",
"a stovetop distinct from an oven",
],
"oven": [
"an enclosed cooking appliance for baking",
"an oven, not a stove, an enclosed baking chamber",
"a baking oven distinct from a stovetop",
],
"microwave": [
"a small appliance for quick heating",
"a microwave, not an oven, for rapid heating",
"a microwave oven distinct from a regular oven",
],
"refrigerator": [
"a large appliance for keeping food cold",
"a refrigerator, not a cabinet, for food storage",
"a fridge distinct from a freezer or cabinet",
],
"dishwasher": [
"an appliance for washing dishes",
"a dishwasher, not a washer, for cleaning dishes",
"a dish washing machine distinct from a clothes washer",
],
"washer": [
"a clothes washing machine",
"a washer, not a dishwasher, for laundry",
"a laundry washer distinct from a dishwasher",
],
# Misc furniture (rug vs blanket vs cushion vs pillow)
"rug": [
"a floor covering smaller than a carpet",
"a rug, not a carpet, a smaller floor mat",
"an area rug distinct from wall-to-wall carpet",
],
"blanket": [
"a soft covering for warmth",
"a blanket, not a rug, for covering a person",
"a bed blanket distinct from a floor rug",
],
"cushion": [
"a soft pad for sitting or leaning",
"a cushion, not a pillow, for seating comfort",
"a seat cushion distinct from a bed pillow",
],
"pillow": [
"a soft support for the head during sleep",
"a pillow, not a cushion, for sleeping",
"a bed pillow distinct from a decorative cushion",
],
# Vehicles (van vs bus vs truck vs airplane vs minibike)
"van": [
"a large enclosed vehicle for cargo or passengers",
"a van, not a car, a larger enclosed vehicle",
"a cargo van distinct from a sedan",
],
"airplane": [
"a fixed-wing aircraft for flying",
"an airplane, not a bird, a flying machine",
"an aircraft distinct from a helicopter",
],
"minibike": [
"a small motorcycle or motorbike",
"a minibike, not a bicycle, a small motorized bike",
"a small motorbike distinct from a full motorcycle",
],
# ============ COCO-Object specific entries ============
"motorcycle": [
"a motorized two-wheeled vehicle with engine, not a bicycle",
"a motorcycle, larger than a bicycle, with motor power",
"a motorbike distinct from a pedal bicycle",
],
"couch": [
"a large cushioned sofa for sitting, not a single chair",
"a couch or sofa, wider than a chair, for multiple people",
"a living room couch distinct from a bed or chair",
],
"potted plant": [
"a plant growing in a pot or container, not a tree",
"a small indoor potted plant, not outdoor vegetation",
"a houseplant in a pot distinct from garden plants",
],
"dining table": [
"a table used for eating meals, not a desk or counter",
"a dining table with flat surface, distinct from a desk",
"a table for dining, often with chairs around it",
],
"tv": [
"a television screen or monitor for viewing, not a laptop",
"a TV display mounted or standing, distinct from a computer monitor",
"a television set, larger than a laptop screen",
],
"laptop": [
"a portable computer with attached screen and keyboard",
"a laptop computer, not a desktop monitor or TV",
"a folding laptop distinct from a desktop or TV",
],
"mouse": [
"a computer mouse input device, not an animal",
"a small handheld pointing device for computers",
"a computer mouse with buttons, distinct from a remote",
],
"remote": [
"a handheld remote control for TV or devices",
"a remote control with buttons, not a cell phone",
"a small remote device distinct from a phone or mouse",
],
"keyboard": [
"a computer keyboard with keys for typing",
"a keyboard input device, not a piano keyboard",
"a typing keyboard distinct from a laptop",
],
"cell phone": [
"a handheld mobile phone or smartphone",
"a cell phone with screen, not a remote control",
"a smartphone device distinct from a remote or mouse",
],
"cup": [
"a small drinking vessel, not a bowl or wine glass",
"a cup for coffee or tea, distinct from a bowl",
"a drinking cup with or without handle",
],
"wine glass": [
"a stemmed glass for drinking wine",
"a wine glass with stem, not a regular cup or bowl",
"a tall stemmed glass distinct from a cup",
],
"fork": [
"a pronged utensil for eating, not a knife or spoon",
"a fork with tines for picking up food",
"a dining fork distinct from a knife or spoon",
],
"knife": [
"a cutting utensil with a blade, not a fork or spoon",
"a knife for cutting food, distinct from scissors",
"a table knife or kitchen knife with sharp edge",
],
"spoon": [
"a rounded utensil for scooping, not a fork or knife",
"a spoon with concave bowl for eating",
"a dining spoon distinct from a fork",
],
"bowl": [
"a round deep dish for food, not a cup or plate",
"a bowl container wider than a cup",
"a food bowl distinct from a vase or cup",
],
"banana": [
"a curved yellow fruit, not an orange or apple",
"a banana fruit with peel, elongated shape",
"a banana distinct from other round fruits",
],
"apple": [
"a round fruit, red or green, not an orange",
"an apple fruit distinct from an orange by color and texture",
"a smooth round apple, not a citrus fruit",
],
"orange": [
"a round citrus fruit with orange skin",
"an orange fruit, not an apple, with textured peel",
"a citrus orange distinct from an apple or sports ball",
],
"broccoli": [
"a green vegetable with tree-like florets",
"broccoli with green crown, not a potted plant",
"a broccoli vegetable distinct from other greens",
],
"carrot": [
"an orange root vegetable, elongated shape",
"a carrot, not a banana, orange and tapered",
"a carrot vegetable distinct from other foods",
],
"hot dog": [
"a sausage in a bun, not a sandwich or pizza",
"a hot dog with bread roll, distinct from a sandwich",
"a hot dog food item with elongated shape",
],
"pizza": [
"a flat round food with toppings and cheese",
"a pizza pie, not a cake or sandwich",
"a pizza with crust and toppings, distinct from cake",
],
"donut": [
"a ring-shaped fried pastry with glaze",
"a donut with hole in center, not a cake",
"a sweet donut distinct from a cake or pizza",
],
"cake": [
"a sweet baked dessert with frosting, not a pizza",
"a cake, layered or frosted, distinct from a donut",
"a birthday or dessert cake, not bread",
],
"sandwich": [
"bread with filling between slices, not a hot dog",
"a sandwich with layers, distinct from pizza",
"a food sandwich with bread and filling",
],
"backpack": [
"a bag worn on the back with straps",
"a backpack, not a handbag or suitcase",
"a carrying backpack distinct from a handbag",
],
"handbag": [
"a small bag carried by hand or shoulder",
"a handbag or purse, not a backpack or suitcase",
"a fashion handbag distinct from a backpack",
],
"suitcase": [
"a large travel luggage with handle",
"a suitcase for travel, not a backpack or handbag",
"a wheeled suitcase distinct from a bag",
],
"umbrella": [
"a canopy on a stick for rain or shade",
"an umbrella, not a kite, for weather protection",
"an open or closed umbrella distinct from a parasol",
],
"tie": [
"a necktie worn around the collar",
"a formal tie, not a scarf or belt",
"a necktie accessory for clothing",
],
"skateboard": [
"a board with wheels for riding, not a surfboard",
"a skateboard on ground, distinct from a snowboard",
"a small wheeled board for skating",
],
"surfboard": [
"a long board for riding waves, not a skateboard",
"a surfboard on water, distinct from a snowboard",
"a surfing board, longer than a skateboard",
],
"snowboard": [
"a board for riding on snow, not a skateboard",
"a snowboard on snow, distinct from skis",
"a single wide board for snow sports",
],
"skis": [
"a pair of long narrow boards for snow, not a snowboard",
"skis for skiing, two separate boards",
"ski equipment distinct from a snowboard",
],
"sports ball": [
"a round ball for sports, not a frisbee",
"a sports ball like soccer, basketball, or tennis ball",
"a spherical ball distinct from an orange or apple",
],
"kite": [
"a flying object on a string in the sky",
"a kite in the air, not a bird or airplane",
"a colorful kite distinct from an umbrella",
],
"baseball bat": [
"a long stick for hitting baseballs",
"a baseball bat, not a tennis racket",
"a wooden or metal bat for baseball",
],
"baseball glove": [
"a leather glove for catching baseballs",
"a baseball mitt, not a regular glove",
"a catching glove for baseball",
],
"tennis racket": [
"a racket with strings for hitting tennis balls",
"a tennis racket, not a baseball bat",
"a racket with oval head and handle",
],
"frisbee": [
"a flat disc for throwing, not a sports ball",
"a frisbee disc, not a plate or ball",
"a flying disc toy distinct from a ball",
],
"toaster": [
"a small appliance for toasting bread",
"a toaster, not a microwave or oven",
"a countertop toaster distinct from an oven",
],
"sink": [
"a basin with faucet for washing",
"a sink in kitchen or bathroom, not a toilet or bathtub",
"a wash basin distinct from a bowl or toilet",
],
"scissors": [
"a cutting tool with two blades",
"scissors for cutting, not a knife",
"a pair of scissors with handles",
],
"teddy bear": [
"a stuffed plush toy bear",
"a teddy bear toy, not a real bear",
"a soft stuffed animal distinct from a real bear",
],
"hair drier": [
"an electric device for drying hair",
"a hair dryer appliance, not a toaster",
"a blow dryer for hair styling",
],
"toothbrush": [
"a small brush for cleaning teeth",
"a toothbrush with bristles and handle",
"a dental hygiene brush, not a hair brush",
],
"vase": [
"a decorative container for flowers",
"a vase, not a bottle or cup",
"a flower vase distinct from a bowl or bottle",
],
"clock": [
"a device showing time with hands or digits",
"a clock on wall or table, not a watch",
"a time-telling clock distinct from a TV screen",
],
"traffic light": [
"a signal light at intersections with red yellow green",
"a traffic light, not a lamp or street light",
"a traffic signal distinct from a regular light",
],
"fire hydrant": [
"a red water outlet on the street for firefighting",
"a fire hydrant, not a parking meter",
"a street hydrant distinct from a bollard",
],
"stop sign": [
"an octagonal red sign saying stop",
"a stop sign, not a traffic light",
"a road stop sign distinct from other signs",
],
"parking meter": [
"a coin-operated meter for parking time",
"a parking meter, not a fire hydrant",
"a street parking meter distinct from a hydrant",
],
"elephant": [
"a large gray animal with trunk and tusks",
"an elephant, not a bear or horse, very large",
"an elephant with long trunk distinct from other animals",
],
"zebra": [
"a striped black and white horse-like animal",
"a zebra with stripes, not a horse",
"a zebra distinct from a horse by its stripes",
],
"giraffe": [
"a tall animal with very long neck and spots",
"a giraffe, not a horse or zebra, extremely tall",
"a spotted giraffe with long neck",
],
"bear": [
"a large furry wild animal, not a teddy bear",
"a real bear, not a stuffed toy bear",
"a bear animal distinct from a dog or teddy bear",
],
# ============ COCO-Stuff specific entries (no-space class names) ============
"trafficlight": [
"a signal light at intersections with red yellow green",
"a traffic light, not a lamp or street light",
"a traffic signal distinct from a regular light",
],
"firehydrant": [
"a red water outlet on the street for firefighting",
"a fire hydrant, not a parking meter",
"a street hydrant distinct from a bollard",
],
"stopsign": [
"an octagonal red sign saying stop",
"a stop sign, not a traffic light",
"a road stop sign distinct from a banner",
],
"parkingmeter": [
"a coin-operated meter for parking time",
"a parking meter, not a fire hydrant",
"a street parking meter on sidewalk",
],
"sportsball": [
"a round ball for sports, not a frisbee or fruit",
"a sports ball like soccer, basketball, or tennis ball",
"a spherical ball distinct from an orange or apple",
],
"baseballbat": [
"a long stick for hitting baseballs",
"a baseball bat, not a tennis racket or branch",
"a wooden or metal bat for baseball",
],
"baseballglove": [
"a leather glove for catching baseballs",
"a baseball mitt, not a regular glove",
"a catching glove for baseball",
],
"tennisracket": [
"a racket with strings for hitting tennis balls",
"a tennis racket, not a baseball bat",
"a racket with oval head and handle",
],
"wineglass": [
"a stemmed glass for drinking wine",
"a wine glass with stem, not a regular cup or bowl",
"a tall stemmed glass distinct from a cup",
],
"hotdog": [
"a sausage in a bun, not a sandwich or pizza",
"a hot dog with bread roll, distinct from a sandwich",
"a hot dog food item with elongated shape",
],
"diningtable": [
"a table used for eating meals, not a desk or counter",
"a dining table with flat surface, distinct from a desk",
"a table for dining, often with chairs around it",
],
"cellphone": [
"a handheld mobile phone or smartphone",
"a cell phone with screen, not a remote control",
"a smartphone device distinct from a remote",
],
"teddybear": [
"a stuffed plush toy bear",
"a teddy bear toy, not a real bear",
"a soft stuffed animal distinct from a real bear",
],
"hairdrier": [
"an electric device for drying hair",
"a hair dryer appliance, not a toaster",
"a blow dryer for hair styling",
],
"toilet": [
"a bathroom fixture for waste disposal",
"a toilet bowl, not a sink or bathtub",
"a white porcelain toilet in bathroom",
],
# ============ COCO-Stuff confusable stuff categories ============
"building-other": [
"a building structure, not a house or skyscraper",
"a generic building distinct from a house",