From 43887e65a59fccf6c5668e1a4b1b103bb81fe642 Mon Sep 17 00:00:00 2001 From: qued <64741807+qued@users.noreply.github.com> Date: Wed, 29 Mar 2023 14:18:48 -0500 Subject: [PATCH] chore: remove tqdm output (#73) Removes progress bar output while processing pdfs and image elements. Co-authored-by: cragwolfe --- CHANGELOG.md | 4 ++++ unstructured_inference/__version__.py | 2 +- unstructured_inference/inference/layout.py | 12 +++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6e59d30..81fff82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.14 + +* Suppressed processing progress bars + ## 0.2.13 * Add table processing diff --git a/unstructured_inference/__version__.py b/unstructured_inference/__version__.py index 53cb2730..9f714b99 100644 --- a/unstructured_inference/__version__.py +++ b/unstructured_inference/__version__.py @@ -1 +1 @@ -__version__ = "0.2.13" # pragma: no cover +__version__ = "0.2.14" # pragma: no cover diff --git a/unstructured_inference/inference/layout.py b/unstructured_inference/inference/layout.py index 297c7cdf..36f484d0 100644 --- a/unstructured_inference/inference/layout.py +++ b/unstructured_inference/inference/layout.py @@ -2,7 +2,6 @@ import os import re import tempfile -from tqdm import tqdm from typing import List, Optional, Tuple, Union, BinaryIO import unicodedata @@ -157,13 +156,12 @@ def get_elements_from_layout(self, layout: List[TextRegion]) -> List[LayoutEleme # NOTE(robinson) - This orders the page from top to bottom. We'll need more # sophisticated ordering logic for more complicated layouts. layout.sort(key=lambda element: element.y1) - elements = [] - for e in tqdm(layout): - elements.append( - get_element_from_block( - e, self.image, self.layout, self.ocr_strategy, self.extract_tables - ) + elements = [ + get_element_from_block( + e, self.image, self.layout, self.ocr_strategy, self.extract_tables ) + for e in layout + ] return elements def _get_image_array(self) -> Union[np.ndarray, None]: