class_names.py 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. # Copyright (c) OpenMMLab. All rights reserved.
  2. from mmengine.utils import is_str
  3. def wider_face_classes() -> list:
  4. """Class names of WIDERFace."""
  5. return ['face']
  6. def voc_classes() -> list:
  7. """Class names of PASCAL VOC."""
  8. return [
  9. 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat',
  10. 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person',
  11. 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'
  12. ]
  13. def imagenet_det_classes() -> list:
  14. """Class names of ImageNet Det."""
  15. return [
  16. 'accordion', 'airplane', 'ant', 'antelope', 'apple', 'armadillo',
  17. 'artichoke', 'axe', 'baby_bed', 'backpack', 'bagel', 'balance_beam',
  18. 'banana', 'band_aid', 'banjo', 'baseball', 'basketball', 'bathing_cap',
  19. 'beaker', 'bear', 'bee', 'bell_pepper', 'bench', 'bicycle', 'binder',
  20. 'bird', 'bookshelf', 'bow_tie', 'bow', 'bowl', 'brassiere', 'burrito',
  21. 'bus', 'butterfly', 'camel', 'can_opener', 'car', 'cart', 'cattle',
  22. 'cello', 'centipede', 'chain_saw', 'chair', 'chime', 'cocktail_shaker',
  23. 'coffee_maker', 'computer_keyboard', 'computer_mouse', 'corkscrew',
  24. 'cream', 'croquet_ball', 'crutch', 'cucumber', 'cup_or_mug', 'diaper',
  25. 'digital_clock', 'dishwasher', 'dog', 'domestic_cat', 'dragonfly',
  26. 'drum', 'dumbbell', 'electric_fan', 'elephant', 'face_powder', 'fig',
  27. 'filing_cabinet', 'flower_pot', 'flute', 'fox', 'french_horn', 'frog',
  28. 'frying_pan', 'giant_panda', 'goldfish', 'golf_ball', 'golfcart',
  29. 'guacamole', 'guitar', 'hair_dryer', 'hair_spray', 'hamburger',
  30. 'hammer', 'hamster', 'harmonica', 'harp', 'hat_with_a_wide_brim',
  31. 'head_cabbage', 'helmet', 'hippopotamus', 'horizontal_bar', 'horse',
  32. 'hotdog', 'iPod', 'isopod', 'jellyfish', 'koala_bear', 'ladle',
  33. 'ladybug', 'lamp', 'laptop', 'lemon', 'lion', 'lipstick', 'lizard',
  34. 'lobster', 'maillot', 'maraca', 'microphone', 'microwave', 'milk_can',
  35. 'miniskirt', 'monkey', 'motorcycle', 'mushroom', 'nail', 'neck_brace',
  36. 'oboe', 'orange', 'otter', 'pencil_box', 'pencil_sharpener', 'perfume',
  37. 'person', 'piano', 'pineapple', 'ping-pong_ball', 'pitcher', 'pizza',
  38. 'plastic_bag', 'plate_rack', 'pomegranate', 'popsicle', 'porcupine',
  39. 'power_drill', 'pretzel', 'printer', 'puck', 'punching_bag', 'purse',
  40. 'rabbit', 'racket', 'ray', 'red_panda', 'refrigerator',
  41. 'remote_control', 'rubber_eraser', 'rugby_ball', 'ruler',
  42. 'salt_or_pepper_shaker', 'saxophone', 'scorpion', 'screwdriver',
  43. 'seal', 'sheep', 'ski', 'skunk', 'snail', 'snake', 'snowmobile',
  44. 'snowplow', 'soap_dispenser', 'soccer_ball', 'sofa', 'spatula',
  45. 'squirrel', 'starfish', 'stethoscope', 'stove', 'strainer',
  46. 'strawberry', 'stretcher', 'sunglasses', 'swimming_trunks', 'swine',
  47. 'syringe', 'table', 'tape_player', 'tennis_ball', 'tick', 'tie',
  48. 'tiger', 'toaster', 'traffic_light', 'train', 'trombone', 'trumpet',
  49. 'turtle', 'tv_or_monitor', 'unicycle', 'vacuum', 'violin',
  50. 'volleyball', 'waffle_iron', 'washer', 'water_bottle', 'watercraft',
  51. 'whale', 'wine_bottle', 'zebra'
  52. ]
  53. def imagenet_vid_classes() -> list:
  54. """Class names of ImageNet VID."""
  55. return [
  56. 'airplane', 'antelope', 'bear', 'bicycle', 'bird', 'bus', 'car',
  57. 'cattle', 'dog', 'domestic_cat', 'elephant', 'fox', 'giant_panda',
  58. 'hamster', 'horse', 'lion', 'lizard', 'monkey', 'motorcycle', 'rabbit',
  59. 'red_panda', 'sheep', 'snake', 'squirrel', 'tiger', 'train', 'turtle',
  60. 'watercraft', 'whale', 'zebra'
  61. ]
  62. def coco_classes() -> list:
  63. """Class names of COCO."""
  64. return [
  65. 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
  66. 'truck', 'boat', 'traffic_light', 'fire_hydrant', 'stop_sign',
  67. 'parking_meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
  68. 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella',
  69. 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard',
  70. 'sports_ball', 'kite', 'baseball_bat', 'baseball_glove', 'skateboard',
  71. 'surfboard', 'tennis_racket', 'bottle', 'wine_glass', 'cup', 'fork',
  72. 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange',
  73. 'broccoli', 'carrot', 'hot_dog', 'pizza', 'donut', 'cake', 'chair',
  74. 'couch', 'potted_plant', 'bed', 'dining_table', 'toilet', 'tv',
  75. 'laptop', 'mouse', 'remote', 'keyboard', 'cell_phone', 'microwave',
  76. 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase',
  77. 'scissors', 'teddy_bear', 'hair_drier', 'toothbrush'
  78. ]
  79. def coco_panoptic_classes() -> list:
  80. """Class names of COCO panoptic."""
  81. return [
  82. 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
  83. 'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign',
  84. 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
  85. 'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella',
  86. 'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard',
  87. 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard',
  88. 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork',
  89. 'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange',
  90. 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
  91. 'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv',
  92. 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
  93. 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase',
  94. 'scissors', 'teddy bear', 'hair drier', 'toothbrush', 'banner',
  95. 'blanket', 'bridge', 'cardboard', 'counter', 'curtain', 'door-stuff',
  96. 'floor-wood', 'flower', 'fruit', 'gravel', 'house', 'light',
  97. 'mirror-stuff', 'net', 'pillow', 'platform', 'playingfield',
  98. 'railroad', 'river', 'road', 'roof', 'sand', 'sea', 'shelf', 'snow',
  99. 'stairs', 'tent', 'towel', 'wall-brick', 'wall-stone', 'wall-tile',
  100. 'wall-wood', 'water-other', 'window-blind', 'window-other',
  101. 'tree-merged', 'fence-merged', 'ceiling-merged', 'sky-other-merged',
  102. 'cabinet-merged', 'table-merged', 'floor-other-merged',
  103. 'pavement-merged', 'mountain-merged', 'grass-merged', 'dirt-merged',
  104. 'paper-merged', 'food-other-merged', 'building-other-merged',
  105. 'rock-merged', 'wall-other-merged', 'rug-merged'
  106. ]
  107. def cityscapes_classes() -> list:
  108. """Class names of Cityscapes."""
  109. return [
  110. 'person', 'rider', 'car', 'truck', 'bus', 'train', 'motorcycle',
  111. 'bicycle'
  112. ]
  113. def oid_challenge_classes() -> list:
  114. """Class names of Open Images Challenge."""
  115. return [
  116. 'Footwear', 'Jeans', 'House', 'Tree', 'Woman', 'Man', 'Land vehicle',
  117. 'Person', 'Wheel', 'Bus', 'Human face', 'Bird', 'Dress', 'Girl',
  118. 'Vehicle', 'Building', 'Cat', 'Car', 'Belt', 'Elephant', 'Dessert',
  119. 'Butterfly', 'Train', 'Guitar', 'Poster', 'Book', 'Boy', 'Bee',
  120. 'Flower', 'Window', 'Hat', 'Human head', 'Dog', 'Human arm', 'Drink',
  121. 'Human mouth', 'Human hair', 'Human nose', 'Human hand', 'Table',
  122. 'Marine invertebrates', 'Fish', 'Sculpture', 'Rose', 'Street light',
  123. 'Glasses', 'Fountain', 'Skyscraper', 'Swimwear', 'Brassiere', 'Drum',
  124. 'Duck', 'Countertop', 'Furniture', 'Ball', 'Human leg', 'Boat',
  125. 'Balloon', 'Bicycle helmet', 'Goggles', 'Door', 'Human eye', 'Shirt',
  126. 'Toy', 'Teddy bear', 'Pasta', 'Tomato', 'Human ear',
  127. 'Vehicle registration plate', 'Microphone', 'Musical keyboard',
  128. 'Tower', 'Houseplant', 'Flowerpot', 'Fruit', 'Vegetable',
  129. 'Musical instrument', 'Suit', 'Motorcycle', 'Bagel', 'French fries',
  130. 'Hamburger', 'Chair', 'Salt and pepper shakers', 'Snail', 'Airplane',
  131. 'Horse', 'Laptop', 'Computer keyboard', 'Football helmet', 'Cocktail',
  132. 'Juice', 'Tie', 'Computer monitor', 'Human beard', 'Bottle',
  133. 'Saxophone', 'Lemon', 'Mouse', 'Sock', 'Cowboy hat', 'Sun hat',
  134. 'Football', 'Porch', 'Sunglasses', 'Lobster', 'Crab', 'Picture frame',
  135. 'Van', 'Crocodile', 'Surfboard', 'Shorts', 'Helicopter', 'Helmet',
  136. 'Sports uniform', 'Taxi', 'Swan', 'Goose', 'Coat', 'Jacket', 'Handbag',
  137. 'Flag', 'Skateboard', 'Television', 'Tire', 'Spoon', 'Palm tree',
  138. 'Stairs', 'Salad', 'Castle', 'Oven', 'Microwave oven', 'Wine',
  139. 'Ceiling fan', 'Mechanical fan', 'Cattle', 'Truck', 'Box', 'Ambulance',
  140. 'Desk', 'Wine glass', 'Reptile', 'Tank', 'Traffic light', 'Billboard',
  141. 'Tent', 'Insect', 'Spider', 'Treadmill', 'Cupboard', 'Shelf',
  142. 'Seat belt', 'Human foot', 'Bicycle', 'Bicycle wheel', 'Couch',
  143. 'Bookcase', 'Fedora', 'Backpack', 'Bench', 'Oyster',
  144. 'Moths and butterflies', 'Lavender', 'Waffle', 'Fork', 'Animal',
  145. 'Accordion', 'Mobile phone', 'Plate', 'Coffee cup', 'Saucer',
  146. 'Platter', 'Dagger', 'Knife', 'Bull', 'Tortoise', 'Sea turtle', 'Deer',
  147. 'Weapon', 'Apple', 'Ski', 'Taco', 'Traffic sign', 'Beer', 'Necklace',
  148. 'Sunflower', 'Piano', 'Organ', 'Harpsichord', 'Bed', 'Cabinetry',
  149. 'Nightstand', 'Curtain', 'Chest of drawers', 'Drawer', 'Parrot',
  150. 'Sandal', 'High heels', 'Tableware', 'Cart', 'Mushroom', 'Kite',
  151. 'Missile', 'Seafood', 'Camera', 'Paper towel', 'Toilet paper',
  152. 'Sombrero', 'Radish', 'Lighthouse', 'Segway', 'Pig', 'Watercraft',
  153. 'Golf cart', 'studio couch', 'Dolphin', 'Whale', 'Earrings', 'Otter',
  154. 'Sea lion', 'Whiteboard', 'Monkey', 'Gondola', 'Zebra',
  155. 'Baseball glove', 'Scarf', 'Adhesive tape', 'Trousers', 'Scoreboard',
  156. 'Lily', 'Carnivore', 'Power plugs and sockets', 'Office building',
  157. 'Sandwich', 'Swimming pool', 'Headphones', 'Tin can', 'Crown', 'Doll',
  158. 'Cake', 'Frog', 'Beetle', 'Ant', 'Gas stove', 'Canoe', 'Falcon',
  159. 'Blue jay', 'Egg', 'Fire hydrant', 'Raccoon', 'Muffin', 'Wall clock',
  160. 'Coffee', 'Mug', 'Tea', 'Bear', 'Waste container', 'Home appliance',
  161. 'Candle', 'Lion', 'Mirror', 'Starfish', 'Marine mammal', 'Wheelchair',
  162. 'Umbrella', 'Alpaca', 'Violin', 'Cello', 'Brown bear', 'Canary', 'Bat',
  163. 'Ruler', 'Plastic bag', 'Penguin', 'Watermelon', 'Harbor seal', 'Pen',
  164. 'Pumpkin', 'Harp', 'Kitchen appliance', 'Roller skates', 'Bust',
  165. 'Coffee table', 'Tennis ball', 'Tennis racket', 'Ladder', 'Boot',
  166. 'Bowl', 'Stop sign', 'Volleyball', 'Eagle', 'Paddle', 'Chicken',
  167. 'Skull', 'Lamp', 'Beehive', 'Maple', 'Sink', 'Goldfish', 'Tripod',
  168. 'Coconut', 'Bidet', 'Tap', 'Bathroom cabinet', 'Toilet',
  169. 'Filing cabinet', 'Pretzel', 'Table tennis racket', 'Bronze sculpture',
  170. 'Rocket', 'Mouse', 'Hamster', 'Lizard', 'Lifejacket', 'Goat',
  171. 'Washing machine', 'Trumpet', 'Horn', 'Trombone', 'Sheep',
  172. 'Tablet computer', 'Pillow', 'Kitchen & dining room table',
  173. 'Parachute', 'Raven', 'Glove', 'Loveseat', 'Christmas tree',
  174. 'Shellfish', 'Rifle', 'Shotgun', 'Sushi', 'Sparrow', 'Bread',
  175. 'Toaster', 'Watch', 'Asparagus', 'Artichoke', 'Suitcase', 'Antelope',
  176. 'Broccoli', 'Ice cream', 'Racket', 'Banana', 'Cookie', 'Cucumber',
  177. 'Dragonfly', 'Lynx', 'Caterpillar', 'Light bulb', 'Office supplies',
  178. 'Miniskirt', 'Skirt', 'Fireplace', 'Potato', 'Light switch',
  179. 'Croissant', 'Cabbage', 'Ladybug', 'Handgun', 'Luggage and bags',
  180. 'Window blind', 'Snowboard', 'Baseball bat', 'Digital clock',
  181. 'Serving tray', 'Infant bed', 'Sofa bed', 'Guacamole', 'Fox', 'Pizza',
  182. 'Snowplow', 'Jet ski', 'Refrigerator', 'Lantern', 'Convenience store',
  183. 'Sword', 'Rugby ball', 'Owl', 'Ostrich', 'Pancake', 'Strawberry',
  184. 'Carrot', 'Tart', 'Dice', 'Turkey', 'Rabbit', 'Invertebrate', 'Vase',
  185. 'Stool', 'Swim cap', 'Shower', 'Clock', 'Jellyfish', 'Aircraft',
  186. 'Chopsticks', 'Orange', 'Snake', 'Sewing machine', 'Kangaroo', 'Mixer',
  187. 'Food processor', 'Shrimp', 'Towel', 'Porcupine', 'Jaguar', 'Cannon',
  188. 'Limousine', 'Mule', 'Squirrel', 'Kitchen knife', 'Tiara', 'Tiger',
  189. 'Bow and arrow', 'Candy', 'Rhinoceros', 'Shark', 'Cricket ball',
  190. 'Doughnut', 'Plumbing fixture', 'Camel', 'Polar bear', 'Coin',
  191. 'Printer', 'Blender', 'Giraffe', 'Billiard table', 'Kettle',
  192. 'Dinosaur', 'Pineapple', 'Zucchini', 'Jug', 'Barge', 'Teapot',
  193. 'Golf ball', 'Binoculars', 'Scissors', 'Hot dog', 'Door handle',
  194. 'Seahorse', 'Bathtub', 'Leopard', 'Centipede', 'Grapefruit', 'Snowman',
  195. 'Cheetah', 'Alarm clock', 'Grape', 'Wrench', 'Wok', 'Bell pepper',
  196. 'Cake stand', 'Barrel', 'Woodpecker', 'Flute', 'Corded phone',
  197. 'Willow', 'Punching bag', 'Pomegranate', 'Telephone', 'Pear',
  198. 'Common fig', 'Bench', 'Wood-burning stove', 'Burrito', 'Nail',
  199. 'Turtle', 'Submarine sandwich', 'Drinking straw', 'Peach', 'Popcorn',
  200. 'Frying pan', 'Picnic basket', 'Honeycomb', 'Envelope', 'Mango',
  201. 'Cutting board', 'Pitcher', 'Stationary bicycle', 'Dumbbell',
  202. 'Personal care', 'Dog bed', 'Snowmobile', 'Oboe', 'Briefcase',
  203. 'Squash', 'Tick', 'Slow cooker', 'Coffeemaker', 'Measuring cup',
  204. 'Crutch', 'Stretcher', 'Screwdriver', 'Flashlight', 'Spatula',
  205. 'Pressure cooker', 'Ring binder', 'Beaker', 'Torch', 'Winter melon'
  206. ]
  207. def oid_v6_classes() -> list:
  208. """Class names of Open Images V6."""
  209. return [
  210. 'Tortoise', 'Container', 'Magpie', 'Sea turtle', 'Football',
  211. 'Ambulance', 'Ladder', 'Toothbrush', 'Syringe', 'Sink', 'Toy',
  212. 'Organ (Musical Instrument)', 'Cassette deck', 'Apple', 'Human eye',
  213. 'Cosmetics', 'Paddle', 'Snowman', 'Beer', 'Chopsticks', 'Human beard',
  214. 'Bird', 'Parking meter', 'Traffic light', 'Croissant', 'Cucumber',
  215. 'Radish', 'Towel', 'Doll', 'Skull', 'Washing machine', 'Glove', 'Tick',
  216. 'Belt', 'Sunglasses', 'Banjo', 'Cart', 'Ball', 'Backpack', 'Bicycle',
  217. 'Home appliance', 'Centipede', 'Boat', 'Surfboard', 'Boot',
  218. 'Headphones', 'Hot dog', 'Shorts', 'Fast food', 'Bus', 'Boy',
  219. 'Screwdriver', 'Bicycle wheel', 'Barge', 'Laptop', 'Miniskirt',
  220. 'Drill (Tool)', 'Dress', 'Bear', 'Waffle', 'Pancake', 'Brown bear',
  221. 'Woodpecker', 'Blue jay', 'Pretzel', 'Bagel', 'Tower', 'Teapot',
  222. 'Person', 'Bow and arrow', 'Swimwear', 'Beehive', 'Brassiere', 'Bee',
  223. 'Bat (Animal)', 'Starfish', 'Popcorn', 'Burrito', 'Chainsaw',
  224. 'Balloon', 'Wrench', 'Tent', 'Vehicle registration plate', 'Lantern',
  225. 'Toaster', 'Flashlight', 'Billboard', 'Tiara', 'Limousine', 'Necklace',
  226. 'Carnivore', 'Scissors', 'Stairs', 'Computer keyboard', 'Printer',
  227. 'Traffic sign', 'Chair', 'Shirt', 'Poster', 'Cheese', 'Sock',
  228. 'Fire hydrant', 'Land vehicle', 'Earrings', 'Tie', 'Watercraft',
  229. 'Cabinetry', 'Suitcase', 'Muffin', 'Bidet', 'Snack', 'Snowmobile',
  230. 'Clock', 'Medical equipment', 'Cattle', 'Cello', 'Jet ski', 'Camel',
  231. 'Coat', 'Suit', 'Desk', 'Cat', 'Bronze sculpture', 'Juice', 'Gondola',
  232. 'Beetle', 'Cannon', 'Computer mouse', 'Cookie', 'Office building',
  233. 'Fountain', 'Coin', 'Calculator', 'Cocktail', 'Computer monitor',
  234. 'Box', 'Stapler', 'Christmas tree', 'Cowboy hat', 'Hiking equipment',
  235. 'Studio couch', 'Drum', 'Dessert', 'Wine rack', 'Drink', 'Zucchini',
  236. 'Ladle', 'Human mouth', 'Dairy Product', 'Dice', 'Oven', 'Dinosaur',
  237. 'Ratchet (Device)', 'Couch', 'Cricket ball', 'Winter melon', 'Spatula',
  238. 'Whiteboard', 'Pencil sharpener', 'Door', 'Hat', 'Shower', 'Eraser',
  239. 'Fedora', 'Guacamole', 'Dagger', 'Scarf', 'Dolphin', 'Sombrero',
  240. 'Tin can', 'Mug', 'Tap', 'Harbor seal', 'Stretcher', 'Can opener',
  241. 'Goggles', 'Human body', 'Roller skates', 'Coffee cup',
  242. 'Cutting board', 'Blender', 'Plumbing fixture', 'Stop sign',
  243. 'Office supplies', 'Volleyball (Ball)', 'Vase', 'Slow cooker',
  244. 'Wardrobe', 'Coffee', 'Whisk', 'Paper towel', 'Personal care', 'Food',
  245. 'Sun hat', 'Tree house', 'Flying disc', 'Skirt', 'Gas stove',
  246. 'Salt and pepper shakers', 'Mechanical fan', 'Face powder', 'Fax',
  247. 'Fruit', 'French fries', 'Nightstand', 'Barrel', 'Kite', 'Tart',
  248. 'Treadmill', 'Fox', 'Flag', 'French horn', 'Window blind',
  249. 'Human foot', 'Golf cart', 'Jacket', 'Egg (Food)', 'Street light',
  250. 'Guitar', 'Pillow', 'Human leg', 'Isopod', 'Grape', 'Human ear',
  251. 'Power plugs and sockets', 'Panda', 'Giraffe', 'Woman', 'Door handle',
  252. 'Rhinoceros', 'Bathtub', 'Goldfish', 'Houseplant', 'Goat',
  253. 'Baseball bat', 'Baseball glove', 'Mixing bowl',
  254. 'Marine invertebrates', 'Kitchen utensil', 'Light switch', 'House',
  255. 'Horse', 'Stationary bicycle', 'Hammer', 'Ceiling fan', 'Sofa bed',
  256. 'Adhesive tape', 'Harp', 'Sandal', 'Bicycle helmet', 'Saucer',
  257. 'Harpsichord', 'Human hair', 'Heater', 'Harmonica', 'Hamster',
  258. 'Curtain', 'Bed', 'Kettle', 'Fireplace', 'Scale', 'Drinking straw',
  259. 'Insect', 'Hair dryer', 'Kitchenware', 'Indoor rower', 'Invertebrate',
  260. 'Food processor', 'Bookcase', 'Refrigerator', 'Wood-burning stove',
  261. 'Punching bag', 'Common fig', 'Cocktail shaker', 'Jaguar (Animal)',
  262. 'Golf ball', 'Fashion accessory', 'Alarm clock', 'Filing cabinet',
  263. 'Artichoke', 'Table', 'Tableware', 'Kangaroo', 'Koala', 'Knife',
  264. 'Bottle', 'Bottle opener', 'Lynx', 'Lavender (Plant)', 'Lighthouse',
  265. 'Dumbbell', 'Human head', 'Bowl', 'Humidifier', 'Porch', 'Lizard',
  266. 'Billiard table', 'Mammal', 'Mouse', 'Motorcycle',
  267. 'Musical instrument', 'Swim cap', 'Frying pan', 'Snowplow',
  268. 'Bathroom cabinet', 'Missile', 'Bust', 'Man', 'Waffle iron', 'Milk',
  269. 'Ring binder', 'Plate', 'Mobile phone', 'Baked goods', 'Mushroom',
  270. 'Crutch', 'Pitcher (Container)', 'Mirror', 'Personal flotation device',
  271. 'Table tennis racket', 'Pencil case', 'Musical keyboard', 'Scoreboard',
  272. 'Briefcase', 'Kitchen knife', 'Nail (Construction)', 'Tennis ball',
  273. 'Plastic bag', 'Oboe', 'Chest of drawers', 'Ostrich', 'Piano', 'Girl',
  274. 'Plant', 'Potato', 'Hair spray', 'Sports equipment', 'Pasta',
  275. 'Penguin', 'Pumpkin', 'Pear', 'Infant bed', 'Polar bear', 'Mixer',
  276. 'Cupboard', 'Jacuzzi', 'Pizza', 'Digital clock', 'Pig', 'Reptile',
  277. 'Rifle', 'Lipstick', 'Skateboard', 'Raven', 'High heels', 'Red panda',
  278. 'Rose', 'Rabbit', 'Sculpture', 'Saxophone', 'Shotgun', 'Seafood',
  279. 'Submarine sandwich', 'Snowboard', 'Sword', 'Picture frame', 'Sushi',
  280. 'Loveseat', 'Ski', 'Squirrel', 'Tripod', 'Stethoscope', 'Submarine',
  281. 'Scorpion', 'Segway', 'Training bench', 'Snake', 'Coffee table',
  282. 'Skyscraper', 'Sheep', 'Television', 'Trombone', 'Tea', 'Tank', 'Taco',
  283. 'Telephone', 'Torch', 'Tiger', 'Strawberry', 'Trumpet', 'Tree',
  284. 'Tomato', 'Train', 'Tool', 'Picnic basket', 'Cooking spray',
  285. 'Trousers', 'Bowling equipment', 'Football helmet', 'Truck',
  286. 'Measuring cup', 'Coffeemaker', 'Violin', 'Vehicle', 'Handbag',
  287. 'Paper cutter', 'Wine', 'Weapon', 'Wheel', 'Worm', 'Wok', 'Whale',
  288. 'Zebra', 'Auto part', 'Jug', 'Pizza cutter', 'Cream', 'Monkey', 'Lion',
  289. 'Bread', 'Platter', 'Chicken', 'Eagle', 'Helicopter', 'Owl', 'Duck',
  290. 'Turtle', 'Hippopotamus', 'Crocodile', 'Toilet', 'Toilet paper',
  291. 'Squid', 'Clothing', 'Footwear', 'Lemon', 'Spider', 'Deer', 'Frog',
  292. 'Banana', 'Rocket', 'Wine glass', 'Countertop', 'Tablet computer',
  293. 'Waste container', 'Swimming pool', 'Dog', 'Book', 'Elephant', 'Shark',
  294. 'Candle', 'Leopard', 'Axe', 'Hand dryer', 'Soap dispenser',
  295. 'Porcupine', 'Flower', 'Canary', 'Cheetah', 'Palm tree', 'Hamburger',
  296. 'Maple', 'Building', 'Fish', 'Lobster', 'Garden Asparagus',
  297. 'Furniture', 'Hedgehog', 'Airplane', 'Spoon', 'Otter', 'Bull',
  298. 'Oyster', 'Horizontal bar', 'Convenience store', 'Bomb', 'Bench',
  299. 'Ice cream', 'Caterpillar', 'Butterfly', 'Parachute', 'Orange',
  300. 'Antelope', 'Beaker', 'Moths and butterflies', 'Window', 'Closet',
  301. 'Castle', 'Jellyfish', 'Goose', 'Mule', 'Swan', 'Peach', 'Coconut',
  302. 'Seat belt', 'Raccoon', 'Chisel', 'Fork', 'Lamp', 'Camera',
  303. 'Squash (Plant)', 'Racket', 'Human face', 'Human arm', 'Vegetable',
  304. 'Diaper', 'Unicycle', 'Falcon', 'Chime', 'Snail', 'Shellfish',
  305. 'Cabbage', 'Carrot', 'Mango', 'Jeans', 'Flowerpot', 'Pineapple',
  306. 'Drawer', 'Stool', 'Envelope', 'Cake', 'Dragonfly', 'Common sunflower',
  307. 'Microwave oven', 'Honeycomb', 'Marine mammal', 'Sea lion', 'Ladybug',
  308. 'Shelf', 'Watch', 'Candy', 'Salad', 'Parrot', 'Handgun', 'Sparrow',
  309. 'Van', 'Grinder', 'Spice rack', 'Light bulb', 'Corded phone',
  310. 'Sports uniform', 'Tennis racket', 'Wall clock', 'Serving tray',
  311. 'Kitchen & dining room table', 'Dog bed', 'Cake stand',
  312. 'Cat furniture', 'Bathroom accessory', 'Facial tissue holder',
  313. 'Pressure cooker', 'Kitchen appliance', 'Tire', 'Ruler',
  314. 'Luggage and bags', 'Microphone', 'Broccoli', 'Umbrella', 'Pastry',
  315. 'Grapefruit', 'Band-aid', 'Animal', 'Bell pepper', 'Turkey', 'Lily',
  316. 'Pomegranate', 'Doughnut', 'Glasses', 'Human nose', 'Pen', 'Ant',
  317. 'Car', 'Aircraft', 'Human hand', 'Skunk', 'Teddy bear', 'Watermelon',
  318. 'Cantaloupe', 'Dishwasher', 'Flute', 'Balance beam', 'Sandwich',
  319. 'Shrimp', 'Sewing machine', 'Binoculars', 'Rays and skates', 'Ipod',
  320. 'Accordion', 'Willow', 'Crab', 'Crown', 'Seahorse', 'Perfume',
  321. 'Alpaca', 'Taxi', 'Canoe', 'Remote control', 'Wheelchair',
  322. 'Rugby ball', 'Armadillo', 'Maracas', 'Helmet'
  323. ]
  324. def objects365v1_classes() -> list:
  325. """Class names of Objects365 V1."""
  326. return [
  327. 'person', 'sneakers', 'chair', 'hat', 'lamp', 'bottle',
  328. 'cabinet/shelf', 'cup', 'car', 'glasses', 'picture/frame', 'desk',
  329. 'handbag', 'street lights', 'book', 'plate', 'helmet', 'leather shoes',
  330. 'pillow', 'glove', 'potted plant', 'bracelet', 'flower', 'tv',
  331. 'storage box', 'vase', 'bench', 'wine glass', 'boots', 'bowl',
  332. 'dining table', 'umbrella', 'boat', 'flag', 'speaker', 'trash bin/can',
  333. 'stool', 'backpack', 'couch', 'belt', 'carpet', 'basket',
  334. 'towel/napkin', 'slippers', 'barrel/bucket', 'coffee table', 'suv',
  335. 'toy', 'tie', 'bed', 'traffic light', 'pen/pencil', 'microphone',
  336. 'sandals', 'canned', 'necklace', 'mirror', 'faucet', 'bicycle',
  337. 'bread', 'high heels', 'ring', 'van', 'watch', 'sink', 'horse', 'fish',
  338. 'apple', 'camera', 'candle', 'teddy bear', 'cake', 'motorcycle',
  339. 'wild bird', 'laptop', 'knife', 'traffic sign', 'cell phone', 'paddle',
  340. 'truck', 'cow', 'power outlet', 'clock', 'drum', 'fork', 'bus',
  341. 'hanger', 'nightstand', 'pot/pan', 'sheep', 'guitar', 'traffic cone',
  342. 'tea pot', 'keyboard', 'tripod', 'hockey', 'fan', 'dog', 'spoon',
  343. 'blackboard/whiteboard', 'balloon', 'air conditioner', 'cymbal',
  344. 'mouse', 'telephone', 'pickup truck', 'orange', 'banana', 'airplane',
  345. 'luggage', 'skis', 'soccer', 'trolley', 'oven', 'remote',
  346. 'baseball glove', 'paper towel', 'refrigerator', 'train', 'tomato',
  347. 'machinery vehicle', 'tent', 'shampoo/shower gel', 'head phone',
  348. 'lantern', 'donut', 'cleaning products', 'sailboat', 'tangerine',
  349. 'pizza', 'kite', 'computer box', 'elephant', 'toiletries', 'gas stove',
  350. 'broccoli', 'toilet', 'stroller', 'shovel', 'baseball bat',
  351. 'microwave', 'skateboard', 'surfboard', 'surveillance camera', 'gun',
  352. 'life saver', 'cat', 'lemon', 'liquid soap', 'zebra', 'duck',
  353. 'sports car', 'giraffe', 'pumpkin', 'piano', 'stop sign', 'radiator',
  354. 'converter', 'tissue ', 'carrot', 'washing machine', 'vent', 'cookies',
  355. 'cutting/chopping board', 'tennis racket', 'candy',
  356. 'skating and skiing shoes', 'scissors', 'folder', 'baseball',
  357. 'strawberry', 'bow tie', 'pigeon', 'pepper', 'coffee machine',
  358. 'bathtub', 'snowboard', 'suitcase', 'grapes', 'ladder', 'pear',
  359. 'american football', 'basketball', 'potato', 'paint brush', 'printer',
  360. 'billiards', 'fire hydrant', 'goose', 'projector', 'sausage',
  361. 'fire extinguisher', 'extension cord', 'facial mask', 'tennis ball',
  362. 'chopsticks', 'electronic stove and gas stove', 'pie', 'frisbee',
  363. 'kettle', 'hamburger', 'golf club', 'cucumber', 'clutch', 'blender',
  364. 'tong', 'slide', 'hot dog', 'toothbrush', 'facial cleanser', 'mango',
  365. 'deer', 'egg', 'violin', 'marker', 'ship', 'chicken', 'onion',
  366. 'ice cream', 'tape', 'wheelchair', 'plum', 'bar soap', 'scale',
  367. 'watermelon', 'cabbage', 'router/modem', 'golf ball', 'pine apple',
  368. 'crane', 'fire truck', 'peach', 'cello', 'notepaper', 'tricycle',
  369. 'toaster', 'helicopter', 'green beans', 'brush', 'carriage', 'cigar',
  370. 'earphone', 'penguin', 'hurdle', 'swing', 'radio', 'CD',
  371. 'parking meter', 'swan', 'garlic', 'french fries', 'horn', 'avocado',
  372. 'saxophone', 'trumpet', 'sandwich', 'cue', 'kiwi fruit', 'bear',
  373. 'fishing rod', 'cherry', 'tablet', 'green vegetables', 'nuts', 'corn',
  374. 'key', 'screwdriver', 'globe', 'broom', 'pliers', 'volleyball',
  375. 'hammer', 'eggplant', 'trophy', 'dates', 'board eraser', 'rice',
  376. 'tape measure/ruler', 'dumbbell', 'hamimelon', 'stapler', 'camel',
  377. 'lettuce', 'goldfish', 'meat balls', 'medal', 'toothpaste', 'antelope',
  378. 'shrimp', 'rickshaw', 'trombone', 'pomegranate', 'coconut',
  379. 'jellyfish', 'mushroom', 'calculator', 'treadmill', 'butterfly',
  380. 'egg tart', 'cheese', 'pig', 'pomelo', 'race car', 'rice cooker',
  381. 'tuba', 'crosswalk sign', 'papaya', 'hair drier', 'green onion',
  382. 'chips', 'dolphin', 'sushi', 'urinal', 'donkey', 'electric drill',
  383. 'spring rolls', 'tortoise/turtle', 'parrot', 'flute', 'measuring cup',
  384. 'shark', 'steak', 'poker card', 'binoculars', 'llama', 'radish',
  385. 'noodles', 'yak', 'mop', 'crab', 'microscope', 'barbell', 'bread/bun',
  386. 'baozi', 'lion', 'red cabbage', 'polar bear', 'lighter', 'seal',
  387. 'mangosteen', 'comb', 'eraser', 'pitaya', 'scallop', 'pencil case',
  388. 'saw', 'table tennis paddle', 'okra', 'starfish', 'eagle', 'monkey',
  389. 'durian', 'game board', 'rabbit', 'french horn', 'ambulance',
  390. 'asparagus', 'hoverboard', 'pasta', 'target', 'hotair balloon',
  391. 'chainsaw', 'lobster', 'iron', 'flashlight'
  392. ]
  393. def objects365v2_classes() -> list:
  394. """Class names of Objects365 V2."""
  395. return [
  396. 'Person', 'Sneakers', 'Chair', 'Other Shoes', 'Hat', 'Car', 'Lamp',
  397. 'Glasses', 'Bottle', 'Desk', 'Cup', 'Street Lights', 'Cabinet/shelf',
  398. 'Handbag/Satchel', 'Bracelet', 'Plate', 'Picture/Frame', 'Helmet',
  399. 'Book', 'Gloves', 'Storage box', 'Boat', 'Leather Shoes', 'Flower',
  400. 'Bench', 'Potted Plant', 'Bowl/Basin', 'Flag', 'Pillow', 'Boots',
  401. 'Vase', 'Microphone', 'Necklace', 'Ring', 'SUV', 'Wine Glass', 'Belt',
  402. 'Moniter/TV', 'Backpack', 'Umbrella', 'Traffic Light', 'Speaker',
  403. 'Watch', 'Tie', 'Trash bin Can', 'Slippers', 'Bicycle', 'Stool',
  404. 'Barrel/bucket', 'Van', 'Couch', 'Sandals', 'Bakset', 'Drum',
  405. 'Pen/Pencil', 'Bus', 'Wild Bird', 'High Heels', 'Motorcycle', 'Guitar',
  406. 'Carpet', 'Cell Phone', 'Bread', 'Camera', 'Canned', 'Truck',
  407. 'Traffic cone', 'Cymbal', 'Lifesaver', 'Towel', 'Stuffed Toy',
  408. 'Candle', 'Sailboat', 'Laptop', 'Awning', 'Bed', 'Faucet', 'Tent',
  409. 'Horse', 'Mirror', 'Power outlet', 'Sink', 'Apple', 'Air Conditioner',
  410. 'Knife', 'Hockey Stick', 'Paddle', 'Pickup Truck', 'Fork',
  411. 'Traffic Sign', 'Ballon', 'Tripod', 'Dog', 'Spoon', 'Clock', 'Pot',
  412. 'Cow', 'Cake', 'Dinning Table', 'Sheep', 'Hanger',
  413. 'Blackboard/Whiteboard', 'Napkin', 'Other Fish', 'Orange/Tangerine',
  414. 'Toiletry', 'Keyboard', 'Tomato', 'Lantern', 'Machinery Vehicle',
  415. 'Fan', 'Green Vegetables', 'Banana', 'Baseball Glove', 'Airplane',
  416. 'Mouse', 'Train', 'Pumpkin', 'Soccer', 'Skiboard', 'Luggage',
  417. 'Nightstand', 'Tea pot', 'Telephone', 'Trolley', 'Head Phone',
  418. 'Sports Car', 'Stop Sign', 'Dessert', 'Scooter', 'Stroller', 'Crane',
  419. 'Remote', 'Refrigerator', 'Oven', 'Lemon', 'Duck', 'Baseball Bat',
  420. 'Surveillance Camera', 'Cat', 'Jug', 'Broccoli', 'Piano', 'Pizza',
  421. 'Elephant', 'Skateboard', 'Surfboard', 'Gun',
  422. 'Skating and Skiing shoes', 'Gas stove', 'Donut', 'Bow Tie', 'Carrot',
  423. 'Toilet', 'Kite', 'Strawberry', 'Other Balls', 'Shovel', 'Pepper',
  424. 'Computer Box', 'Toilet Paper', 'Cleaning Products', 'Chopsticks',
  425. 'Microwave', 'Pigeon', 'Baseball', 'Cutting/chopping Board',
  426. 'Coffee Table', 'Side Table', 'Scissors', 'Marker', 'Pie', 'Ladder',
  427. 'Snowboard', 'Cookies', 'Radiator', 'Fire Hydrant', 'Basketball',
  428. 'Zebra', 'Grape', 'Giraffe', 'Potato', 'Sausage', 'Tricycle', 'Violin',
  429. 'Egg', 'Fire Extinguisher', 'Candy', 'Fire Truck', 'Billards',
  430. 'Converter', 'Bathtub', 'Wheelchair', 'Golf Club', 'Briefcase',
  431. 'Cucumber', 'Cigar/Cigarette ', 'Paint Brush', 'Pear', 'Heavy Truck',
  432. 'Hamburger', 'Extractor', 'Extention Cord', 'Tong', 'Tennis Racket',
  433. 'Folder', 'American Football', 'earphone', 'Mask', 'Kettle', 'Tennis',
  434. 'Ship', 'Swing', 'Coffee Machine', 'Slide', 'Carriage', 'Onion',
  435. 'Green beans', 'Projector', 'Frisbee',
  436. 'Washing Machine/Drying Machine', 'Chicken', 'Printer', 'Watermelon',
  437. 'Saxophone', 'Tissue', 'Toothbrush', 'Ice cream', 'Hotair ballon',
  438. 'Cello', 'French Fries', 'Scale', 'Trophy', 'Cabbage', 'Hot dog',
  439. 'Blender', 'Peach', 'Rice', 'Wallet/Purse', 'Volleyball', 'Deer',
  440. 'Goose', 'Tape', 'Tablet', 'Cosmetics', 'Trumpet', 'Pineapple',
  441. 'Golf Ball', 'Ambulance', 'Parking meter', 'Mango', 'Key', 'Hurdle',
  442. 'Fishing Rod', 'Medal', 'Flute', 'Brush', 'Penguin', 'Megaphone',
  443. 'Corn', 'Lettuce', 'Garlic', 'Swan', 'Helicopter', 'Green Onion',
  444. 'Sandwich', 'Nuts', 'Speed Limit Sign', 'Induction Cooker', 'Broom',
  445. 'Trombone', 'Plum', 'Rickshaw', 'Goldfish', 'Kiwi fruit',
  446. 'Router/modem', 'Poker Card', 'Toaster', 'Shrimp', 'Sushi', 'Cheese',
  447. 'Notepaper', 'Cherry', 'Pliers', 'CD', 'Pasta', 'Hammer', 'Cue',
  448. 'Avocado', 'Hamimelon', 'Flask', 'Mushroon', 'Screwdriver', 'Soap',
  449. 'Recorder', 'Bear', 'Eggplant', 'Board Eraser', 'Coconut',
  450. 'Tape Measur/ Ruler', 'Pig', 'Showerhead', 'Globe', 'Chips', 'Steak',
  451. 'Crosswalk Sign', 'Stapler', 'Campel', 'Formula 1 ', 'Pomegranate',
  452. 'Dishwasher', 'Crab', 'Hoverboard', 'Meat ball', 'Rice Cooker', 'Tuba',
  453. 'Calculator', 'Papaya', 'Antelope', 'Parrot', 'Seal', 'Buttefly',
  454. 'Dumbbell', 'Donkey', 'Lion', 'Urinal', 'Dolphin', 'Electric Drill',
  455. 'Hair Dryer', 'Egg tart', 'Jellyfish', 'Treadmill', 'Lighter',
  456. 'Grapefruit', 'Game board', 'Mop', 'Radish', 'Baozi', 'Target',
  457. 'French', 'Spring Rolls', 'Monkey', 'Rabbit', 'Pencil Case', 'Yak',
  458. 'Red Cabbage', 'Binoculars', 'Asparagus', 'Barbell', 'Scallop',
  459. 'Noddles', 'Comb', 'Dumpling', 'Oyster', 'Table Teniis paddle',
  460. 'Cosmetics Brush/Eyeliner Pencil', 'Chainsaw', 'Eraser', 'Lobster',
  461. 'Durian', 'Okra', 'Lipstick', 'Cosmetics Mirror', 'Curling',
  462. 'Table Tennis '
  463. ]
  464. dataset_aliases = {
  465. 'voc': ['voc', 'pascal_voc', 'voc07', 'voc12'],
  466. 'imagenet_det': ['det', 'imagenet_det', 'ilsvrc_det'],
  467. 'imagenet_vid': ['vid', 'imagenet_vid', 'ilsvrc_vid'],
  468. 'coco': ['coco', 'mscoco', 'ms_coco'],
  469. 'coco_panoptic': ['coco_panoptic', 'panoptic'],
  470. 'wider_face': ['WIDERFaceDataset', 'wider_face', 'WIDERFace'],
  471. 'cityscapes': ['cityscapes'],
  472. 'oid_challenge': ['oid_challenge', 'openimages_challenge'],
  473. 'oid_v6': ['oid_v6', 'openimages_v6'],
  474. 'objects365v1': ['objects365v1', 'obj365v1'],
  475. 'objects365v2': ['objects365v2', 'obj365v2']
  476. }
  477. def get_classes(dataset) -> list:
  478. """Get class names of a dataset."""
  479. alias2name = {}
  480. for name, aliases in dataset_aliases.items():
  481. for alias in aliases:
  482. alias2name[alias] = name
  483. if is_str(dataset):
  484. if dataset in alias2name:
  485. labels = eval(alias2name[dataset] + '_classes()')
  486. else:
  487. raise ValueError(f'Unrecognized dataset: {dataset}')
  488. else:
  489. raise TypeError(f'dataset must a str, but got {type(dataset)}')
  490. return labels