Anonymous
init
5a4cd7b
raw
history blame
6.34 kB
import json
import os
from collections import defaultdict
object_type_list = ['AlarmClock', 'AluminumFoil', 'Apple', 'AppleSliced', 'ArmChair', 'BaseballBat', 'BasketBall',
'Bathtub', 'BathtubBasin', 'Bed',
'Blinds', 'Book', 'Boots', 'Bottle', 'Bowl', 'Box', 'Bread', 'BreadSliced', 'ButterKnife',
'Cabinet',
'Candle', 'CD', 'CellPhone', 'Chair', 'Cloth', 'CoffeeMachine', 'CoffeeTable', 'CounterTop',
'CreditCard', 'Cup',
'Curtains', 'Desk', 'DeskLamp', 'Desktop', 'DiningTable', 'DishSponge', 'DogBed', 'Drawer',
'Dresser', 'Dumbbell',
'Egg', 'EggCracked', 'Faucet', 'Floor', 'FloorLamp', 'Footstool', 'Fork', 'Fridge', 'GarbageBag',
'GarbageCan',
'HandTowel', 'HandTowelHolder', 'HousePlant', 'Kettle', 'KeyChain', 'Knife', 'Ladle', 'Laptop',
'LaundryHamper', 'Lettuce',
'LettuceSliced', 'LightSwitch', 'Microwave', 'Mirror', 'Mug', 'Newspaper', 'Ottoman', 'Painting',
'Pan', 'PaperTowelRoll',
'Pen', 'Pencil', 'PepperShaker', 'Pillow', 'Plate', 'Plunger', 'Poster', 'Pot', 'Potato',
'PotatoSliced',
'RemoteControl', 'RoomDecor', 'Safe', 'SaltShaker', 'ScrubBrush', 'Shelf', 'ShelvingUnit',
'ShowerCurtain', 'ShowerDoor', 'ShowerGlass',
'ShowerHead', 'SideTable', 'Sink', 'SinkBasin', 'SoapBar', 'SoapBottle', 'Sofa', 'Spatula', 'Spoon',
'SprayBottle',
'Statue', 'Stool', 'StoveBurner', 'StoveKnob', 'TableTopDecor', 'TargetCircle', 'TeddyBear',
'Television', 'TennisRacket', 'TissueBox',
'Toaster', 'Toilet', 'ToiletPaper', 'ToiletPaperHanger', 'Tomato', 'TomatoSliced', 'Towel',
'TowelHolder', 'TVStand', 'VacuumCleaner',
'Vase', 'Watch', 'WateringCan', 'Window', 'WineBottle']
pickupable_object_list = ['AlarmClock', 'AluminumFoil', 'Apple', 'AppleSliced', 'BaseballBat',
'BasketBall', 'Book', 'Boots', 'Bottle', 'Bowl', 'Box', 'Bread',
'BreadSliced', 'ButterKnife', 'Candle', 'CD', 'CellPhone', 'Cloth',
'CreditCard', 'Cup', 'DishSponge', 'Dumbbell', 'Egg', 'EggCracked',
'Fork', 'HandTowel', 'Kettle', 'KeyChain', 'Knife', 'Ladle', 'Laptop',
'Lettuce', 'LettuceSliced', 'Mug', 'Newspaper', 'Pan', 'PaperTowelRoll',
'Pen', 'Pencil', 'PepperShaker', 'Pillow', 'Plate', 'Plunger', 'Pot', 'Potato',
'PotatoSliced', 'RemoteControl', 'SaltShaker', 'ScrubBrush', 'SoapBar', 'SoapBottle',
'Spatula', 'Spoon', 'SprayBottle', 'Statue', 'TableTopDecor', 'TeddyBear', 'TennisRacket',
'TissueBox', 'ToiletPaper', 'Tomato', 'TomatoSliced', 'Towel', 'Vase', 'Watch', 'WateringCan',
'WineBottle']
receptacle_list = ['ArmChair', 'Bathtub', 'BathtubBasin', 'Bed', 'Bowl', 'Box', 'Cabinet', 'Chair', 'CoffeeMachine',
'CoffeeTable',
'CounterTop', 'Cup', 'Desk', 'DiningTable', 'Drawer', 'Dresser', 'Fridge', 'GarbageCan',
'HandTowelHolder',
'LaundryHamper', 'Microwave', 'Mug', 'Ottoman', 'Pan', 'Plate', 'Pot', 'Safe', 'Shelf', 'SideTable',
'Sink',
'SinkBasin', 'Sofa', 'StoveBurner', 'Toaster', 'Toilet', 'ToiletPaperHanger', 'TowelHolder',
'TVStand']
RoomList = [
'Kitchen', 'Bathroom', 'LivingRoom', 'Bedroom'
]
HomerActivities = [
"brushing_teeth",
"showering",
"breakfast",
"dinner",
"computer_work",
"lunch",
"cleaning",
"laundry",
"leave_home",
"come_home",
"socializing",
"taking_medication",
"watching_tv",
"vacuum_cleaning",
"reading",
"going_to_the_bathroom",
"getting_dressed",
'kitchen_cleaning',
"take_out_trash",
"wash_dishes",
"playing_music",
"listening_to_music"
]
CustomActivitiesV1 = [
"brushing teeth",
"showering",
"breakfast",
"dinner",
"computer work",
"lunch",
"cleaning the floor",
"tidying up dinning table",
"laundry",
"socializing",
"taking medication",
"watching tv",
"vacuum cleaning",
"reading",
"going to the bathroom",
"getting dressed",
'kitchen cleaning',
"take out trash",
"wash dishes",
"playing music",
"listening to music"
]
CustomActivitiesV2 = [
"brushing teeth",
"taking a shower",
"having breakfast",
"having dinner",
"doing computer work",
"having lunch",
"cleaning the floor",
"tidying up dinning table",
"doing laundry",
"socializing",
"taking medication",
"watching tv",
"doing vacuum cleaning",
"reading books",
"going to the bathroom",
"getting dressed",
'cleaning kitchen',
"taking out trash",
"washing dishes",
"playing music",
"listening to music"
]
DLC_V1 = [
"watering plants",
"preparing meals",
"exercising",
"taking a nap",
"checking e-mail",
"meditating",
"making coffee",
"doing home repairs",
"gardening",
"ironing clothes",
"making the bed",
"studying",
"placing groceries",
"writing in a journal"
]
SpecialEvents = [
'leave home',
'come home'
]
data_root = os.path.dirname(__file__)
receptacle_stat = json.load(open(os.path.join(data_root, 'stats', 'receptacle_statistic.json'), 'r', encoding='utf-8'))
room_to_receptacle = defaultdict(list)
for receptacle, stat in receptacle_stat['receptacle_in_room_count']['immoveable_receptacle'].items():
for room, count in stat.items():
if count > 0:
room_to_receptacle[room].append(receptacle)
room_to_receptacle_str = ''
for room, receptacles in room_to_receptacle.items():
room_to_receptacle_str += f'{room}: {", ".join(receptacles)}\n'
object_stat = json.load(open(os.path.join(data_root, 'stats', 'object_statistic.json'), 'r', encoding='utf-8'))
appeared_objects = list(object_stat['count'].keys())