Scene graph items
For prompting OpenAI
import json
from pathlib import Path
items = {}
for sg in Path("/tmp").glob("SceneGraph_*.json"):
room = sg.stem.split("_")[1]
items[room] = []
with open(sg, "r") as f:
data = json.load(f)
for item in data["origin"]["children"]:
items[room].append(item["name"])
with open("/tmp/items.tsv", "w") as f:
f.write("room\titem\n")
for room in items:
for item in items[room]:
if item.startswith("Window_"):
continue
elif item.startswith("Door_") or item == "Door":
continue
elif item.startswith("Wall_") or item in ["Wall1", "Wall2", "Wall3", "Wall4", "Wall5"]:
continue
f.write(f"{room}\t{item}\n")
sampled_grounded_objects = random.sample(grounded_object_data, 20)
# Manually crafted utterances with full metadata attached
handwritten_utterances = [
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[0]["object_id"],
"sentence": "This coffee table’s seen more game nights than I can count. Honestly, I should give it a medal."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[1]["object_id"],
"sentence": "The tall floor lamp always makes this corner feel a little more like home. Even when it’s off."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[2]["object_id"],
"sentence": "That couch over there? It’s been reupholstered twice, but it still sags in the same spot."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[3]["object_id"],
"sentence": "The dresser’s a bit scratched, but every mark tells a story. I like that."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[4]["object_id"],
"sentence": "You see this remote? I’ve probably spent half my life trying to find it."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[5]["object_id"],
"sentence": "This velvet sofa? The cat’s claimed it as her throne, and I just pay rent."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[6]["object_id"],
"sentence": "The bookshelf isn’t full of books — it’s full of secrets. Look closer."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[7]["object_id"],
"sentence": "That side table is crooked, sure, but it’s exactly where it needs to be."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[8]["object_id"],
"sentence": "The rug doesn’t match anything, and that’s why it works."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[9]["object_id"],
"sentence": "I didn’t plan on the glass coffee table, but the light hits it just right at sunset."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[10]["object_id"],
"sentence": "This lamp? I bought it on impulse, but I’ve never regretted it."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[11]["object_id"],
"sentence": "That TV’s older than some of the people who visit. Still works like a charm."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[12]["object_id"],
"sentence": "This chair creaks like it’s whispering old gossip. I kinda love it."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[13]["object_id"],
"sentence": "You wouldn't guess it, but that armchair came from a movie set auction."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[14]["object_id"],
"sentence": "The painting’s crooked. It’s always been crooked. It wouldn’t be right any other way."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[15]["object_id"],
"sentence": "This newspaper? I keep it because of the headline. One hell of a day."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[16]["object_id"],
"sentence": "That table in the center holds everything — keys, coffee, conversations."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[17]["object_id"],
"sentence": "There’s a chip in the corner of this dresser. I put it there. Long story."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[18]["object_id"],
"sentence": "The mirror makes the room feel bigger, but also makes me late every morning."
},
{
"room_id": "unknown",
"object_id": sampled_grounded_objects[19]["object_id"],
"sentence": "This little lamp was my grandmother’s. She always said it made the room feel safe."
}
]
# Show the sample
handwritten_utterances
!cat /tmp/items.tsv |awk -F'\t' '{print $2}'|sort|awk '{print $0 "\t" $0}'
items = """
ArmChair_3ba6dec5 armchair
ArmChair_3e286e7a armchair
ArmChair_47a5dcf3 armchair
ArmChair_64ade3d5 armchair
ArmChair_66a02cd7 armchair
ArmChair_c8c7fa1b armchair
BlackVase_61b7da0b vase black
Blanket blanket
BlueGarbageCan_97c506a7 garbage can blue
BlueKeychain_3 keychain blue
BlueVase_1086f23d vase blue
BlueVase_808818c5 (1) vase blue
BookCase_a34d9887 bookcase
Book_17 book
Book_28 book
Book_7e290dff book
Box_3 box
Box_6875efd0 box
Box_7d6b3e2c box
Box_acb44c64 box
Box_c423d56d_2 box
Box_f8dd3835 box
Carpet carpet
CeilingLight ceiling light
CeilingLight1 ceiling light
CeilingLight2 ceiling light
CeilingPlant2 plant
CeilingPlant4 plant
CeilingPlant7 plant
CellPhone_673ecda8 cellphone
Chair_204_2 chair
Chair_28dfa634 chair
Chair_88b1f819 chair
Chair_97b4ea04 chair
Chair_9f65dae8 chair
Chair_c6d435d0 chair
Chair_db8dcb97 chair
Chair_e504631e chair
Chandelier chandelier
CoffeeTable_0f0649ce coffee table
CoffeeTable_0fe3d662 coffee table
CoffeeTable_55f895de coffee table
CoffeeTable_580fafde coffee table
CoffeeTable_dd16dc6e coffee table
CreditCard_1f5b07d9 credit card
CreditCard_5794fee0 credit card
CreditCard_6b898bfd credit card
CreditCard_c655b727 credit card
Curtains1_99ab6029 curtains
Curtains2_d0e1ef7e curtains
Curtains_9567b735 curtains
DeskLamp_3d0b0fb7 desk lamp
Desk_204_1 desk
Desktop_316_Master desktop
DiningTable_2401ee04 dining table
DiningTable_d80cf940 dining table
DogBed_d4afafd0 dog bed
Dog_Statue_1 statue
Drawer_1c0cee5f drawer
Drawer_7cab76b7 drawer
Drawer_ff4fd634 drawer
Dresser_05cb66e0 dresser
Dresser_29dd319f dresser
Dresser_ff109676 dresser
FP222:Ceiling ceiling
FertilityStatue_dcd19fe9 fertility statue
FirePlace fireplace
FloorLamp_014221fc floor lamp
FloorLamp_0211624d floor lamp
FloorLamp_4062327b floor lamp
FloorLamp_75348c2c floor lamp
FloorLamp_82e14abb floor lamp
Floor_Lamp_9 floor lamp
GarbageCan_133fd689 garbage can
GarbageCan_43439bc1 garbage can
GarbageCan_767f2305 garbage can
GarbageCan_cf0fc6b1 garbage can
GoldStatue_e904d593 statue gold
Hand_Statue_2 hand statue
HousePlant1Large plant large house
HousePlant1Large_2 plant large house
HousePlant_0db093fe plant
HousePlant_2924821c plant
HousePlant_6feb1461 plant
HousePlant_8110ba59 plant
HousePlant_c50ca552 plant
Houseplant_1 plant
Kettle_2 kettle
KeyChain_350e8f40 keychain
KeyChain_3f31b1d1 keychain
KeyChain_76c05fe6 keychain
KeyChain_bcaeb4b5 keychain
Lamp lamp
Laptop_4 laptop
Laptop_a8426a01 laptop
Laptop_b59db75f laptop
Laptop_c535f2bc laptop
Laptop_d9d44fbe laptop
Newspaper_28828880 newspaper
Newspaper_30d403dd newspaper
Newspaper_4b7df6f2 newspaper
Newspaper_990192bf newspaper
Newspaper_c2d5775f newspaper
Ottoman_ad8e5df5 ottoman
Painting1 painting
Painting2 painting
Painting_0db0fb84 painting
Painting_0f25d3f4 painting
Painting_0f25d3f4_2 painting
Painting_0f25d3f4_3 painting
Painting_14c2df0d painting
Painting_5ebe949b painting
Painting_6fe2c2f8 painting
Painting_b23dccb6 painting
Painting_eda6d5e1 painting
Painting_eda6d5e1 (1) painting
Pen_df9323c1 pen
PillowPatterned_7512d345 pillow patterned
PillowPurpleRight_f0273d63_3 pillow purple
PillowPurple_f0273d63_2 pillow purple
PillowSmooth_7512d345_2 pillow smooth
Pillow_4f745fd7 pillow
Pillow_4f745fd7_2 pillow
Pillow_dc968b61 pillow
Pillow_f916b120 pillow
Plate_18ce2457 plate
Plate_30 plate
Plate_30_2 plate
Plate_b4f8b5f3 plate
Plate_b4f8b5f3_1 plate
RedGarbageCan_97c506a7_2 garbage can red
RedKeychain_2 keychain red
RedVase_44bee60d vase red
RedVase_Tall_2 vase tall red
RemoteControl_45eda945 remote control
RemoteControl_5a0e7720 remote control
RemoteControl_6b6acd0d remote control
RemoteControl_827d4f47 remote control
RemoteControl_cf82446e remote control
Rug rug
Shelf_d0359321 shelf
SideTable_08f3eda2 side table
SideTable_5ff50fd6 side table
SideTable_855fe095 side table
SideTable_8701d005 side table
SideTable_a41233be side table
SideTable_b5a954d1 side table
SideTable_cb8929ce side table
SideTable_e3936eb3 side table
SideTable_ecd457fe side table
SmallVase_Flat_Shards_4 vase small
Sofa_8bd689dc sofa
Sofa_b5c02446 sofa
Sofa_b5cc7b35 sofa
Sofa_dcb895fb sofa
Sofa_eeda20bc sofa
Sofa_f3c3f4ca sofa
Statue_044984c5 statue
Statue_0ba19690 statue
Statue_24d96a63 statue
Statue_5f1e0f9c statue
Statue_7e71d98f statue
Statue_8801228e statue
Statue_b7418b43 statue
Statue_bc9ffa92 statue
Statue_f6df1c73 statue
TVStand_5591333a TV stand
TVStand_fa93c053 TV stand
Teddy_Bear_1 teddy bear
Teddy_Bear_2 teddy bear
Television_002818f8 television
Television_01800a8c television
Television_905e84a9 television
Television_f5fb6360 television
Television_f9d000b1 television
Tennis_Racquet_4 tennis racquet
TropicalPlantLarge (2) plant large tropical
VaseBlue_808818c5 vase blue
VaseWhite_c6940b75 vase white
Vase_0cfbfb7f vase
Vase_58f3a922 vase
Vase_75ce7b48 vase
Vase_99a3f189 vase
Vase_9c13a758 vase
Vase_ba57ab3d vase
WallCabinet (1) cabinet
WallCabinet (2) cabinet
WallCabinet (3) cabinet
WallCabinet (4) cabinet
WallPainting3 painting
WallPainting9 painting
Watch_2ea293fb watch
Watch_2ee0717d watch
Watch_4a5a427b watch
WateringCan2_49d703aa watering can
WateringCan_76259cb4 watering can
Watering_Can_2 watering can
WhitePillow_f0273d63 pillow white
WhiteVase_17ed6b6a vase white
YellowVase_Medium_5 vase medium yellow
YellowVase_Tall_4 vase tall yellow
garbageCan1 garbage can
pillow_20 pillow
"""
with open("/tmp/items.tsv", "w") as of:
of.write(items)