From 83fbae3b0ecff1fd8aa333dff129a55faae07192 Mon Sep 17 00:00:00 2001 From: tsuky_chen <3107760494@qq.com> Date: Thu, 22 Feb 2024 16:25:35 +0800 Subject: [PATCH] fixed PPTC examples load --- desktop_env/evaluators/metrics/slides.py | 12 ++++++------ .../3161d64e-3120-47b4-aaad-6a764a92493b.json | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/desktop_env/evaluators/metrics/slides.py b/desktop_env/evaluators/metrics/slides.py index ef84f9a..9bbfb38 100644 --- a/desktop_env/evaluators/metrics/slides.py +++ b/desktop_env/evaluators/metrics/slides.py @@ -146,7 +146,7 @@ def compare_pptx_files(file1_path, file2_path, **options): examine_font_underline = options.get("examine_font_underline", True) examine_strike_through = options.get("examine_strike_through", True) examine_alignment = options.get("examine_alignment", True) - examine_title_bottom_position = options.get("examine_bottom_position", False) + examine_title_bottom_position = options.get("examine_title_bottom_position", False) examine_table_bottom_position = options.get("examine_table_bottom_position", False) examine_right_position = options.get("examine_right_position", False) examine_top_position = options.get("examine_top_position", False) @@ -188,26 +188,26 @@ def compare_pptx_files(file1_path, file2_path, **options): for shape1, shape2 in zip(slide1.shapes, slide2.shapes): if examine_title_bottom_position: if hasattr(shape1, "text") and hasattr(shape2, "text") and shape1.text == shape2.text: - if shape1.text == "Product Comparison" and shape1.top <= shape2.top: + if shape1.text == "Product Comparison" and (shape1.top <= shape2.top or shape1.top < 3600000): 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 examine_table_bottom_position: if slide_idx == 3 and shape1.shape_type == 19 and shape2.shape_type == 19: - if shape1.top <= shape2.top: + if shape1.top <= shape2.top or shape1.top < 3600000: 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 examine_right_position: if slide_idx == 2 and not hasattr(shape1, "text") and not hasattr(shape2, "text"): - if shape1.left <= shape2.left: + if shape1.left <= shape2.left or shape1.left < 4320000: return 0 if examine_top_position: - if shape1.top != shape2.top and not hasattr(shape1, "text") and not hasattr(shape2, "text"): - if shape1.top >= shape2.top: + if slide_idx == 2 and shape1.shape_type == 13 and shape2.shape_type == 13: + if shape1.top >= shape2.top or shape1.top > 1980000: return 0 elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height: return 0 diff --git a/evaluation_examples/examples/libreoffice_impress/3161d64e-3120-47b4-aaad-6a764a92493b.json b/evaluation_examples/examples/libreoffice_impress/3161d64e-3120-47b4-aaad-6a764a92493b.json index d2146a9..4a4ebe9 100644 --- a/evaluation_examples/examples/libreoffice_impress/3161d64e-3120-47b4-aaad-6a764a92493b.json +++ b/evaluation_examples/examples/libreoffice_impress/3161d64e-3120-47b4-aaad-6a764a92493b.json @@ -9,7 +9,7 @@ "parameters": { "files": [ { - "url": "https://drive.usercontent.google.com/download?id=1UtLhtBliwRqYauvNGXcEKFDw1BaSaD90&export=download&authuser=0&confirm=t&uuid=dec528e0-4278-401b-88b2-980e23d72253&at=APZUnTUKrfSQYtajt1NU46ljMXAJ:1708404863068", + "url": "https://drive.usercontent.google.com/download?id=1UtLhtBliwRqYauvNGXcEKFDw1BaSaD90&export=download&authuser=0&confirm=t&uuid=738d33e2-0fac-42c4-9e3b-d5806cc7106f&at=APZUnTX5D_liJdRoPqrXNB9Qrrcu:1708586209947", "path": "/home/user/Desktop/45_1.pptx" } ] @@ -61,7 +61,7 @@ "func": "compare_pptx_files", "expected": { "type": "cloud_file", - "path": "https://drive.usercontent.google.com/download?id=10T5lxEsBUZ9onRZtXSPEyZWlWoXHICdE&export=download&authuser=0&confirm=t&uuid=d62506a0-c906-4902-ae88-82b97d37e6f4&at=APZUnTWG8DSSA_xSm0C4PKCbGWUT:1708405198113", + "path": "https://drive.usercontent.google.com/download?id=10T5lxEsBUZ9onRZtXSPEyZWlWoXHICdE&export=download&authuser=0&confirm=t&uuid=beb793fd-866c-4b81-8b39-5f8bf7980b6b&at=APZUnTV1fn3nnttcIJe1Emd4WyBU:1708586437242", "dest": "45_1_Gold.pptx" }, "result": {