From 13e60401480f73679d5e33fa6f7773f475b426e0 Mon Sep 17 00:00:00 2001 From: David Chang Date: Fri, 15 Mar 2024 22:50:22 +0800 Subject: [PATCH 1/2] ver Mar15thv2 fixed a bug --- mm_agents/accessibility_tree_wrap/heuristic_retrieve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py b/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py index 191eaa7..e37f614 100644 --- a/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py +++ b/mm_agents/accessibility_tree_wrap/heuristic_retrieve.py @@ -69,11 +69,11 @@ def judge_node(node: ET, platform="ubuntu", check_image=False) -> bool: keeps = keeps and coordinates[0]>0 and coordinates[1]>0 and sizes[0]>0 and sizes[1]>0 return keeps -def filter_nodes(root: ET, platform="ubuntu"): +def filter_nodes(root: ET, platform="ubuntu", check_image=False): filtered_nodes = [] for node in root.iter(): - if judge_node(node, platform): + if judge_node(node, platform, check_image): filtered_nodes.append(node) #print(ET.tostring(node, encoding="unicode")) From 9bafe093724c2a3ecd976b96afba0bc41b50207f Mon Sep 17 00:00:00 2001 From: David Chang Date: Sun, 17 Mar 2024 23:01:50 +0800 Subject: [PATCH 2/2] ver Mar17th fixed an error in task config --- branch-config/filelist | 5 ----- .../b5062e3e-641c-4e3a-907b-ac864d2e7652.json | 4 ++-- main.py | 15 +++++++-------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/branch-config/filelist b/branch-config/filelist index 513343c..a34a418 100644 --- a/branch-config/filelist +++ b/branch-config/filelist @@ -5,10 +5,5 @@ evaluation_examples logs mm_agents -experiment_a11y_tree.py -experiment_screenshot.py -experiment_screenshot_a11y_tree.py -experiment_screenshot_seeact.py -experiment_screenshot_som.py quick_evaluate.py diff --git a/evaluation_examples/examples/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652.json b/evaluation_examples/examples/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652.json index 7b7a0d5..c869428 100644 --- a/evaluation_examples/examples/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652.json +++ b/evaluation_examples/examples/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652.json @@ -38,7 +38,7 @@ } }, { - "type": "execute", + "type": "launch", "parameters": { "command": [ "nautilus", @@ -109,4 +109,4 @@ ] } } -} \ No newline at end of file +} diff --git a/main.py b/main.py index 93282ec..bdb2e6a 100644 --- a/main.py +++ b/main.py @@ -47,17 +47,16 @@ def human_agent(): Runs the Gym environment with human input. """ - with open("evaluation_examples/examples/multi_apps/4c26e3f3-3a14-4d86-b44a-d3cedebbb487.json", "r", encoding="utf-8") as f: + with open("evaluation_examples/examples/multi_apps/b5062e3e-641c-4e3a-907b-ac864d2e7652.json", "r", encoding="utf-8") as f: example = json.load(f) - example["snapshot"] = "exp_v5" + example["snapshot"] = "Snapshot 35" - env = DesktopEnv( - path_to_vm=r"C:\Users\tianbaox\Documents\Virtual Machines\Ubuntu3\Ubuntu3.vmx", - action_space="computer_13", - task_config=example - ) + env = DesktopEnv( path_to_vm=r"/mnt/data1/david/os-images/Ubuntu-1218/Ubuntu.vmx" + , snapshot_name="Snapshot 35" + , action_space="computer_13" + ) # reset the environment to certain snapshot - observation = env.reset() + observation = env.reset(task_config=example) done = False trajectory = [