Getting all Object Types in iTHOR #1055
-
Hi there, I was trying to compile all of the from functools import reduce
from ai2thor.controller import RECEPTACLE_OBJECTS
objects = reduce(set.union, RECEPTACLE_OBJECTS.values())
objects |= set(RECEPTACLE_OBJECTS.keys())
objects = sorted(objects)
print(len(objects)) This prints out 65, which was much less than I was expecting given this page. When I did a quick sanity check of the document.querySelectorAll("tr").length I get 127. I know this is an overestimate of the rows, but I'm no where near that amount of objects. Is there somewhere simpler to get all of the different |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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. |
Beta Was this translation helpful? Give feedback.
Maybe try something like:
which iterates through the scenes and prints the object types.