diff --git a/unstructured/metrics/object_detection.py b/unstructured/metrics/object_detection.py index 7c28721518..3c77f3c7c0 100644 --- a/unstructured/metrics/object_detection.py +++ b/unstructured/metrics/object_detection.py @@ -232,11 +232,8 @@ def _parse_page_dimensions(data: dict) -> tuple[list, list]: """ Process the page dimensions from the json file to the required format. """ - pages_height = [] - pages_width = [] - for page in data["pages"]: - pages_height.append(page["size"]["height"]) - pages_width.append(page["size"]["width"]) + pages_height = [page["size"]["height"] for page in data["pages"]] + pages_width = [page["size"]["width"] for page in data["pages"]] return pages_height, pages_width @staticmethod