HongzeFu commited on
Commit
49f2d91
·
1 Parent(s): 601060f
gradio-web/config.py CHANGED
@@ -58,7 +58,7 @@ UI_TEXT = {
58
  "select_keypoint_before_execute": "please click the keypoint selection image before execute!",
59
  },
60
  "actions": {
61
- "keypoint_required_suffix": " (click mouse 🖱️ to select 🎯)",
62
  },
63
  "errors": {
64
  "load_missing_task": "Error loading task: missing current_task",
@@ -84,12 +84,12 @@ UI_ACTION_TEXT_OVERRIDES = {
84
  "move backward-left": "move backward-left↗︎",
85
  "move backward-right": "move backward-right↖︎",
86
  },
87
- "RouteStick": {
88
- "move to the nearest left target by circling around the stick clockwise": "move left clockwise↘︎→↗︎ ◟→◞",
89
- "move to the nearest right target by circling around the stick clockwise": "move right clockwise↖︎←↙︎ ◟←◞",
90
- "move to the nearest left target by circling around the stick counterclockwise": "move left counterclockwise↗︎→↘︎ ◜→◝",
91
- "move to the nearest right target by circling around the stick counterclockwise": "move right counterclockwise↙︎←↖︎ ◜←◝",
92
- },
93
  }
94
 
95
  ROUTESTICK_OVERLAY_ACTION_TEXTS = [
 
58
  "select_keypoint_before_execute": "please click the keypoint selection image before execute!",
59
  },
60
  "actions": {
61
+ "keypoint_required_suffix": "🎯",
62
  },
63
  "errors": {
64
  "load_missing_task": "Error loading task: missing current_task",
 
84
  "move backward-left": "move backward-left↗︎",
85
  "move backward-right": "move backward-right↖︎",
86
  },
87
+ # "RouteStick": {
88
+ # "move to the nearest left target by circling around the stick clockwise": "move left clockwise↘︎→↗︎ ◟→◞",
89
+ # "move to the nearest right target by circling around the stick clockwise": "move right clockwise↖︎←↙︎ ◟←◞",
90
+ # "move to the nearest left target by circling around the stick counterclockwise": "move left counterclockwise↗︎→↘︎ ◜→◝",
91
+ # "move to the nearest right target by circling around the stick counterclockwise": "move right counterclockwise↙︎←↖︎ ◜←◝",
92
+ # },
93
  }
94
 
