{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "path = \"/home/bingxuan/VDA/data/SUN/data_manager/Scene hierarchy.xlsx\"\n", "\n", "data = pd.read_excel(path, sheet_name=\"SUN397\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
categoryindooroutdoor, naturaloutdoor, man-madeshopping and diningworkplace (office building, factory, lab, etc.)home or hoteltransportation (vehicle interiors, stations, etc.)sports and leisurecultural (art, education, religion, etc.)water, ice, snowmountains, hills, desert, skyforest, field, jungleman-made elementstransportation (roads, parking, bridges, boats, airports, etc.)cultural or historical building/placesports fields, parks, leisure spacesindustrial and constructionhouses, cabins, gardens, and farmscommercial buildings, shops, markets, cities, and towns
1/a/abbey0010000000000010000
2/a/airplane_cabin1000001000000000000
3/a/airport_terminal1000001000000000000
4/a/alley0010000000000000001
5/a/amphitheater0010000000000010000
\n", "
" ], "text/plain": [ "0 category indoor outdoor, natural outdoor, man-made \\\n", "1 /a/abbey 0 0 1 \n", "2 /a/airplane_cabin 1 0 0 \n", "3 /a/airport_terminal 1 0 0 \n", "4 /a/alley 0 0 1 \n", "5 /a/amphitheater 0 0 1 \n", "\n", "0 shopping and dining workplace (office building, factory, lab, etc.) \\\n", "1 0 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "5 0 0 \n", "\n", "0 home or hotel transportation (vehicle interiors, stations, etc.) \\\n", "1 0 0 \n", "2 0 1 \n", "3 0 1 \n", "4 0 0 \n", "5 0 0 \n", "\n", "0 sports and leisure cultural (art, education, religion, etc.) \\\n", "1 0 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "5 0 0 \n", "\n", "0 water, ice, snow mountains, hills, desert, sky forest, field, jungle \\\n", "1 0 0 0 \n", "2 0 0 0 \n", "3 0 0 0 \n", "4 0 0 0 \n", "5 0 0 0 \n", "\n", "0 man-made elements \\\n", "1 0 \n", "2 0 \n", "3 0 \n", "4 0 \n", "5 0 \n", "\n", "0 transportation (roads, parking, bridges, boats, airports, etc.) \\\n", "1 0 \n", "2 0 \n", "3 0 \n", "4 0 \n", "5 0 \n", "\n", "0 cultural or historical building/place sports fields, parks, leisure spaces \\\n", "1 1 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "5 1 0 \n", "\n", "0 industrial and construction houses, cabins, gardens, and farms \\\n", "1 0 0 \n", "2 0 0 \n", "3 0 0 \n", "4 0 0 \n", "5 0 0 \n", "\n", "0 commercial buildings, shops, markets, cities, and towns \n", "1 0 \n", "2 0 \n", "3 0 \n", "4 1 \n", "5 0 " ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data.columns = data.iloc[0]\n", "# remove the first row\n", "data = data.iloc[1:]\n", "data.head()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['category', 'indoor', 'outdoor, natural', 'outdoor, man-made',\n", " 'shopping and dining',\n", " 'workplace (office building, factory, lab, etc.)', 'home or hotel',\n", " 'transportation (vehicle interiors, stations, etc.)',\n", " 'sports and leisure', 'cultural (art, education, religion, etc.)',\n", " 'water, ice, snow', 'mountains, hills, desert, sky',\n", " 'forest, field, jungle', 'man-made elements',\n", " 'transportation (roads, parking, bridges, boats, airports, etc.)',\n", " 'cultural or historical building/place',\n", " 'sports fields, parks, leisure spaces', 'industrial and construction',\n", " 'houses, cabins, gardens, and farms',\n", " 'commercial buildings, shops, markets, cities, and towns'],\n", " dtype='object', name=0)\n" ] } ], "source": [ "print(data.columns)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "catas = ['shopping and dining',\n", " 'workplace (office building, factory, lab, etc.)', 'home or hotel',\n", " 'transportation (vehicle interiors, stations, etc.)',\n", " 'sports and leisure', 'cultural (art, education, religion, etc.)',\n", " 'water, ice, snow', 'mountains, hills, desert, sky',\n", " 'forest, field, jungle', 'man-made elements',\n", " 'transportation (roads, parking, bridges, boats, airports, etc.)',\n", " 'cultural or historical building/place',\n", " 'sports fields, parks, leisure spaces', 'industrial and construction',\n", " 'houses, cabins, gardens, and farms',\n", " 'commercial buildings, shops, markets, cities, and towns']\n", "\n", "classes = {}\n", "for cata in catas:\n", " # find all classess with 1 in this cata\n", " temp = data[data[cata] == 1]\n", " classes[cata] = temp[\"category\"].tolist()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{'shopping and dining': ['/b/bakery/shop', '/b/banquet_hall', '/b/bar', '/b/bazaar/indoor', '/b/beauty_salon', '/b/bistro/indoor', '/b/bookstore', '/b/butchers_shop', '/c/cafeteria', '/c/candy_store', '/c/clothing_store', '/c/coffee_shop', '/d/delicatessen', '/d/diner/indoor', '/d/discotheque', '/d/drugstore', '/e/escalator/indoor', '/f/fastfood_restaurant', '/f/florist_shop/indoor', '/f/food_court', '/g/general_store/indoor', '/g/gift_shop', '/i/ice_cream_parlor', '/j/jewelry_shop', '/m/market/indoor', '/m/music_store', '/p/pharmacy', '/p/pub/indoor', '/r/restaurant', '/r/restaurant_kitchen', '/s/shoe_shop', '/s/shopping_mall/indoor', '/s/supermarket', '/s/sushi_bar', '/t/thriftshop', '/t/ticket_booth', '/t/toyshop', '/v/videostore', '/w/wine_cellar/barrel_storage', '/w/wine_cellar/bottle_storage'], 'workplace (office building, factory, lab, etc.)': ['/a/anechoic_chamber', '/a/assembly_line', '/a/atrium/public', '/a/auto_factory', '/b/biology_laboratory', '/b/booth/indoor', '/b/brewery/indoor', '/c/cheese_factory', '/c/chemistry_lab', '/c/chicken_coop/indoor', '/c/clean_room', '/c/computer_room', '/c/conference_room', '/c/control_room', '/c/corridor', '/c/cubicle/office', '/d/dentists_office', '/e/elevator/door', '/e/elevator/interior', '/e/elevator_shaft', '/e/engine_room', '/e/escalator/indoor', '/f/factory/indoor', '/g/greenhouse/indoor', '/h/hospital_room', '/k/kennel/indoor', '/l/laundromat', '/l/lobby', '/o/office', '/o/operating_room', '/p/parking_garage/indoor', '/p/physics_laboratory', '/r/reception', '/s/server_room', '/s/stable', '/s/staircase', '/t/ticket_booth', '/v/veterinarians_office', '/w/waiting_room', '/w/warehouse/indoor'], 'home or hotel': ['/a/attic', '/b/basement', '/b/bathroom', '/b/bedroom', '/b/bow_window/indoor', '/c/chicken_coop/indoor', '/c/childs_room', '/c/closet', '/d/dinette/home', '/d/dining_room', '/d/dorm_room', '/g/game_room', '/g/garage/indoor', '/h/home_office', '/h/hotel_room', '/k/kennel/indoor', '/k/kitchen', '/k/kitchenette', '/l/laundromat', '/l/living_room', '/n/nursery', '/p/pantry', '/p/parlor', '/p/playroom', '/p/poolroom/home', '/r/recreation_room', '/r/restaurant_kitchen', '/s/shower', '/s/stable', '/s/staircase', '/u/utility_room', '/w/wet_bar', '/w/wine_cellar/barrel_storage', '/w/wine_cellar/bottle_storage', '/y/youth_hostel'], 'transportation (vehicle interiors, stations, etc.)': ['/a/airplane_cabin', '/a/airport_terminal', '/b/baggage_claim', '/b/berth', '/b/bus_interior', '/c/car_interior/backseat', '/c/car_interior/frontseat', '/c/cockpit', '/d/dinette/vehicle', '/d/dining_car', '/e/engine_room', '/e/escalator/indoor', '/g/galley', '/h/hangar/indoor', '/l/limousine_interior', '/p/pilothouse/indoor', '/p/promenade_deck', '/s/subway_interior', '/s/subway_station/platform', '/t/train_station/platform', '/v/van_interior'], 'sports and leisure': ['/a/amusement_arcade', '/b/badminton_court/indoor', '/b/ball_pit', '/b/ballroom', '/b/bowling_alley', '/b/boxing_ring', '/c/casino/indoor', '/d/discotheque', '/f/firing_range/indoor', '/g/gymnasium/indoor', '/i/ice_skating_rink/indoor', '/j/jacuzzi/indoor', '/l/locker_room', '/m/martial_arts_gym', '/p/poolroom/establishment', '/r/riding_arena', '/s/sauna', '/s/squash_court', '/s/swimming_pool/indoor', '/t/tennis_court/indoor', '/v/volleyball_court/indoor', '/w/wrestling_ring/indoor'], 'cultural (art, education, religion, etc.)': ['/a/apse/indoor', '/a/aquarium', '/a/archive', '/a/art_gallery', '/a/art_school', '/a/art_studio', '/a/auditorium', '/b/beauty_salon', '/b/booth/indoor', '/b/burial_chamber', '/c/catacomb', '/c/cathedral/indoor', '/c/church/indoor', '/c/classroom', '/c/cloister/indoor', '/c/conference_center', '/c/courtroom', '/j/jail/indoor', '/j/jail_cell', '/k/kindergarden_classroom', '/l/lecture_room', '/l/library/indoor', '/m/mosque/indoor', '/m/movie_theater/indoor', '/m/museum/indoor', '/m/music_store', '/m/music_studio', '/p/podium/indoor', '/p/pulpit', '/s/stage/indoor', '/s/synagogue/indoor', '/t/television_studio', '/t/theater/indoor_procenium', '/t/theater/indoor_seats', '/t/throne_room', '/t/ticket_booth'], 'water, ice, snow': ['/b/bayou', '/b/beach', '/b/boardwalk', '/b/boathouse', '/c/canal/natural', '/c/coast', '/c/creek', '/c/crevasse', '/d/dam', '/d/dock', '/f/fishpond', '/h/hot_spring', '/i/ice_floe', '/i/ice_shelf', '/i/iceberg', '/i/igloo', '/i/islet', '/l/lake/natural', '/m/marsh', '/m/mountain_snowy', '/o/ocean', '/p/pond', '/r/raft', '/r/river', '/s/sandbar', '/s/sea_cliff', '/s/ski_slope', '/s/snowfield', '/s/swamp', '/u/underwater/coral_reef', '/w/waterfall/block', '/w/waterfall/fan', '/w/waterfall/plunge', '/w/watering_hole', '/w/wave'], 'mountains, hills, desert, sky': ['/b/badlands', '/b/butte', '/c/canyon', '/c/cavern/indoor', '/c/cliff', '/d/desert/sand', '/d/desert/vegetation', '/h/hill', '/m/mountain', '/m/mountain_snowy', '/r/rock_arch', '/s/sky', '/v/valley', '/v/volcano'], 'forest, field, jungle': ['/b/bamboo_forest', '/b/barn', '/b/bayou', '/b/boardwalk', '/b/botanical_garden', '/c/corn_field', '/c/corral', '/c/cottage_garden', '/f/fairway', '/f/field/cultivated', '/f/field/wild', '/f/forest/broadleaf', '/f/forest/needleleaf', '/f/forest_path', '/f/forest_road', '/f/formal_garden', '/g/golf_course', '/h/hayfield', '/h/herb_garden', '/m/marsh', '/o/orchard', '/o/outhouse/outdoor', '/p/park', '/p/pasture', '/p/picnic_area', '/p/playground', '/p/putting_green', '/r/rainforest', '/r/rice_paddy', '/s/swamp', '/t/topiary_garden', '/t/tree_farm', '/t/tree_house', '/v/vegetable_garden', '/v/vineyard', '/w/wheat_field', '/w/wind_farm', '/y/yard'], 'man-made elements': ['/a/aqueduct', '/b/barn', '/b/bayou', '/b/boardwalk', '/b/boathouse', '/b/botanical_garden', '/c/corral', '/c/cottage_garden', '/d/dam', '/d/dock', '/f/fairway', '/f/field/cultivated', '/f/fishpond', '/f/forest_road', '/f/formal_garden', '/g/golf_course', '/h/hayfield', '/h/herb_garden', '/h/highway', '/i/igloo', '/o/outhouse/outdoor', '/p/park', '/p/picnic_area', '/p/playground', '/p/putting_green', '/r/raft', '/r/rice_paddy', '/r/rope_bridge', '/r/ruin', '/s/ski_slope', '/t/tent/outdoor', '/t/topiary_garden', '/t/tree_house', '/t/trench', '/v/vegetable_garden', '/v/viaduct', '/v/vineyard', '/w/wind_farm', '/y/yard'], 'transportation (roads, parking, bridges, boats, airports, etc.)': ['/a/arrival_gate/outdoor', '/b/bayou', '/b/boat_deck', '/b/boathouse', '/b/bridge', '/c/canal/urban', '/c/control_tower/outdoor', '/c/covered_bridge/exterior', '/c/crosswalk', '/d/dock', '/f/forest_road', '/g/gas_station', '/h/hangar/outdoor', '/h/harbor', '/h/heliport', '/h/highway', '/l/landing_deck', '/l/lido_deck/outdoor', '/l/lift_bridge', '/l/lock_chamber', '/p/parking_garage/outdoor', '/p/parking_lot', '/p/promenade_deck', '/r/railroad_track', '/r/runway', '/t/toll_plaza', '/t/train_railway'], 'cultural or historical building/place': ['/a/abbey', '/a/amphitheater', '/a/aqueduct', '/a/arch', '/b/basilica', '/b/bazaar/outdoor', '/c/campus', '/c/castle', '/c/cathedral/outdoor', '/c/cemetery', '/c/church/outdoor', '/c/courthouse', '/c/courtyard', '/f/fountain', '/k/kasbah', '/l/labyrinth/outdoor', '/l/library/outdoor', '/l/lighthouse', '/m/mausoleum', '/m/medina', '/m/moat/water', '/m/monastery/outdoor', '/m/mosque/outdoor', '/o/oast_house', '/o/observatory/outdoor', '/p/pagoda', '/p/palace', '/p/planetarium/outdoor', '/p/plaza', '/p/podium/outdoor', '/r/ruin', '/s/synagogue/outdoor', '/t/temple/east_asia', '/t/temple/south_asia', '/t/tower', '/v/viaduct', '/w/windmill'], 'sports fields, parks, leisure spaces': ['/a/amusement_park', '/a/athletic_field/outdoor', '/b/baseball_field', '/b/basketball_court/outdoor', '/b/batters_box', '/b/boardwalk', '/b/bullring', '/c/campsite', '/c/carrousel', '/d/driving_range/outdoor', '/f/fairway', '/f/fishpond', '/f/forest_road', '/g/gazebo/exterior', '/g/golf_course', '/h/hot_tub/outdoor', '/i/ice_skating_rink/outdoor', '/i/igloo', '/l/labyrinth/outdoor', '/l/lido_deck/outdoor', '/p/park', '/p/pavilion', '/p/picnic_area', '/p/playground', '/p/podium/outdoor', '/p/putting_green', '/r/racecourse', '/r/raceway', '/r/rope_bridge', '/s/sandbox', '/s/skatepark', '/s/ski_slope', '/s/stadium/baseball', '/s/stadium/football', '/s/swimming_pool/outdoor', '/t/tennis_court/outdoor', '/t/tent/outdoor', '/t/track/outdoor', '/t/tree_house', '/v/volleyball_court/outdoor'], 'industrial and construction': ['/c/construction_site', '/d/dam', '/e/electrical_substation', '/e/excavation', '/g/garbage_dump', '/i/industrial_area', '/l/landfill', '/n/nuclear_power_plant/outdoor', '/o/oil_refinery/outdoor', '/o/oilrig', '/p/power_plant/outdoor', '/t/trench', '/w/water_tower', '/w/wind_farm', '/w/windmill'], 'houses, cabins, gardens, and farms': ['/b/balcony/exterior', '/b/balcony/interior', '/b/barn', '/b/barndoor', '/b/botanical_garden', '/b/bow_window/outdoor', '/c/cabin/outdoor', '/c/chalet', '/c/chicken_coop/outdoor', '/c/corral', '/c/cottage_garden', '/c/courtyard', '/d/doorway/outdoor', '/d/driveway', '/f/field/cultivated', '/f/formal_garden', '/g/greenhouse/outdoor', '/h/hayfield', '/h/herb_garden', '/h/house', '/h/hunting_lodge/outdoor', '/k/kennel/outdoor', '/m/mansion', '/m/manufactured_home', '/o/outhouse/outdoor', '/p/patio', '/r/residential_neighborhood', '/r/rice_paddy', '/s/shed', '/s/ski_lodge', '/s/ski_resort', '/t/topiary_garden', '/t/tree_house', '/v/vegetable_garden', '/v/veranda', '/v/vineyard', '/y/yard'], 'commercial buildings, shops, markets, cities, and towns': ['/a/alley', '/a/apartment_building/outdoor', '/b/balcony/exterior', '/b/balcony/interior', '/b/bazaar/outdoor', '/b/building_facade', '/c/courtyard', '/c/crosswalk', '/d/diner/outdoor', '/d/doorway/outdoor', '/f/fire_escape', '/f/fire_station', '/g/gas_station', '/g/general_store/outdoor', '/h/hospital', '/h/hotel/outdoor', '/i/inn/outdoor', '/m/market/outdoor', '/m/medina', '/m/motel', '/o/office_building', '/p/parking_garage/outdoor', '/p/phone_booth', '/p/plaza', '/r/residential_neighborhood', '/r/restaurant_patio', '/s/schoolhouse', '/s/shopfront', '/s/skyscraper', '/s/slum', '/s/street', '/t/ticket_booth', '/v/village', '/w/windmill']}\n" ] } ], "source": [ "print(classes)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import json\n", "with open(\"all_classes.json\", \"w\") as f:\n", " json.dump(classes, f, indent=4)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Start here!" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/bingxuan/data2/SUN397/a/aqueduct: 354\n", "/home/bingxuan/data2/SUN397/b/barn: 279\n", "/home/bingxuan/data2/SUN397/b/bayou: 166\n", "/home/bingxuan/data2/SUN397/b/boardwalk: 144\n", "/home/bingxuan/data2/SUN397/b/boathouse: 111\n", "/home/bingxuan/data2/SUN397/b/botanical_garden: 263\n", "/home/bingxuan/data2/SUN397/c/corral: 134\n", "/home/bingxuan/data2/SUN397/c/cottage_garden: 229\n", "/home/bingxuan/data2/SUN397/d/dam: 154\n", "/home/bingxuan/data2/SUN397/d/dock: 130\n", "/home/bingxuan/data2/SUN397/f/fairway: 259\n", "/home/bingxuan/data2/SUN397/f/field/cultivated: 343\n", "/home/bingxuan/data2/SUN397/f/fishpond: 167\n", "/home/bingxuan/data2/SUN397/f/forest_road: 152\n", "/home/bingxuan/data2/SUN397/f/formal_garden: 251\n", "/home/bingxuan/data2/SUN397/g/golf_course: 814\n", "/home/bingxuan/data2/SUN397/h/hayfield: 144\n", "/home/bingxuan/data2/SUN397/h/herb_garden: 221\n", "/home/bingxuan/data2/SUN397/h/highway: 833\n" ] } ], "source": [ "import os\n", "import json\n", "home_dir = \"/home/bingxuan/data2/SUN397\"\n", "working_dir = \"/home/bingxuan/VDA/data/SUN/man_made\"\n", "\n", "configs_path = working_dir + \"/config.json\"\n", "with open(configs_path, \"r\") as f:\n", " configs = json.load(f)\n", " \n", "paths = configs[\"pairs\"]\n", "\n", "for pair in paths:\n", " path_1 = home_dir + pair[\"ground_truth_full_name\"]\n", " if not os.path.exists(path_1):\n", " print(f\"ERROR: {path_1} does not exist\")\n", " print(f\"{path_1}: {len(os.listdir(path_1))}\")\n", " \n", " path_2 = home_dir + pair[\"confusing_class_full_name\"]\n", " if not os.path.exists(path_2):\n", " print(f\"ERROR: {path_2} does not exist\")\n", " " ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import random\n", "import shutil\n", "\n", "train_num_imgs = 70\n", "val_num_imgs = 30\n", "\n", "for pair in paths:\n", " path_1 = home_dir + pair[\"ground_truth_full_name\"]\n", " os.makedirs(working_dir + \"/train\" + pair[\"ground_truth_full_name\"], exist_ok=True)\n", " os.makedirs(working_dir + \"/val\" + pair[\"ground_truth_full_name\"], exist_ok=True)\n", " images = os.listdir(path_1)\n", " random.shuffle(images)\n", " for img in images[:train_num_imgs]:\n", " shutil.copy(path_1 + \"/\" + img, working_dir + \"/train\" + pair[\"ground_truth_full_name\"] + \"/\" + img)\n", " for img in images[train_num_imgs:train_num_imgs+val_num_imgs]:\n", " shutil.copy(path_1 + \"/\" + img, working_dir + \"/val\" + pair[\"ground_truth_full_name\"] + \"/\" + img)\n", "\n", " path_2 = home_dir + pair[\"confusing_class_full_name\"]\n", " os.makedirs(working_dir + \"/train\" + pair[\"confusing_class_full_name\"], exist_ok=True)\n", " os.makedirs(working_dir + \"/val\" + pair[\"confusing_class_full_name\"], exist_ok=True)\n", " images = os.listdir(path_2)\n", " random.shuffle(images)\n", " for img in images[:train_num_imgs]:\n", " shutil.copy(path_2 + \"/\" + img, working_dir + \"/train\" + pair[\"confusing_class_full_name\"] + \"/\" + img)\n", " for img in images[train_num_imgs:train_num_imgs+val_num_imgs]:\n", " shutil.copy(path_2 + \"/\" + img, working_dir + \"/val\" + pair[\"confusing_class_full_name\"] + \"/\" + img)" ] } ], "metadata": { "kernelspec": { "display_name": "visual_data_aug", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.14" } }, "nbformat": 4, "nbformat_minor": 2 }