allenai / Holodeck

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

Load new objects into the scene #55

Closed DDDDorwin closed 2 months ago

DDDDorwin commented 3 months ago

Thanks for the great work. But I'm still stuck at the last step of loading a new object into the scene. I would really appreciate it if anyone could provide more help.

I managed to use Objathor to convert .glb file into Thor format. And got the following files in the folder: objathor_generated_files

And then I put this folder into the _09_23_combinescale folder. And following the tips from #29. I removed the redundant files, and only kept.pkl.gz, albedo, emission, normal and thor_metadata.

In order to load it into a scene, I add the following part to the "objects" list in the json file of the scene. The name of the folder generated by Objathor is _40562244original , and I manually added an id, position, and other info for it.

        {
            "assetId": "40562244_original",
            "id": "ikeacoffeetable-0 (living room)",
            "kinematic": true,
            "position": {
                "x": 4.575476661719379,
                "y": 0.40774148810617195,
                "z": 3.2
            },
            "rotation": {
                "x": 0,
                "y": 270,
                "z": 0
            },
            "material": null,
            "roomId": "living room",
            "vertices": [
                [
                    210.5953323438757,
                    106.59884693898007
                ],
                [
                    210.5953323438757,
                    533.40115306102
                ],
                [
                    404.5,
                    533.40115306102
                ],
                [
                    404.5,
                    106.59884693898007
                ]
            ],
            "object_name": "ikeacoffeetable-0",
            "layer": "Procedural0"
        },

However, after I connect the JSON file to Unity, I got the following error:

(holodeck) dorwin@dorwin-HP-Z4-G5-Workstation-Desktop-PC:~/Holodeck$ python connect_to_unity.py --scene /home/dorwin/Holodeck/data/scenes/a_living_room-2024-05-28-10-58-41-940166/a_living_room.json
Traceback (most recent call last):
  File "/home/dorwin/Holodeck/connect_to_unity.py", line 32, in <module>
    controller.step(action="CreateHouse", house=scene)
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/controller.py", line 1063, in step
    self.run_action_hook(action)
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/controller.py", line 994, in run_action_hook
    event = method(action, self)
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/hooks/procedural_asset_hook.py", line 88, in CreateHouse
    return create_assets_if_not_exist(
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/hooks/procedural_asset_hook.py", line 48, in create_assets_if_not_exist
    evt = create_asset(
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/util/runtime_assets.py", line 160, in create_asset
    evt = controller.step(**create_prefab_action)
  File "/home/dorwin/miniconda3/envs/holodeck/lib/python3.9/site-packages/ai2thor/controller.py", line 1104, in step
    raise ValueError(self.last_event.metadata["errorMessage"])
ValueError: Invalid action: 

Can anyone tell me what the problem is? Thanks for any kind of help:)

YueYANG1996 commented 3 months ago

@Lucaweihs could you please help with this? Also @DDDDorwin, could you provide this asset here for debugging?

Lucaweihs commented 3 months ago

Hi @DDDDorwin,

Echoing @YueYANG1996, can you provide the scene and object? I'll load it locally and check what's going on.

DDDDorwin commented 3 months ago

Hi @Lucaweihs ,

Thanks for the reply. Atteached are the scene and object. Really apperaciate for your help and any feedback. 40562244_original.zip a_living_room-2024-05-28-10-58-41-940166.zip

Lucaweihs commented 3 months ago

Hi @DDDDorwin,

This problem seems to be caused by a mismatch between different versions of thor/objathor/etc.

Can you:

  1. Download the data in our new format
  2. Ensure you've checked out the latest AI2-THOR commit (I just updated the readme).
  3. Ensure you're using the correct version of the ai2thor python package (see the last line of this block, note that this may be different than the version you used to generate the objathor asset, that's fine but you should use this different version here).
  4. Checkout the lastest version of holodeck from main.

After doing the above:

  1. Place the 40562244_original asset into ~/.objathor-assets/2023_09_23/assets
  2. Run:
    python connect_to_unity.py --scene /home/dorwin/Holodeck/data/scenes/a_living_room-2024-05-28-10-58-41-940166/a_living_room.json

I believe that should work, here's what I see in my Unity editor: Screenshot 2024-08-26 at 9 51 54 AM

Lucaweihs commented 3 months ago

@DDDDorwin - Did this work for you?

DDDDorwin commented 3 months ago

@DDDDorwin - Did this work for you?

Hi @Lucaweihs , thanks for your support first. I do use the old database, that could be the problem. But I haven’t got the chance to follow it. I am currently having some hardware issues that causing me have very very slow internet speeds. I will try to fix it asap and then download the new dataset. Thanks again:)

MJSahebnasi commented 2 months ago

Hi @DDDDorwin, IDK if you solved your problem or not, but I had the same problem with internet speed on ubuntu 20.4 and this solved the problem: sudo iwconfig INTERFACE_NAME power off. you can get your WiFi interface name using ifconfig.

DDDDorwin commented 2 months ago

Hi @DDDDorwin, IDK if you solved your problem or not, but I had the same problem with internet speed on ubuntu 20.4 and this solved the problem: sudo iwconfig INTERFACE_NAME power off. you can get your WiFi interface name using ifconfig.

Hi @MJSahebnasi , thanks for the advice. I just fixed it.