From 396cfcf8fa48c72a63f5e3fdc9b7222562ee05d2 Mon Sep 17 00:00:00 2001 From: tsuky_chen <3107760494@qq.com> Date: Sat, 17 Feb 2024 01:01:29 +0800 Subject: [PATCH] update PPTC examples into impress --- desktop_env/evaluators/metrics/slides.py | 68 ++++++++++++-- .../08aced46-45a2-48d7-993b-ed3fb5b32302.json | 11 +-- .../15aece23-a215-4579-91b4-69eec72e18da.json | 10 +-- ...2b94c692-6abb-48ae-ab0b-b3e8a19cb340.json} | 25 +++--- .../73c99fb9-f828-43ce-b87a-01dc07faa224.json | 12 +-- .../7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8.json | 74 ++++++++++++++++ .../841b50aa-df53-47bd-a73a-22d3a9f73160.json | 74 ++++++++++++++++ .../8979838c-54a5-4454-a2b8-3d135a1a5c8f.json | 74 ++++++++++++++++ .../986fc832-6af2-417c-8845-9272b3a1528b.json | 13 +-- .../9cf05d24-6bd9-4dae-8967-f67d88f5d38a.json | 74 ++++++++++++++++ .../a434992a-89df-4577-925c-0c58b747f0f4.json | 74 ++++++++++++++++ .../b8adbc24-cef2-4b15-99d5-ecbe7ff445eb.json | 74 ++++++++++++++++ .../c82632a4-56b6-4db4-9dd1-3820ee3388e4.json | 88 +++++++++++++++++++ .../edb61b14-a854-4bf5-a075-c8075c11293a.json | 11 +-- 14 files changed, 621 insertions(+), 61 deletions(-) rename evaluation_examples/examples/libreoffice_impress/{648de793-7368-4fb7-b16f-a15362da8003.json => 2b94c692-6abb-48ae-ab0b-b3e8a19cb340.json} (62%) create mode 100644 evaluation_examples/examples/libreoffice_impress/7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8.json create mode 100644 evaluation_examples/examples/libreoffice_impress/841b50aa-df53-47bd-a73a-22d3a9f73160.json create mode 100644 evaluation_examples/examples/libreoffice_impress/8979838c-54a5-4454-a2b8-3d135a1a5c8f.json create mode 100644 evaluation_examples/examples/libreoffice_impress/9cf05d24-6bd9-4dae-8967-f67d88f5d38a.json create mode 100644 evaluation_examples/examples/libreoffice_impress/a434992a-89df-4577-925c-0c58b747f0f4.json create mode 100644 evaluation_examples/examples/libreoffice_impress/b8adbc24-cef2-4b15-99d5-ecbe7ff445eb.json create mode 100644 evaluation_examples/examples/libreoffice_impress/c82632a4-56b6-4db4-9dd1-3820ee3388e4.json diff --git a/desktop_env/evaluators/metrics/slides.py b/desktop_env/evaluators/metrics/slides.py index 33bf2ce..4cccf50 100644 --- a/desktop_env/evaluators/metrics/slides.py +++ b/desktop_env/evaluators/metrics/slides.py @@ -149,63 +149,120 @@ def compare_pptx_files(file1_path, file2_path, **options): examine_strike_through = options.get("examine_strike_through", True) examine_alignment = options.get("examine_alignment", True) examine_bottom_position = options.get("examine_bottom_position", False) + examine_right_position = options.get("examine_right_position", False) + examine_image_size = options.get("examine_image_size", True) examine_bullets = options.get("examine_bullets", True) + examine_background_color = options.get("examine_background_color", True) + examine_note = options.get("examine_note", True) # compare the number of slides if len(prs1.slides) != len(prs2.slides) and examine_number_of_slides: + print("0") return 0 # compare the content of each slide for slide1, slide2 in zip(prs1.slides, prs2.slides): + def get_slide_background_color(slide): + background = slide.background + if background.fill.background(): + return background.fill.fore_color.rgb + else: + return None + + if get_slide_background_color(slide1) != get_slide_background_color(slide2) and examine_background_color: + print("background color not the same") + return 0 + + def get_slide_notes(slide): + notes_slide = slide.notes_slide + if notes_slide: + return notes_slide.notes_text_frame.text + else: + return None + + if get_slide_notes(slide1) != get_slide_notes(slide2) and examine_note: + print("notes not the same") + return 0 # check if the shapes are the same for shape1, shape2 in zip(slide1.shapes, slide2.shapes): if examine_bottom_position and shape1.top != shape2.top: if hasattr(shape1, "text") and hasattr(shape2, "text") and shape1.text == shape2.text and shape1.text == "Product Comparison": if shape1.top >= shape2.top: return 0 + + if examine_right_position and shape1.left != shape2.left: + if not hasattr(shape1, "text") and not hasattr(shape2, "text"): + if shape1.left >= shape2.left: + return 0 if (shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height) and examine_shape: + print("1") return 0 + + if examine_image_size: + if shape1.shape_type == 13 and shape2.shape_type == 13: + if shape1.width != shape2.width or shape1.height != shape2.height: + return 0 + elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height: + return 0 if hasattr(shape1, "text") and hasattr(shape2, "text"): if shape1.text != shape2.text and examine_text: + print("2") return 0 # check if the paragraphs are the same for para1, para2 in zip(shape1.text_frame.paragraphs, shape2.text_frame.paragraphs): if para1.alignment != para2.alignment and examine_alignment: + print(para1.alignment) + print(para2.alignment) + print("3") return 0 + # check if the runs are the same if para1.text != para2.text and examine_text: + print("4") return 0 if para1.level != para2.level and examine_indent: + print("5") return 0 for run1, run2 in zip(para1.runs, para2.runs): # check if the font properties are the same + print(run1.font.name) + print(run2.font.name) if run1.font.name != run2.font.name and examine_font_name: + print("6") return 0 if run1.font.size != run2.font.size and examine_font_size: + print("7") + print(run1.font.size) + print(run2.font.size) return 0 if run1.font.bold != run2.font.bold and examine_font_bold: + print("8") return 0 if run1.font.italic != run2.font.italic and examine_font_italic: + print("9") return 0 if hasattr(run1.font.color, "rgb") and hasattr(run2.font.color, "rgb"): if run1.font.color.rgb != run2.font.color.rgb and examine_color_rgb: + print("10") return 0 if run1.font.underline != run2.font.underline and examine_font_underline: + print("11") return 0 if run1.font._element.attrib.get('strike', 'noStrike') != run2.font._element.attrib.get( 'strike', 'noStrike') and examine_strike_through: + print("12") return 0 def _extract_bullets(xml_data): @@ -237,9 +294,10 @@ def compare_pptx_files(file1_path, file2_path, **options): return bullets - if _extract_bullets(run1.part.blob.decode('utf-8')) != _extract_bullets( - run2.part.blob.decode('utf-8')) and examine_bullets: - return 0 + if examine_bullets and _extract_bullets(run1.part.blob.decode('utf-8')) != _extract_bullets(run2.part.blob.decode('utf-8')): + return 0 + + # fixme: Actually there are more properties to be compared, we can add them later via parsing the xml data @@ -464,6 +522,6 @@ if __name__ == '__main__': # print(evaluate_presentation_fill_to_rgb_distance(r"C:\Users\tianbaox\Desktop\DesktopEnv\cache\3b27600c-3668-4abd-8f84-7bcdebbccbdb\lec17-gui-events.pptx", {"rgb": (0, 0, 255)})) # print(check_auto_saving_time(r"C:\Users\tianbaox\Desktop\DesktopEnv\cache\2cd43775-7085-45d8-89fa-9e35c0a915cf\registrymodifications.xcu", {"minutes": 3})) print(compare_pptx_files( - r"C:\Users\tianbaox\Desktop\DesktopEnv\cache\a669ef01-ded5-4099-9ea9-25e99b569840\Writing-Outlines.pptx", - r"C:\Users\tianbaox\Desktop\DesktopEnv\cache\a669ef01-ded5-4099-9ea9-25e99b569840\Writing-Outlines_Gold.pptx", + r"D:\NJU\HKUNLP\Desktop-Env\DesktopEnv\cache\08aced46-45a2-48d7-993b-ed3fb5b32302\22_6_Gold.pptx", + r"D:\NJU\HKUNLP\Desktop-Env\DesktopEnv\cache\08aced46-45a2-48d7-993b-ed3fb5b32302\22_6.pptx", examine_shape=False)) diff --git a/evaluation_examples/examples/libreoffice_impress/08aced46-45a2-48d7-993b-ed3fb5b32302.json b/evaluation_examples/examples/libreoffice_impress/08aced46-45a2-48d7-993b-ed3fb5b32302.json index a3696be..55b3db5 100644 --- a/evaluation_examples/examples/libreoffice_impress/08aced46-45a2-48d7-993b-ed3fb5b32302.json +++ b/evaluation_examples/examples/libreoffice_impress/08aced46-45a2-48d7-993b-ed3fb5b32302.json @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=15OOk9xJzM4WBJRy5rDT2iMrEmm7b-VXj&export=download&authuser=0&confirm=t&uuid=501abcf6-9d70-4ef7-b1ed-0c6e0a47ae7c&at=APZUnTUn3aTxAlhaMSjmljHvPfrr:1707741990590", + "url": "https://drive.usercontent.google.com/download?id=15OOk9xJzM4WBJRy5rDT2iMrEmm7b-VXj&export=download&authuser=0&confirm=t&uuid=cbf760e1-5873-48d9-8ccb-7262fe503b02&at=APZUnTXEXnk5QAt0NnwVquomeHvk:1708009014973", "path": "/home/user/Desktop/22_6.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1lIdDVe95j3Hpscn9eXEuaawhSL2QmhEl&export=download&authuser=0&confirm=t&uuid=63a092e2-a4c1-458d-9904-b288f5f8422b&at=APZUnTXEYGXubO9J-0Ybvi5TXOfb:1707741962330", + "path": "https://drive.usercontent.google.com/download?id=1lIdDVe95j3Hpscn9eXEuaawhSL2QmhEl&export=download&authuser=0&confirm=t&uuid=63138b31-03cf-4c8b-b8d2-ed82390f2cbe&at=APZUnTVDjl7XaiMgLOHbXrwJdSLr:1708008981789", "dest": "22_6_Gold.pptx" }, "result": { @@ -69,11 +69,6 @@ "path": "/home/user/Desktop/22_6.pptx", "dest": "22_6.pptx" }, - "options": { - "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_font_name": false - } + "options": {} } } \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/15aece23-a215-4579-91b4-69eec72e18da.json b/evaluation_examples/examples/libreoffice_impress/15aece23-a215-4579-91b4-69eec72e18da.json index bbb1a7f..26794ad 100644 --- a/evaluation_examples/examples/libreoffice_impress/15aece23-a215-4579-91b4-69eec72e18da.json +++ b/evaluation_examples/examples/libreoffice_impress/15aece23-a215-4579-91b4-69eec72e18da.json @@ -1,7 +1,7 @@ { "id": "15aece23-a215-4579-91b4-69eec72e18da", "snapshot": "libreoffice_impress", - "instruction": "Move the title to the bottom of the slide. ## 1, title, slide, bottom corner", + "instruction": "Move the title of page 2 to the bottom of the slide. ## 1, title, slide, bottom corner", "source": "https://arxiv.org/pdf/2311.01767.pdf", "config": [ { @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1SCyQzGU05PF-BPrXJ7GsFrnyuRcKcbBb&export=download&authuser=0&confirm=t&uuid=a3b90508-2288-48a4-95d5-c8e7bc11d5fd&at=APZUnTUt44ntxFBUaL3I6oqRhfjy:1707917097401", + "url": "https://drive.usercontent.google.com/download?id=1SCyQzGU05PF-BPrXJ7GsFrnyuRcKcbBb&export=download&authuser=0&confirm=t&uuid=b262eb3d-8a6a-426a-9231-f2fdcb3dadb2&at=APZUnTUy2SF0P2gedWRO7mjg53lg:1708014405042", "path": "/home/user/Desktop/134_2.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1OqpF8JpJjaXwHvDANB0E7nJR2m4ssXJO&export=download&authuser=0&confirm=t&uuid=d9eb02df-4b20-4f54-afe1-53437820946a&at=APZUnTUiporlBynLvGUB1-zDS9xm:1707916188451", + "path": "https://drive.usercontent.google.com/download?id=1OqpF8JpJjaXwHvDANB0E7nJR2m4ssXJO&export=download&authuser=0&confirm=t&uuid=91530d73-85f4-4090-a3b2-f581b2c765f4&at=APZUnTX0IIVQXAH2VF3LKhmAelhe:1708016425815", "dest": "134_2_Gold.pptx" }, "result": { @@ -71,10 +71,6 @@ }, "options": { "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_font_name": false, - "examine_alignment": false, "examine_bottom_position": true } } diff --git a/evaluation_examples/examples/libreoffice_impress/648de793-7368-4fb7-b16f-a15362da8003.json b/evaluation_examples/examples/libreoffice_impress/2b94c692-6abb-48ae-ab0b-b3e8a19cb340.json similarity index 62% rename from evaluation_examples/examples/libreoffice_impress/648de793-7368-4fb7-b16f-a15362da8003.json rename to evaluation_examples/examples/libreoffice_impress/2b94c692-6abb-48ae-ab0b-b3e8a19cb340.json index 12583c8..2303039 100644 --- a/evaluation_examples/examples/libreoffice_impress/648de793-7368-4fb7-b16f-a15362da8003.json +++ b/evaluation_examples/examples/libreoffice_impress/2b94c692-6abb-48ae-ab0b-b3e8a19cb340.json @@ -1,7 +1,7 @@ { - "id": "648de793-7368-4fb7-b16f-a15362da8003", + "id": "2b94c692-6abb-48ae-ab0b-b3e8a19cb340", "snapshot": "libreoffice_impress", - "instruction": "In the slide, uh, add a right arrow in the left side", + "instruction": "Move the image to the right side of the content. ## 1, picture, slide, right.", "source": "https://arxiv.org/pdf/2311.01767.pdf", "config": [ { @@ -9,8 +9,8 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1kOQ_PlYlGOKhdm-etxB2D8VvLaA4mqNT&export=download&authuser=0&confirm=t&uuid=9be6111e-53cf-4724-bcef-2ae4e819003b&at=APZUnTXZJ2KPlfmSL9R4ZBU0jAPs:1707932348450", - "path": "/home/user/Desktop/19_0.pptx" + "url": "https://drive.usercontent.google.com/download?id=12aCqNNrfKk2j5lvMPdOdTfazV2KqOYIy&export=download&authuser=0&confirm=t&uuid=90b206a5-115a-4b7b-9bbd-1ef861d1490b&at=APZUnTWGobax6Yra9Q39YTbk4xil:1708086175634", + "path": "/home/user/Desktop/201_6.pptx" } ] } @@ -18,7 +18,7 @@ { "type": "open", "parameters": { - "path": "/home/user/Desktop/19_0.pptx" + "path": "/home/user/Desktop/201_6.pptx" } } ], @@ -31,7 +31,7 @@ { "type": "activate_window", "parameters": { - "window_name": "19_0.pptx - LibreOffice Impress", + "window_name": "201_6.pptx - LibreOffice Impress", "strict": true } }, @@ -61,20 +61,17 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=180atkxCNr-fZrT9YTKV_8qyhpMFqpEUq&export=download&authuser=0&confirm=t&uuid=e5ee127a-93a1-4069-b058-86a714de64ff&at=APZUnTVUuP0snmxIvS92-t4ObLf9:1707932394767", - "dest": "19_0_Gold.pptx" + "path": "https://drive.usercontent.google.com/download?id=1CYIVKkr8l5z-CdoOJbhZYO8iXiyzgPUx&export=download&authuser=0&confirm=t&uuid=c0303f97-7d62-4fd2-bb9d-f7a1d7951bbe&at=APZUnTUhUOkJlRqnLkDPHSLyKVw9:1708086278070", + "dest": "201_6_Gold.pptx" }, "result": { "type": "vm_file", - "path": "/home/user/Desktop/19_0.pptx", - "dest": "19_0.pptx" + "path": "/home/user/Desktop/201_6.pptx", + "dest": "201_6.pptx" }, "options": { "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_font_name": false, - "examine_alignment": false + "examine_right_position": true } } } \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/73c99fb9-f828-43ce-b87a-01dc07faa224.json b/evaluation_examples/examples/libreoffice_impress/73c99fb9-f828-43ce-b87a-01dc07faa224.json index cb25842..1e4045a 100644 --- a/evaluation_examples/examples/libreoffice_impress/73c99fb9-f828-43ce-b87a-01dc07faa224.json +++ b/evaluation_examples/examples/libreoffice_impress/73c99fb9-f828-43ce-b87a-01dc07faa224.json @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1KDDJCei7KE1yRWGNUSmUnFnpZBH2gDeE&export=download&authuser=0&confirm=t&uuid=f85aa168-2476-46ab-9ee1-4bb373904650&at=APZUnTVvlubece5OCv6g-ULVovsQ:1707912989623", + "url": "https://drive.usercontent.google.com/download?id=1KDDJCei7KE1yRWGNUSmUnFnpZBH2gDeE&export=download&authuser=0&confirm=t&uuid=70784929-7fbc-40a5-b6a5-15130ed93a91&at=APZUnTXcWW35lNX5V498GJuvH0--:1708012511491", "path": "/home/user/Desktop/109_4.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1w6DoJnhq8SDJQ76iDB_L2r7mGZNtVFIO&export=download&authuser=0&confirm=t&uuid=1d12f276-0b9c-4f8b-84fa-71d4ae011224&at=APZUnTUJOXjccK3edFKFEyoU6VRA:1707913047283", + "path": "https://drive.usercontent.google.com/download?id=1w6DoJnhq8SDJQ76iDB_L2r7mGZNtVFIO&export=download&authuser=0&confirm=t&uuid=234c5f36-52d2-4daa-818c-a7aeec25108b&at=APZUnTVQ2hz_ww5TYk7VYIImaYx0:1708012614823", "dest": "109_4_Gold.pptx" }, "result": { @@ -69,12 +69,6 @@ "path": "/home/user/Desktop/109_4.pptx", "dest": "109_4.pptx" }, - "options": { - "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_font_name": false, - "examine_alignment": false - } + "options": {} } } \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8.json b/evaluation_examples/examples/libreoffice_impress/7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8.json new file mode 100644 index 0000000..81eb0f3 --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8.json @@ -0,0 +1,74 @@ +{ + "id": "7dbc52a6-11e0-4c9a-a2cb-1e36cfda80d8", + "snapshot": "libreoffice_impress", + "instruction": "Add a note same to the title into the slide. Make the font of title bold.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1xyqPQ_3pJD163G-n37gVDbp_cTu2vBU1&export=download&authuser=0&confirm=t&uuid=e0e1d416-c7f6-4a85-b4d8-3207fedf297b&at=APZUnTVkezrVzK2OHPolG9JYV3i9:1708082150132", + "path": "/home/user/Desktop/164_3.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/164_3.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "164_3.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1Z5a2pvvPxCdukaXSOVH7TrLmsC4J0X_K&export=download&authuser=0&confirm=t&uuid=f0d7605a-5141-4cec-a5e1-2d28c19d69bf&at=APZUnTW_MtW6BHqSauQd_q-5BQ96:1708082286164", + "dest": "164_3_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/164_3.pptx", + "dest": "164_3.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/841b50aa-df53-47bd-a73a-22d3a9f73160.json b/evaluation_examples/examples/libreoffice_impress/841b50aa-df53-47bd-a73a-22d3a9f73160.json new file mode 100644 index 0000000..f5bcfa4 --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/841b50aa-df53-47bd-a73a-22d3a9f73160.json @@ -0,0 +1,74 @@ +{ + "id": "841b50aa-df53-47bd-a73a-22d3a9f73160", + "snapshot": "libreoffice_impress", + "instruction": "Add a note \"APP\" into the slide and give the slide a purple background color.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1mIUNIo2O3kZe1acuHxwVvfFzbS9YGBgn&export=download&authuser=0&confirm=t&uuid=0cb769d3-b5c6-43dc-8acb-9f9ddf61973e&at=APZUnTUvX5HsD9TEmEPRlAyHM5DS:1708064281151", + "path": "/home/user/Desktop/181_2.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/181_2.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "181_2.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1w8K8Wv7AT2QEjy30y6EE9aESGNIQl5AT&export=download&authuser=0&confirm=t&uuid=7db1ff83-4382-4c71-b6e0-68b1b25e7e1c&at=APZUnTV62nU1q7UbcAOoSSgvb0hk:1708064255366", + "dest": "181_2_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/181_2.pptx", + "dest": "181_2.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/8979838c-54a5-4454-a2b8-3d135a1a5c8f.json b/evaluation_examples/examples/libreoffice_impress/8979838c-54a5-4454-a2b8-3d135a1a5c8f.json new file mode 100644 index 0000000..f4f355b --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/8979838c-54a5-4454-a2b8-3d135a1a5c8f.json @@ -0,0 +1,74 @@ +{ + "id": "8979838c-54a5-4454-a2b8-3d135a1a5c8f", + "snapshot": "libreoffice_impress", + "instruction": "Give the slide a purple background color. Add the title to note.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1AjH-49ptLddl6C_ousVtrqn2S4JTwrCV&export=download&authuser=0&confirm=t&uuid=df793a2c-71dc-4fe0-ad02-11a17fed8fdc&at=APZUnTVhQD14-E2NdPhq372jD85R:1708063430974", + "path": "/home/user/Desktop/186_3.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/186_3.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "186_3.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1tCdMVZGl-cXHuc4qBxCRb9_T86H8m_3Y&export=download&authuser=0&confirm=t&uuid=eb96a446-c7b4-4281-a121-4632170933ab&at=APZUnTVAdHrJ0xNgWB0XNmk1r4fg:1708063575181", + "dest": "186_3_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/186_3.pptx", + "dest": "186_3.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/986fc832-6af2-417c-8845-9272b3a1528b.json b/evaluation_examples/examples/libreoffice_impress/986fc832-6af2-417c-8845-9272b3a1528b.json index cc1e97c..ca08581 100644 --- a/evaluation_examples/examples/libreoffice_impress/986fc832-6af2-417c-8845-9272b3a1528b.json +++ b/evaluation_examples/examples/libreoffice_impress/986fc832-6af2-417c-8845-9272b3a1528b.json @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1WgEV25hWlzvOXIImI1ZaDZO1yKC72Qay&export=download&authuser=0&confirm=t&uuid=e94d9f07-feeb-4b7b-82f7-30a90bb15983&at=APZUnTUw8ObGQCHaMY5AZdIMvA-k:1707919959393", + "url": "https://drive.usercontent.google.com/download?id=1WgEV25hWlzvOXIImI1ZaDZO1yKC72Qay&export=download&authuser=0&confirm=t&uuid=4d971046-218c-4ef8-9c8c-3891d00dd5d0&at=APZUnTWD8CAKk--xJSU7aCAnrcio:1708018843916", "path": "/home/user/Desktop/154_3.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1trYqwEuj2ruF830UGUHF1M3I1at4nW11&export=download&authuser=0&confirm=t&uuid=1d215b22-0d02-46a8-9c4e-64f0c8ce0d0d&at=APZUnTUaJxIF7EgFitSO1Dppy1LT:1707919967130", + "path": "https://drive.usercontent.google.com/download?id=1trYqwEuj2ruF830UGUHF1M3I1at4nW11&export=download&authuser=0&confirm=t&uuid=54101c43-17b8-404f-8e77-27794f50c70f&at=APZUnTVWQkCgdUmXZ-_PkiIuxdTR:1708019097123", "dest": "154_3_Gold.pptx" }, "result": { @@ -69,13 +69,6 @@ "path": "/home/user/Desktop/154_3.pptx", "dest": "154_3.pptx" }, - "options": { - "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_font_name": false, - "examine_alignment": false, - "examine_bottom_position": true - } + "options": {} } } \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/9cf05d24-6bd9-4dae-8967-f67d88f5d38a.json b/evaluation_examples/examples/libreoffice_impress/9cf05d24-6bd9-4dae-8967-f67d88f5d38a.json new file mode 100644 index 0000000..6fd6f2e --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/9cf05d24-6bd9-4dae-8967-f67d88f5d38a.json @@ -0,0 +1,74 @@ +{ + "id": "9cf05d24-6bd9-4dae-8967-f67d88f5d38a", + "snapshot": "libreoffice_impress", + "instruction": "Move to slide 1 and give it a green background color.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1z6dnLvOU-dvcygjd2w0pkpvKSSD1wQIb&export=download&authuser=0&confirm=t&uuid=d2410306-3b42-4727-89e4-622703cedfef&at=APZUnTXZeKIlIi0NAsvxsw_VIlLN:1708085675780", + "path": "/home/user/Desktop/214_9.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/214_9.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "214_9.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1esPimH6ECznuVn1mCsi6ykAGF9r0G3-R&export=download&authuser=0&confirm=t&uuid=ab8a6b9d-e6a3-4aa0-8d52-1c440bdd67df&at=APZUnTX6fqEXAYEOBRgPpnb7x_TJ:1708085642844", + "dest": "214_9_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/214_9.pptx", + "dest": "214_9.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/a434992a-89df-4577-925c-0c58b747f0f4.json b/evaluation_examples/examples/libreoffice_impress/a434992a-89df-4577-925c-0c58b747f0f4.json new file mode 100644 index 0000000..372331c --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/a434992a-89df-4577-925c-0c58b747f0f4.json @@ -0,0 +1,74 @@ +{ + "id": "a434992a-89df-4577-925c-0c58b747f0f4", + "snapshot": "libreoffice_impress", + "instruction": "Change the font size of the content to 12, and change the font color to orange. Change the slide's background to red.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1wgqcqlJVpRjZJNetmM5k3J3J-we8o29N&export=download&authuser=0&confirm=t&uuid=805143ab-1ea8-452b-a258-d9bd12b66af4&at=APZUnTUkVNjNUb64VDOzPORZ7B0C:1708064662541", + "path": "/home/user/Desktop/16_2.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/16_2.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "16_2.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1PP6NzBOTGwOUqkCNi8OayzD0art1_YjO&export=download&authuser=0&confirm=t&uuid=7c6a65a0-9fcb-40d1-ab19-93465bbd0d40&at=APZUnTW-p6JUQuEVkqlrJEJk7paf:1708064850977", + "dest": "16_2_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/16_2.pptx", + "dest": "16_2.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/b8adbc24-cef2-4b15-99d5-ecbe7ff445eb.json b/evaluation_examples/examples/libreoffice_impress/b8adbc24-cef2-4b15-99d5-ecbe7ff445eb.json new file mode 100644 index 0000000..b3f980e --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/b8adbc24-cef2-4b15-99d5-ecbe7ff445eb.json @@ -0,0 +1,74 @@ +{ + "id": "b8adbc24-cef2-4b15-99d5-ecbe7ff445eb", + "snapshot": "libreoffice_impress", + "instruction": "Create one more slide and name its title as \"Online Shopping\", same color with previous title.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1rb1PEgj8V5fGnzUKyfsDWZ33tKKnUjS6&export=download&authuser=0&confirm=t&uuid=f11c3617-5da6-4982-9574-b8114cfa5d13&at=APZUnTXhONV_FEHX8pWa7a6MfRYe:1708082800704", + "path": "/home/user/Desktop/189_4.pptx" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/189_4.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "189_4.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1gCOS9sGrHuYvC1fv0a4KcaiDD-3K88jC&export=download&authuser=0&confirm=t&uuid=d216b6e2-bb4a-4df1-99e6-6b49df762652&at=APZUnTU-kbVwlseW88kf-X6QZ3kc:1708082937225", + "dest": "189_4_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/189_4.pptx", + "dest": "189_4.pptx" + }, + "options": {} + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/c82632a4-56b6-4db4-9dd1-3820ee3388e4.json b/evaluation_examples/examples/libreoffice_impress/c82632a4-56b6-4db4-9dd1-3820ee3388e4.json new file mode 100644 index 0000000..01652f8 --- /dev/null +++ b/evaluation_examples/examples/libreoffice_impress/c82632a4-56b6-4db4-9dd1-3820ee3388e4.json @@ -0,0 +1,88 @@ +{ + "id": "c82632a4-56b6-4db4-9dd1-3820ee3388e4", + "snapshot": "libreoffice_impress", + "instruction": "Add an image \"none.png\" on the Desktop to slide 2 with 1*1 size.", + "source": "https://arxiv.org/pdf/2311.01767.pdf", + "config": [ + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1TDEznV_jXtRepAJYR6jyrQMHRmifceDR&export=download&authuser=0&confirm=t&uuid=0cfdeb47-97ee-489d-b3c9-7de5d87a475a&at=APZUnTWxCjGwQ2GdoyAgdePUK-oj:1708089522964", + "path": "/home/user/Desktop/31_2.pptx" + } + ] + } + }, + { + "type": "download", + "parameters": { + "files": [ + { + "url": "https://drive.usercontent.google.com/download?id=1MiqtN8kI1Z6DXAHV-6D3mkCst7pO5aaW&export=download&authuser=0&confirm=t&uuid=d4ad6bff-1788-4303-90a0-8765721c3972&at=APZUnTVa4AfsGROja7dHV5G9egqr:1708089896099", + "path": "/home/user/Desktop/none.png" + } + ] + } + }, + { + "type": "open", + "parameters": { + "path": "/home/user/Desktop/31_2.pptx" + } + } + ], + "trajectory": "trajectories/", + "related_apps": [ + "libreoffice_impress" + ], + "evaluator": { + "postconfig": [ + { + "type": "activate_window", + "parameters": { + "window_name": "31_2.pptx - LibreOffice Impress", + "strict": true + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + }, + { + "type": "execute", + "parameters": { + "command": [ + "python", + "-c", + "import pyautogui; import time; pyautogui.hotkey('ctrl', 's'); time.sleep(0.5);pyautogui.press('down');time.sleep(0.5);pyautogui.press('enter');time.sleep(0.5);" + ] + } + }, + { + "type": "sleep", + "parameters": { + "seconds": 0.5 + } + } + ], + "func": "compare_pptx_files", + "expected": { + "type": "cloud_file", + "path": "https://drive.usercontent.google.com/download?id=1yMulvG6Mc0Ze3W4WweXKHGtw1qBtA4N0&export=download&authuser=0&confirm=t&uuid=85461acd-2d84-45dc-a2ca-0b937e0c28af&at=APZUnTVvM1yMPvjXgxN3e8Zrywly:1708090126056", + "dest": "31_2_Gold.pptx" + }, + "result": { + "type": "vm_file", + "path": "/home/user/Desktop/31_2.pptx", + "dest": "31_2.pptx" + }, + "options": { + "examine_shape": false, + "examine_image_size": true + } + } +} \ No newline at end of file diff --git a/evaluation_examples/examples/libreoffice_impress/edb61b14-a854-4bf5-a075-c8075c11293a.json b/evaluation_examples/examples/libreoffice_impress/edb61b14-a854-4bf5-a075-c8075c11293a.json index 685e13f..b1bba1d 100644 --- a/evaluation_examples/examples/libreoffice_impress/edb61b14-a854-4bf5-a075-c8075c11293a.json +++ b/evaluation_examples/examples/libreoffice_impress/edb61b14-a854-4bf5-a075-c8075c11293a.json @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1SvG7uqJ4nd-YimLiQK1XsrI65iCxOMOw&export=download&authuser=0&confirm=t&uuid=20e98914-c490-4bb6-8a37-1c839e2226fe&at=APZUnTU-4RRKoHat4k60maslvMSZ:1707901107881", + "url": "https://drive.usercontent.google.com/download?id=1SvG7uqJ4nd-YimLiQK1XsrI65iCxOMOw&export=download&authuser=0&confirm=t&uuid=2af34bc4-dedf-4903-a660-fe9d3805a41d&at=APZUnTVFvtG-2fsIH9ExdgnggXwJ:1708011229753", "path": "/home/user/Desktop/24_8.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=1a7sXQrGQBlPntn64owyl8KWE8eLUXJMv&export=download&authuser=0&confirm=t&uuid=cc02c1a4-7613-484e-9d13-478f57a795a0&at=APZUnTV_gcXjdY6Jz9AAWK-W55l6:1707900948910", + "path": "https://drive.usercontent.google.com/download?id=1a7sXQrGQBlPntn64owyl8KWE8eLUXJMv&export=download&authuser=0&confirm=t&uuid=502d36c6-9386-49d1-b683-600d581a1342&at=APZUnTWJnox1N1RvdLYOVO81JNuj:1708011803101", "dest": "24_8_Gold.pptx" }, "result": { @@ -69,11 +69,6 @@ "path": "/home/user/Desktop/24_8.pptx", "dest": "24_8.pptx" }, - "options": { - "examine_shape": false, - "examine_font_size": false, - "examine_font_bold": false, - "examine_alignment": false - } + "options": {} } } \ No newline at end of file