allenai / Holodeck

CVPR 2024: Language Guided Generation of 3D Embodied AI Environments.
https://yueyang1996.github.io/holodeck
Apache License 2.0
304 stars 25 forks source link

Load generated JSON file in AI2THOR #17

Closed mlodel closed 6 months ago

mlodel commented 6 months ago

Is it possible to load the generated scene in ai2thor? I have been trying to do so by loading the JSON file content into the scene parameter of the ai2thor Controller, but when I visualize the scene I can see that all the objects are missing, only the rooms are generated.

This makes me think that the Objaverse data are not available, while they are for the generation with the main.py of Holodeck. How can I resolve this issue? Thanks for any help!

mlodel commented 6 months ago

Found the solution:

from ai2thor.controller import Controller
from ai2thor.hooks.procedural_asset_hook import ProceduralAssetHookRunner

scene = json.load(
    open(
        "data/scenes/<scene-XXX>/<scene>.json"
    )
)
objaverse_dir = (
    "./data/objaverse_holodeck/09_23_combine_scale/processed_2023_09_23_combine_scale"
)
controller = Controller(
    scene=scene,
    width=1000,
    height=1000,
    action_hook_runner=ProceduralAssetHookRunner(
        asset_directory=objaverse_dir,
        asset_symlink=True,
        verbose=True,
    ),
)