95
  ROUTESTICK_OVERLAY_ACTION_TEXTS = [
gradio-web/note_content.py CHANGED
@@ -2,10 +2,12 @@
2
  Note content management module
3
  Manages Coordinate Information and Task Hint content
4
  """
 
 
5
  def get_coordinate_information():
6
  """
7
  Get coordinate information content (Note 1)
8
-
9
  Returns:
10
  str: Coordinate information in Markdown format
11
  """
@@ -15,167 +17,199 @@ The coordinate system differs based on the camera perspective.
15
  In the base camera view, the lateral axis is inverted relative to the robot: the right side of the camera frame corresponds to the robot's left side, and vice versa.
16
 
17
  Conversely, the wrist camera view is fully aligned with the robot's motion frame. Directional movements are consistent, meaning 'right' in the camera view corresponds to the robot's right, and 'forward' implies forward movement
 
 
18
  """
19
 
20
 
21
  def get_task_hint(env_id):
22
  """
23
  Get task hint content based on environment ID (Note 2)
24
-
25
  Args:
26
  env_id (str): Environment ID, e.g., "VideoPlaceOrder", "PickXtimes", etc.
27
-
28
  Returns:
29
  str: Task hint in Markdown format
30
  """
31
  # Return different hints based on env_id
32
  # Order follows solve_3.5_parallel_multi_loop_v4.py DEFAULT_ENVS list
33
  hints = {
34
- "PickXtimes": """Suppose the task goal is to pick up red cubes for two times, a typical action sequence could be:
35
- 1. pick up the cube (use mouse click to select the cube with the correct color)
36
- 2. place the cube onto the target.
37
- 3. pick up the cube (use mouse click to select the cube with the correct color)
38
- 4. place the cube onto the target.
39
- 5. press the button to stop.
40
- """,
41
-
42
- "StopCube": """Suppose the task goal is to stop the cube on the target for three times, a typical action sequence could be:
43
- 1. move to the top of the button to prepare
44
- 2. remain static (it will execute for a fixed time duration, you need to count the times the cube has passed the target)
45
- 3. remain static
46
- 4. remain static
47
- 5. remain static (Suppose you feel the cube is about to reach the target for the expected number of times, you should press the button to stop the cube directly)
48
- 6. press the button to stop.
49
- """,
50
-
51
- "SwingXtimes": """Suppose the task goal is to swing the back and forth for two times, a typical action sequence could be:
52
- 1. pick up the cube (use mouse click to select the cube with the correct color)
53
- 2. move to the top of the target (use mouse click to select the right-side target)
54
- 3. move to the top of the target (use mouse click to select the left-side target)
55
- 4. move to the top of the target (use mouse click to select the right-side target)
56
- 5. move to the top of the target (use mouse click to select the left-side target)
57
- 6. put the cube onto the table
58
- 7. press the button to stop.
59
- """,
60
-
61
- "BinFill": """Suppose the task goal is to pick two red cubes in the bin, a typical action sequence could be:
62
- 1. pick up the cube (use mouse click to select the cube with the correct color)
63
- 2. put it into the bin.
64
- 3. pick up the cube (use mouse click to select the cube with the correct color)
65
- 4. put it into the bin.
66
- 5. press the button to stop.
67
- """,
68
-
69
- "VideoUnmaskSwap": """Watch the video carefully. Cubes will be hidden by containers, and you need to memorize the color of the cube inside each one.
70
- You need to track the containers since they swap positions!
71
- A typical action sequence could be:
72
- 1. pick up the container (use mouse click to select the container)
73
- 2. drop the container down.
74
-
75
- pick up another container if the task goal is to find two containers.
76
- """,
77
-
78
- "VideoUnmask": """Watch the video carefully. Cubes will be hidden by containers, and you need to memorize the color of the cube inside each one.
79
- A typical action sequence could be:
80
- 1. pick up the container (use mouse click to select the container)
81
- 2. drop the container down.
82
-
83
- pick up another container if the task goal is to find two containers.
84
- """,
85
-
86
- "ButtonUnmaskSwap":
87
- """Press the buttons sequentially. While pressing the buttons, the cubes will be hidden inside the containers, and you need to memorize the color of the cube inside each one.
88
- You need to track the containers since they swap positions!
89
- A typical action sequence could be:
90
- 1. press the first button.
91
- 2. press the second button.
92
- 3. pick up the container (use mouse click to select the container)
93
- 4. drop the container down.
94
-
95
- pick up another container if the task goal is to find two containers.
96
- """,
97
-
98
- "ButtonUnmask":"""Press the buttons sequentially. While pressing the buttons, the cubes will be hidden inside the containers, and you need to memorize the color of the cube inside each one.
99
- A typical action sequence could be:
100
- 1. press the button.
101
- 2. pick up the container (use mouse click to select the container)
102
- 3. drop the container down.
103
-
104
- pick up another container if the task goal is to find two containers.
105
- """,
106
-
107
- "VideoRepick": """Remember the cube that has been picked up before, and then pick it up again. The cubes might be swapped positions.
108
- A typical action sequence could be:
109
- 1. pick up the cube (use mouse click to select the correct cube with the correct color)
110
- 2. put the cube down on the table.
111
- (repeat 1 and 2 for the expected number of times)
112
- 3. press the button to stop.
113
- """,
114
-
115
- "VideoPlaceButton":
116
- """The video shows a robot placing a cube on different targets and pressing the button in a sequence. The targets may change positions.
117
- A typical action sequence could be:
118
- 1. pick up the cube (use mouse click to select the correct cube with the correct color)
119
- 2. put the cube down on the target (use mouse click to select the target)
120
- """
121
- ,
122
-
123
- "VideoPlaceOrder": """The video shows a robot placing a cube on different targets and pressing the button in a sequence. The targets may change positions.
124
- A typical action sequence could be:
125
- 1. pick up the cube (use mouse click to select the correct cube with the correct color)
126
- 2. put the cube down on the target (use mouse click to select the target)
127
- """,
128
-
129
- "PickHighlight": """While the robot is pressing the button, some cubes will be highlighted with white discs on the table. Remember them.
130
- A typical action sequence could be:
131
- 1. press the button.
132
- 2. pick up the cube (use mouse click to select the correct cube with the correct color)
133
- 3. put the cube down on the table.
134
- (Repeat 2 and 3 for with the rest of highlighted cubes)
135
- """,
136
-
137
- "InsertPeg": """The video shows a robot picking up and inserting a peg into a hole.
138
- The peg consists of two parts with different colors; you need to pick up the correct part of the peg and insert it into the hole from the correct side.
139
- A typical action sequence could be:
140
- 1. pick up the peg (use mouse click to select the correct peg and the correct part of the peg)
141
- 2. insert the peg into the hole on the left side
142
- """,
143
-
144
- "MoveCube": """The video shows a robot moving a cube to a target using different methods.
145
- The robot might (1) pick up and place the cube, (2) push it with the gripper, or (3) hook it using a peg.
146
- Remember the way the robot moves the cube and choose the correct action to execute.
147
- """,
148
-
149
- "PatternLock": """The video shows a robot tracing a pattern with a stick.
150
- Remember the movements and reproduce them by choosing correct actions.
151
- The correct directions (e.g., left, right, forward, backward) are as given near the base camera view.
152
- """,
153
-
154
- "RouteStick": """The video shows a robot navigating from one target to another by circling around a stick.
155
- The movement can be clockwise or counter-clockwise, and the stick may be on the left or right side.
156
- Remember the sequence of actions and choose the correct action to execute.
157
- The correct directions (e.g., left, right, forward, backward) are as given near the base camera view.
158
- """,
159
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
-
162
  # Normalize env_id to handle case-insensitive matching
163
  # First try direct lookup
164
  if env_id in hints:
165
  return hints[env_id]
166
-
167
  # Create a mapping from lowercase to standard format for case-insensitive lookup
168
  # This handles cases where env_id might be passed as lowercase (e.g., "pickxtimes", "binfill")
169
  env_id_lower_to_standard = {
170
  key.lower(): key for key in hints.keys()
171
  }
172
-
173
  # Try case-insensitive lookup
174
  if env_id:
175
  env_id_lower = env_id.lower()
176
  if env_id_lower in env_id_lower_to_standard:
177
  standard_key = env_id_lower_to_standard[env_id_lower]
178
  return hints[standard_key]
179
-
180
  # Return default hint if not found
181
- return """///"""
 
 
 
 
2
  Note content management module
3
  Manages Coordinate Information and Task Hint content
4
  """
5
+
6
+
7
  def get_coordinate_information():
8
  """
9
  Get coordinate information content (Note 1)
10
+
11
  Returns:
12
  str: Coordinate information in Markdown format
13
  """
 
17
  In the base camera view, the lateral axis is inverted relative to the robot: the right side of the camera frame corresponds to the robot's left side, and vice versa.
18
 
19
  Conversely, the wrist camera view is fully aligned with the robot's motion frame. Directional movements are consistent, meaning 'right' in the camera view corresponds to the robot's right, and 'forward' implies forward movement
20
+
21
+ select "Ground Truth Action" if you need help, and "Execute" it
22
  """
23
 
24
 
25
  def get_task_hint(env_id):
26
  """
27
  Get task hint content based on environment ID (Note 2)
28
+
29
  Args:
30
  env_id (str): Environment ID, e.g., "VideoPlaceOrder", "PickXtimes", etc.
31
+
32
  Returns:
33
  str: Task hint in Markdown format
34
  """
35
  # Return different hints based on env_id
36
  # Order follows solve_3.5_parallel_multi_loop_v4.py DEFAULT_ENVS list
37
  hints = {
38
+ "PickXtimes": """\
39
+ Suppose the task goal is to pick up red cubes for two times, a typical action sequence could be:
40
+ 1. Pick up the cube (use mouse click to select the cube with the correct color)
41
+ 2. Place the cube onto the target.
42
+ 3. Pick up the cube (use mouse click to select the cube with the correct color)
43
+ 4. Place the cube onto the target.
44
+ 5. Press the button to stop.
45
+ Select "Ground Truth Action" if you need help, and "Execute" it
46
+ """,
47
+
48
+ "StopCube": """\
49
+ Suppose the task goal is to stop the cube on the target for three times, a typical action sequence could be:
50
+ 1. Move to the top of the button to prepare
51
+ 2. Remain static (it will execute for a fixed time duration, you need to count the times the cube has passed the target)
52
+ 3. Remain static
53
+ 4. Remain static
54
+ 5. Remain static (Suppose you feel the cube is about to reach the target for the expected number of times, you should press the button to stop the cube directly)
55
+ 6. Press the button to stop.
56
+ Select "Ground Truth Action" if you need help, and "Execute" it
57
+ """,
58
+
59
+ "SwingXtimes": """\
60
+ Suppose the task goal is to swing the back and forth for two times, a typical action sequence could be:
61
+ 1. Pick up the cube (use mouse click to select the cube with the correct color)
62
+ 2. Move to the top of the target (use mouse click to select the right-side target)
63
+ 3. Move to the top of the target (use mouse click to select the left-side target)
64
+ 4. Move to the top of the target (use mouse click to select the right-side target)
65
+ 5. Move to the top of the target (use mouse click to select the left-side target)
66
+ 6. Put the cube onto the table
67
+ 7. Press the button to stop.
68
+ Spatial directions (e.g., left, right) follow the robot base coordinate frame
69
+ Select "Ground Truth Action" if you need help, and "Execute" it
70
+ """,
71
+
72
+ "BinFill": """\
73
+ Suppose the task goal is to pick two red cubes in the bin, a typical action sequence could be:
74
+ 1. Pick up the cube (use mouse click to select the cube with the correct color)
75
+ 2. Put it into the bin.
76
+ 3. Pick up the cube (use mouse click to select the cube with the correct color)
77
+ 4. Put it into the bin.
78
+ 5. Press the button to stop.
79
+ Select "Ground Truth Action" if you need help, and "Execute" it
80
+ """,
81
+
82
+ "VideoUnmaskSwap": """\
83
+ Watch the video carefully. Cubes will be hidden by containers, and you need to memorize the color of the cube inside each one.
84
+ You need to track the containers since they swap positions!
85
+ A typical action sequence could be:
86
+ 1. Pick up the container (use mouse click to select the container)
87
+ 2. Drop the container down.
88
+ Pick up another container if the task goal is to find two containers.
89
+ Select "Ground Truth Action" if you need help, and "Execute" it
90
+ """,
91
+
92
+ "VideoUnmask": """\
93
+ Watch the video carefully. Cubes will be hidden by containers, and you need to memorize the color of the cube inside each one.
94
+ A typical action sequence could be:
95
+ 1. Pick up the container (use mouse click to select the container)
96
+ 2. Drop the container down.
97
+ Pick up another container if the task goal is to find two containers.
98
+ Select "Ground Truth Action" if you need help, and "Execute" it
99
+ """,
100
+
101
+ "ButtonUnmaskSwap": """\
102
+ Press the buttons sequentially. While pressing the buttons, the cubes will be hidden inside the containers, and you need to memorize the color of the cube inside each one.
103
+ You need to track the containers since they swap positions!
104
+ A typical action sequence could be:
105
+ 1. Press the first button.
106
+ 2. Press the second button.
107
+ 3. Pick up the container (use mouse click to select the container)
108
+ 4. Drop the container down.
109
+ Pick up another container if the task goal is to find two containers.
110
+ Select "Ground Truth Action" if you need help, and "Execute" it
111
+ """,
112
+
113
+ "ButtonUnmask": """\
114
+ Press the buttons sequentially. While pressing the buttons, the cubes will be hidden inside the containers, and you need to memorize the color of the cube inside each one.
115
+ A typical action sequence could be:
116
+ 1. Press the button.
117
+ 2. Pick up the container (use mouse click to select the container)
118
+ 3. Drop the container down.
119
+ Pick up another container if the task goal is to find two containers.
120
+ Select "Ground Truth Action" if you need help, and "Execute" it
121
+ """,
122
+
123
+ "VideoRepick": """\
124
+ Remember the cube that has been picked up before, and then pick it up again. The cubes might be swapped positions.
125
+ A typical action sequence could be:
126
+ 1. Pick up the cube (use mouse click to select the correct cube with the correct color)
127
+ 2. Put the cube down on the table.
128
+ (Repeat 1 and 2 for the expected number of times)
129
+ 3. Press the button to stop.
130
+ Select "Ground Truth Action" if you need help, and "Execute" it
131
+ """,
132
+
133
+ "VideoPlaceButton": """\
134
+ The video shows a robot placing a cube on different targets and pressing the button in a sequence. The targets may change positions.
135
+ A typical action sequence could be:
136
+ 1. Pick up the cube (use mouse click to select the correct cube with the correct color)
137
+ 2. Put the cube down on the target (use mouse click to select the target)
138
+ Select "Ground Truth Action" if you need help, and "Execute" it
139
+ """,
140
+
141
+ "VideoPlaceOrder": """\
142
+ The video shows a robot placing a cube on different targets and pressing the button in a sequence. The targets may change positions.
143
+ A typical action sequence could be:
144
+ 1. Pick up the cube (use mouse click to select the correct cube with the correct color)
145
+ 2. Put the cube down on the target (use mouse click to select the target)
146
+ Select "Ground Truth Action" if you need help, and "Execute" it
147
+ """,
148
+
149
+ "PickHighlight": """\
150
+ While the robot is pressing the button, some cubes will be highlighted with white discs on the table. Remember them.
151
+ A typical action sequence could be:
152
+ 1. Press the button.
153
+ 2. Pick up the cube (use mouse click to select the correct cube with the correct color)
154
+ 3. Put the cube down on the table.
155
+ (Repeat 2 and 3 for with the rest of highlighted cubes)
156
+ Select "Ground Truth Action" if you need help, and "Execute" it
157
+ """,
158
+
159
+ "InsertPeg": """\
160
+ The video shows a robot picking up and inserting a peg into a hole.
161
+ The peg consists of two parts with different colors; you need to pick up the correct part of the peg and insert it into the hole from the correct side.
162
+ A typical action sequence could be:
163
+ 1. Pick up the peg (use mouse click to select the correct peg and the correct part of the peg)
164
+ 2. Insert the peg into the hole on the left side
165
+ Spatial directions (e.g., left, right) follow the robot base coordinate frame.
166
+ Select "Ground Truth Action" if you need help, and "Execute" it
167
+ """,
168
+
169
+ "MoveCube": """\
170
+ The video shows a robot moving a cube to a target using different methods.
171
+ The robot might (1) pick up and place the cube, (2) push it with the gripper, or (3) hook it using a peg.
172
+ Remember the way the robot moves the cube and choose the correct action to execute.
173
+ Select "Ground Truth Action" if you need help, and "Execute" it
174
+ """,
175
+
176
+ "PatternLock": """\
177
+ The video shows a robot tracing a pattern with a stick.
178
+ Remember the movements and reproduce them by choosing correct actions.
179
+ Spatial directions (e.g., left, right, forward, backward) follow the robot base coordinate frame.
180
+ Select "Ground Truth Action" if you need help, and "Execute" it
181
+ """,
182
+
183
+ "RouteStick": """\
184
+ The video shows a robot navigating from one target to another by circling around a stick.
185
+ The movement can be clockwise or counter-clockwise, and the stick may be on the left or right side.
186
+ Remember the sequence of actions and choose the correct action to execute.
187
+ Spatial directions (e.g., left, right) follow the robot base coordinate frame.
188
+ Select "Ground Truth Action" if you need help, and "Execute" it
189
+ """,
190
+
191
  }
192
+
193
  # Normalize env_id to handle case-insensitive matching
194
  # First try direct lookup
195
  if env_id in hints:
196
  return hints[env_id]
197
+
198
  # Create a mapping from lowercase to standard format for case-insensitive lookup
199
  # This handles cases where env_id might be passed as lowercase (e.g., "pickxtimes", "binfill")
200
  env_id_lower_to_standard = {
201
  key.lower(): key for key in hints.keys()
202
  }
203
+
204
  # Try case-insensitive lookup
205
  if env_id:
206
  env_id_lower = env_id.lower()
207
  if env_id_lower in env_id_lower_to_standard:
208
  standard_key = env_id_lower_to_standard[env_id_lower]
209
  return hints[standard_key]
210
+
211
  # Return default hint if not found
212
+ return """///
213
+
214
+ select "Ground Truth Action" if you need help, and "Execute" it
215
+ """
gradio-web/ui_layout.py CHANGED
@@ -449,7 +449,7 @@ def create_ui_blocks():
449
  with gr.Blocks(title="Oracle Planner Interface") as demo:
450
  demo.css = CSS
451
 
452
- gr.Markdown("## RoboMME Human Evaluation 🚀🚀🚀", elem_id="header_title")
453
  with gr.Row():
454
  with gr.Column(scale=1):
455
  header_task_box = gr.Dropdown(
@@ -463,7 +463,7 @@ def create_ui_blocks():
463
  with gr.Column(scale=2):
464
  header_goal_box = gr.Textbox(
465
  value=render_header_goal(""),
466
- label="Goal 🎯",
467
  show_label=True,
468
  interactive=False,
469
  lines=1,
 
449
  with gr.Blocks(title="Oracle Planner Interface") as demo:
450
  demo.css = CSS
451
 
452
+ gr.Markdown("## RoboMME Interactive Demo 🚀🚀🚀", elem_id="header_title")
453
  with gr.Row():
454
  with gr.Column(scale=1):
455
  header_task_box = gr.Dropdown(
 
463
  with gr.Column(scale=2):
464
  header_goal_box = gr.Textbox(
465
  value=render_header_goal(""),
466
+ label="Task Goal 🎯",
467
  show_label=True,
468
  interactive=False,
469
  lines=1,