facebookresearch / sound-spaces

A first-of-its-kind acoustic simulation platform for audio-visual embodied AI research. It supports training and evaluating multiple tasks and applications.
https://soundspaces.org
Creative Commons Attribution 4.0 International
322 stars 55 forks source link

How to get the scene / room id of SS1 environment. #117

Closed dosssman closed 11 months ago

dosssman commented 1 year ago

Hello again. Sorry for the recent deluge of questions.

I am currently using SS1 version of SAVI to collect some dataset based on the oracle actions. For each trajectory, I am also interested in knowing which scene / room the agent is current moving in.

To this end, I inspected the envs object created with the constuct_envs() function as in ppo_trainer.py, and came up with the following function to recover the scene id of a given environment:

def get_env_scene_id(envs, env_idx):
    # NOTE: might be different if using other wrapper like SYNC_ENV or VecEnv
    return envs.workers[env_idx]._env._env.current_episode.scene_id.split("/")[3]
    # return envs.workers[env_idx]._env._env._task._sim._current_scene.strip("data/scene_datasets/mp3d").split("/")[0]

However, when collection a few trajectories (around a 100), then plotting their top_down_map, the same scene id will sometime have different maps:

For example, there is the scene PX4nDJXEHrG which has give me two different maps, as per the screenshot below: image

Or the scene E9uDoFAP3SH that also exhibits two different maps: image

Would really appreciate if there was a more reliable method to recover the scene id from the running simulation. Thanks a lot for your time.

dosssman commented 1 year ago

Do some scene have multiple floors maybe ?

ChanganVR commented 11 months ago

@dosssman yes, I think getting the id from scene_id makes sense and is probably what I would do.

Yes, some scenes do contain multiple floors, possibly why you are seeing multiple floors with the same environment ID.

dosssman commented 11 months ago

Thanks a lot for the answer.