-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig_utils.py
106 lines (103 loc) · 5.43 KB
/
config_utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import habitat
from habitat.config.read_write import read_write
from habitat.config.default_structured_configs import (
CollisionsMeasurementConfig,
FogOfWarConfig,
TopDownMapMeasurementConfig,
)
HM3D_CONFIG_PATH = "<YOUR SAVE PATH>/habitat-lab/habitat-lab/habitat/config/benchmark/nav/objectnav/objectnav_hm3d.yaml"
MP3D_CONFIG_PATH = "<YOUR SAVE PATH>/habitat-lab/habitat-lab/habitat/config/benchmark/nav/objectnav/objectnav_mp3d.yaml"
R2R_CONFIG_PATH = "<YOUR SAVE PATH>/habitat-lab/habitat-lab/habitat/config/benchmark/nav/vln_r2r.yaml"
def hm3d_config(path:str=HM3D_CONFIG_PATH,stage:str='val',episodes=200):
habitat_config = habitat.get_config(path)
with read_write(habitat_config):
habitat_config.habitat.dataset.split = stage
habitat_config.habitat.dataset.scenes_dir = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes"
habitat_config.habitat.dataset.data_path = "/home/PJLAB/caiwenzhe/Desktop/dataset/habitat_task/objectnav/hm3d/v2/{split}/{split}.json.gz"
habitat_config.habitat.simulator.scene_dataset = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes/hm3d_v0.2/hm3d_annotated_basis.scene_dataset_config.json"
habitat_config.habitat.environment.iterator_options.num_episode_sample = episodes
habitat_config.habitat.task.measurements.update(
{
"top_down_map": TopDownMapMeasurementConfig(
map_padding=3,
map_resolution=1024,
draw_source=True,
draw_border=True,
draw_shortest_path=False,
draw_view_points=True,
draw_goal_positions=True,
draw_goal_aabbs=True,
fog_of_war=FogOfWarConfig(
draw=True,
visibility_dist=5.0,
fov=90,
),
),
"collisions": CollisionsMeasurementConfig(),
})
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.max_depth=5.0
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.normalize_depth=False
habitat_config.habitat.task.measurements.success.success_distance = 0.25
return habitat_config
def mp3d_config(path:str=MP3D_CONFIG_PATH,stage:str='val',episodes=200):
habitat_config = habitat.get_config(path)
with read_write(habitat_config):
habitat_config.habitat.dataset.split = stage
habitat_config.habitat.dataset.scenes_dir = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes"
habitat_config.habitat.dataset.data_path = "/home/PJLAB/caiwenzhe/Desktop/dataset/habitat_task/objectnav/mp3d/v1/{split}/{split}.json.gz"
habitat_config.habitat.simulator.scene_dataset = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes/mp3d/mp3d.scene_dataset_config.json"
habitat_config.habitat.environment.iterator_options.num_episode_sample = episodes
habitat_config.habitat.task.measurements.update(
{
"top_down_map": TopDownMapMeasurementConfig(
map_padding=3,
map_resolution=1024,
draw_source=True,
draw_border=True,
draw_shortest_path=False,
draw_view_points=True,
draw_goal_positions=True,
draw_goal_aabbs=True,
fog_of_war=FogOfWarConfig(
draw=True,
visibility_dist=5.0,
fov=79,
),
),
"collisions": CollisionsMeasurementConfig(),
})
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.max_depth=5.0
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.normalize_depth=False
habitat_config.habitat.task.measurements.success.success_distance = 0.25
return habitat_config
def r2r_config(path:str=R2R_CONFIG_PATH,stage:str='val_seen',episodes=200):
habitat_config = habitat.get_config(path)
with read_write(habitat_config):
habitat_config.habitat.dataset.split = stage
habitat_config.habitat.dataset.scenes_dir = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes"
habitat_config.habitat.dataset.data_path = "/home/PJLAB/caiwenzhe/Desktop/dataset/habitat_task/vln/r2r/{split}/{split}.json.gz"
habitat_config.habitat.simulator.scene_dataset = "/home/PJLAB/caiwenzhe/Desktop/dataset/scenes/mp3d/mp3d.scene_dataset_config.json"
habitat_config.habitat.environment.iterator_options.num_episode_sample = episodes
habitat_config.habitat.task.measurements.update(
{
"top_down_map": TopDownMapMeasurementConfig(
map_padding=3,
map_resolution=1024,
draw_source=True,
draw_border=True,
draw_shortest_path=False,
draw_view_points=True,
draw_goal_positions=True,
draw_goal_aabbs=True,
fog_of_war=FogOfWarConfig(
draw=True,
visibility_dist=5.0,
fov=79,
),
),
"collisions": CollisionsMeasurementConfig(),
})
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.max_depth=5.0
habitat_config.habitat.simulator.agents.main_agent.sim_sensors.depth_sensor.normalize_depth=False
habitat_config.habitat.task.measurements.success.success_distance = 0.25
return habitat_config