Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to get objectnav goal string label from "observations["objectgoal"][0]" #2525

Open
Benson722 opened this issue Dec 30, 2024 · 0 comments

Comments

@Benson722
Copy link

Habitat-Sim version

v0.3.2 (stable)

Habitat is under active development, and we advise users to restrict themselves to stable releases. Are you using the latest release version of Habitat-Sim? Your question may already be addressed in the latest version. We may also not be able to help with problems in earlier versions because they sometimes lack the more verbose logging needed for debugging.

Main branch contains 'bleeding edge' code and should be used at your own risk.

Docs and Tutorials

Did you read the docs? https://aihabitat.org/docs/habitat-sim/
yes
Did you check out the tutorials? https://aihabitat.org/tutorial/2020/
yes
Perhaps your question is answered there. If not, carry on!

❓ Questions and Help

def example():    
    config=habitat.get_config("benchmark/nav/objectnav/objectnav_hm3d.yaml")
    # config = habitat.get_config(config_path="benchmark/nav/pointnav/pointnav_habitat_test.yaml")
    
    with read_write(config):
        # config.habitat.dataset.split = "val"
        agent_config = get_agent_config(sim_config=config.habitat.simulator)
        agent_config.sim_sensors.update(
            {"semantic_sensor": HabitatSimSemanticSensorConfig(height=256, width=256)}
        )
        config.habitat.simulator.turn_angle = 30

    env = habitat.Env(
        config=config
    )

    print("Environment creation successful")
    observations = env.reset()
    print("Destination, distance: {:3f}, Goal(uuid): {:.d}".format(
        env.get_metrics()["distance_to_goal"],
        observations["objectgoal"][0])
    )
    # print("Destination, distance: {:3f}, theta(radians): {:.2f}".format(
    #     observations["pointgoal_with_gps_compass"][0],
    #     observations["pointgoal_with_gps_compass"][1])
    # )
...

I want to get string label about "observations["objectgoal"][0])", which is "sofa" in the code. I don't find it in "observations["objectgoal"]". By the way, the value of observations["objectgoal"][0]) is 5, and the string label in dataset is sofa:

(objectnav/hm3d/v1/train/train.json.gz)

{"episodes": [], "category_to_task_category_id": {"chair": 0, "bed": 1, "plant": 2, "toilet": 3, "tv_monitor": 4, "sofa": 5}, "category_to_scene_annotation_category_id": {"chair": 0, "bed": 1, "plant": 2, "toilet": 3, "tv_monitor": 4, "sofa": 5}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant