#!/usr/bin/env python3 """下載 Places365 類別標籤""" import json from pathlib import Path # Places365 場景類別(365 個) PLACES365_CATEGORIES = [ "airplane_cabin", "airport_terminal", "alley", "amphitheater", "amusement_park", "apartment_building_outdoor", "aquarium", "arcade", "arena_hockey", "arena_performance", "army_base", "art_gallery", "art_studio", "assembly_line", "athletic_field_outdoor", "atrium_public", "attic", "auditorium", "auto_factory", "backyard", "badminton_court_indoor", "baggage_claim", "bakery_shop", "balcony_exterior", "balcony_interior", "ball_pit", "ballroom", "bamboo_forest", "banquet_hall", "bar", "barn", "barndoor", "baseball_field", "basement", "basilica", "basketball_court_indoor", "basketball_court_outdoor", "bathroom", "bazaar_indoor", "bazaar_outdoor", "beach", "beauty_salon", "bedroom", "berth", "biology_laboratory", "boardwalk", "boat_deck", "boathouse", "bookstore", "booth_indoor", "botanical_garden", "bow_window_indoor", "bow_window_outdoor", "bowling_alley", "boxing_ring", "brewery_indoor", "bridge", "building_facade", "bullring", "burial_chamber", "bus_interior", "bus_station_indoor", "butchers_shop", "butte", "cabin_outdoor", "cafeteria", "campsite", "campus", "canal_natural", "canal_urban", "candy_store", "canyon", "car_interior", "carrousel", "castle", "catacomb", "cathedral_indoor", "cathedral_outdoor", "cavern_indoor", "cemetery", "chalet", "cheese_factory", "chemistry_lab", "chicken_coop_indoor", "chicken_coop_outdoor", "childs_room", "church_indoor", "church_outdoor", "classroom", "clean_room", "cliff", "cloister_indoor", "closet", "clothing_store", "coast", "cockpit", "coffee_shop", "computer_room", "conference_center", "conference_room", "construction_site", "control_room", "control_tower_outdoor", "corn_field", "corral", "corridor", "cottage_garden", "courthouse", "courtroom", "courtyard", "covered_bridge_exterior", "creek", "crevasse", "crosswalk", "cubicle_office", "dam", "daycare_center", "delicatessen", "dentists_office", "desert_sand", "desert_vegetation", "diner_indoor", "diner_outdoor", "dinette_home", "dinette_vehicle", "dining_car", "dining_room", "discotheque", "dock", "doorway_indoor", "doorway_outdoor", "dorm_room", "driveway", "driving_range_outdoor", "drugstore", "electrical_substation", "elevator_door", "elevator_escalator", "elevator_interior", "engine_room", "escalator_indoor", "excavation", "factory_indoor", "fairway", "fastfood_restaurant", "field_cultivated", "field_wild", "fire_escape", "fire_station", "firing_range_indoor", "fishpond", "florist_shop_indoor", "food_court", "forest_broadleaf", "forest_needleleaf", "forest_path", "forest_road", "formal_garden", "fountain", "galley", "game_room", "garage_indoor", "garage_outdoor", "garbage_dump", "gas_station", "gazebo_exterior", "general_store_indoor", "general_store_outdoor", "gift_shop", "golf_course", "greenhouse_indoor", "greenhouse_outdoor", "gymnasium_indoor", "hangar_indoor", "hangar_outdoor", "harbor", "hardware_store", "hayfield", "heliport", "herb_garden", "highway", "hill", "home_office", "hospital", "hospital_room", "hot_spring", "hot_tub_outdoor", "hotel", "hotel_outdoor", "hotel_room", "house", "hunting_lodge_outdoor", "ice_cream_parlor", "ice_floe", "ice_shelf", "ice_skating_rink_indoor", "ice_skating_rink_outdoor", "iceberg", "igloo", "industrial_area", "inn_outdoor", "islet", "jacuzzi_indoor", "jail_cell", "jail_indoor", "jewelry_shop", "kasbah", "kennel_indoor", "kennel_outdoor", "kindergarden_classroom", "kitchen", "kitchenette", "labyrinth_outdoor", "lake_natural", "landfill", "landing_deck", "laundromat", "lecture_room", "library_indoor", "library_outdoor", "lido_deck_outdoor", "lift_bridge", "lighthouse", "limousine_interior", "living_room", "loading_dock", "lobby", "lock_chamber", "locker_room", "mansion", "manufactured_home", "market_indoor", "market_outdoor", "marsh", "martial_arts_gym", "mausoleum", "medina", "moat_water", "monastery_outdoor", "mosque_indoor", "mosque_outdoor", "motel", "mountain", "mountain_path", "mountain_snowy", "movie_theater_indoor", "museum_indoor", "museum_outdoor", "music_store", "music_studio", "nuclear_power_plant_outdoor", "nursery", "oast_house", "observatory_indoor", "observatory_outdoor", "ocean", "office", "office_building", "office_cubicles", "oil_refinery_outdoor", "oilrig", "operating_room", "orchard", "outhouse_outdoor", "pagoda", "palace", "pantry", "park", "parking_garage_indoor", "parking_garage_outdoor", "parking_lot", "parlor", "pasture", "patio", "pavilion", "pharmacy", "phone_booth", "physics_laboratory", "picnic_area", "pilothouse_indoor", "planetarium_indoor", "playground", "playroom", "plaza", "podium_indoor", "podium_outdoor", "pond", "poolroom_home", "poolroom_establishment", "power_plant_outdoor", "promenade_deck", "pub_indoor", "pulpit", "putting_green", "racecourse", "raceway", "raft", "railroad_track", "rainforest", "reception", "recreation_room", "residential_neighborhood", "restaurant", "restaurant_kitchen", "restaurant_patio", "rice_paddy", "riding_arena", "river", "rock_arch", "rope_bridge", "ruin", "runway", "sandbar", "sandbox", "sauna", "schoolhouse", "sea_cliff", "server_room", "shed", "shoe_shop", "shop_front", "shopping_mall_indoor", "shower", "skatepark", "ski_resort", "ski_slope", "sky", "skyscraper", "slum", "snowfield", "squash_court", "stable", "stadium_baseball", "stadium_football", "staircase", "street", "subway_interior", "subway_station_platform", "supermarket", "sushi_bar", "swamp", "swimming_hole", "swimming_pool_indoor", "swimming_pool_outdoor", "synagogue_indoor", "synagogue_outdoor", "television_room", "television_studio", "temple_asia", "temple_europe", "trench", "underwater_coral_reef", "utility_room", "valley", "van_interior", "vegetable_garden", "veranda", "veterinarians_office", "viaduct", "videostore", "village", "vineyard", "volcano", "volleyball_court_indoor", "volleyball_court_outdoor", "waiting_room", "warehouse_indoor", "water_tower", "waterfall_block", "waterfall_fan", "waterfall_plunge", "wetland", "wheat_field", "wind_farm", "windmill", "wine_cellar_barrel_storage", "wine_cellar_bottle_storage", "wrestling_ring_indoor", "yard", "youth_hostel" ] # 建立類別索引映射 categories_dict = {i: cat for i, cat in enumerate(PLACES365_CATEGORIES)} # 保存到 JSON output_path = Path(__file__).parent / "places365_categories.json" with open(output_path, 'w', encoding='utf-8') as f: json.dump(categories_dict, f, indent=2) print(f"✓ Places365 categories saved to: {output_path}") print(f" Total categories: {len(PLACES365_CATEGORIES)}")