-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprompt.py
More file actions
110 lines (94 loc) · 4.39 KB
/
Copy pathprompt.py
File metadata and controls
110 lines (94 loc) · 4.39 KB
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
107
108
109
110
def get_attribute_prompt(category="unknown"):
return f"""
You are annotating ONE target object for an embodied navigation benchmark.
The images show different views of the SAME target object.
Target object category: {category}
Your task:
Identify visible, navigation-relevant appearance attributes of the target object.
Return STRICT JSON only:
{{
"color": "...",
"material": "...",
"shape_and_outline": "...",
"texture": "...",
"visual_features": "...",
"confidence": 0.0
}}
Field guidelines:
- "color": dominant visible color(s) of the target object, only use simple colors like "brown", "purple", "white and blue", "unknown" and so on.
- "material": visually inferable material, e.g. "wood", "fabric", "metal", "plastic", "glass", "unknown" and so on.
- "shape_and_outline": concise shape or silhouette, e.g. "tall rectangular outline", "round bowl-like shape", "thin vertical frame", "unknown".
- "texture": visible surface texture or pattern, e.g. "smooth", "wood grain", "woven fabric", "striped", "glossy", "unknown".
- "visual_features": other distinctive visible features useful for finding it, e.g. "has cushions", "two handles", "white double doors", "unknown".
- "confidence": your confidence from 0.0 to 1.0 that the attributes describe the target object, not the background.
Rules:
- Describe only the target object category above.
- Use all views together; do not describe a different object that appears in only one view.
- Ignore walls, floors, ceilings, room layout, lighting, and unrelated objects.
- Do not guess hidden or non-visible properties.
- If an attribute is uncertain, use "unknown".
- If the target object is unclear, too small, heavily occluded, or mixed with other objects, lower confidence.
- Be concise.
- Output JSON only.
Example output for a chair:
{{
"color": "brown",
"material": "wood",
"shape_and_outline": "upright chair shape with a backrest",
"texture": "smooth wooden surface",
"visual_features": "has cushions and visible legs",
"confidence": 0.8
}}
"""
def get_navigation_task_prompt(
target_object_ids=None,
target_mode="any",
target_count=None,
natural_language=None,
goal_type="description",
goal_text=None,
max_actions=500,
):
instruction_text = (
"The task is multi-object navigation in an HM3D environment. "
"Your goal is to guide the embodied agent to the requested target object(s) using discrete navigation actions."
)
goal_type = str(goal_type or "description").lower()
if goal_type == "object":
instruction_text += (
" The goal type is 'object'. The goal text is a dataset category name, "
"not a free-form language description."
)
if goal_text:
instruction_text += f" The target object category is: \"{goal_text}\"."
else:
instruction_text += " The goal type is 'description'."
instruction_text += f" The success mode is '{target_mode}'."
if str(target_mode or "").lower() == "many" and target_count is not None:
instruction_text += f" You must find {int(target_count)} matching target objects."
if goal_type != "object" and natural_language:
instruction_text += " The instruction is: \"" + ", ".join(natural_language) + "\"."
return f"""
Navigation Task Description:
{instruction_text}
Agent action format:
Choose exactly one discrete action for the next step.
Action IDs:
- 0: FINISH the whole episode when you believe the task is complete
- 1: MOVE_FORWARD by 0.25 meters
- 2: TURN_LEFT by 30 degrees
- 3: TURN_RIGHT by 30 degrees
- 4: LOOK_UP by 30 degrees
- 5: LOOK_DOWN by 30 degrees
- 6: TARGET_FOUND / SUBTASK_STOP when you are next to a matching target instance
- 9: LEGACY_FINISH alias, accepted for compatibility
Additional guidelines:
- Use move_forward to advance in the current viewing direction.
- Use turn_left or turn_right to rotate in place and inspect nearby space.
- Use look_up or look_down to inspect higher or lower objects without changing position.
- Output 6 whenever you believe you are next to a new matching target object.
- In single or any mode, output 6 or 0 once near a matching target object to finish the task.
- In many or all mode, output 0 only when you believe the whole episode is complete.
- In many or all mode, action 6 records a found target but does not give you a next target.
- In many or all mode, you must decide for yourself whether all required targets have been found.
"""