Merge branch 'v0.6.4-docker' of github.com:RoboMME/robomme-benchmark into v0.6.4-docker
Browse files
gradio-web/gradio_callbacks.py
CHANGED
|
@@ -159,25 +159,6 @@ def capitalize_first_letter(text: str) -> str:
|
|
| 159 |
return text[0].upper() + text[1:]
|
| 160 |
|
| 161 |
|
| 162 |
-
def get_videoplacebutton_goal(original_goal: str) -> str:
|
| 163 |
-
"""
|
| 164 |
-
为 VideoPlaceButton 任务构造新的任务目标
|
| 165 |
-
匹配 "cube on the target" 并替换为新的目标格式
|
| 166 |
-
"""
|
| 167 |
-
if not original_goal:
|
| 168 |
-
return ""
|
| 169 |
-
|
| 170 |
-
original_lower = original_goal.lower()
|
| 171 |
-
|
| 172 |
-
# 匹配 "cube on the target" 并替换
|
| 173 |
-
if "cube on the target" in original_lower:
|
| 174 |
-
# 使用正则表达式进行不区分大小写的替换
|
| 175 |
-
pattern = re.compile(re.escape("cube on the target"), re.IGNORECASE)
|
| 176 |
-
new_goal = pattern.sub("cube on the target that it was previously placed on", original_goal)
|
| 177 |
-
return capitalize_first_letter(new_goal)
|
| 178 |
-
else:
|
| 179 |
-
# 如果无法匹配,保持原始任务目标不变
|
| 180 |
-
return capitalize_first_letter(original_goal)
|
| 181 |
|
| 182 |
|
| 183 |
def _ui_option_label(session, opt_label: str, opt_idx: int) -> str:
|
|
|
|
| 159 |
return text[0].upper() + text[1:]
|
| 160 |
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
def _ui_option_label(session, opt_label: str, opt_idx: int) -> str:
|