Skip to content

Getting all Object Types in iTHOR #1055

Answered by mattdeitke
gzhihongwei asked this question in Q&A
Discussion options

You must be logged in to vote

Maybe try something like:

from ai2thor.controller import Controller
controller = Controller()

kitchens = [f"FloorPlan{i}" for i in range(1, 31)]
living_rooms = [f"FloorPlan{200 + i}" for i in range(1, 31)]
bedrooms = [f"FloorPlan{300 + i}" for i in range(1, 31)]
bathrooms = [f"FloorPlan{400 + i}" for i in range(1, 31)]

scenes = kitchens + living_rooms + bedrooms + bathrooms
object_types = set()
for scene in scenes:
    event = controller.reset(scene)
    for obj in event.metadata["objects"]:
        set.add(obj["objectType"])
print(len(object_types))

which iterates through the scenes and prints the object types.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gzhihongwei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants