From 344b712729d7346ff09b9ab03fec4bb3d0f808de Mon Sep 17 00:00:00 2001 From: Llloooggg Date: Fri, 10 Mar 2023 22:49:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0=20=D0=BC=D1=83=D1=81=D0=BE=D1=80=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=B1=D0=BE=D0=BA=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index df567c4..f422a46 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,8 @@ logging.basicConfig( save_result = True +pd.options.mode.use_inf_as_na = True + def save_highlighted_screenshot(screenshot, boxes, filename): new_image = screenshot.copy() @@ -103,7 +105,11 @@ def get_boxes(screenshot): if save_result: raw_boxes.to_excel("xlsx/0_raw_boxes.xlsx", index=False) - base_boxes = raw_boxes.loc[raw_boxes["text"].str.len() > 3] + base_boxes = raw_boxes.loc[ + (raw_boxes["conf"] > 30) + & (raw_boxes["text"].notnull()) + & (raw_boxes["text"].str.isalnum()) + ] if save_result: save_highlighted_screenshot(