From 4378aa80c7c49db4ee56a2b9ba0ef7b91de57b55 Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Sat, 23 May 2020 19:08:52 +0000 Subject: [PATCH] cut down processing time --- grad.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grad.py b/grad.py index f4655f3..bc42e2c 100644 --- a/grad.py +++ b/grad.py @@ -17,7 +17,7 @@ l = 530 crop_coords = (l, t, r, b) frames_path = "../frames" -f_paths = glob.glob(frames_path + "/*jpg") +f_paths = glob.glob(frames_path + "/*0.jpg") print("Frames loaded:", len(f_paths)) # Make dataframe with frame number as index and frame_path as a column @@ -34,7 +34,7 @@ def im_str(im_path): # im = f"C:/Coding/grad/frames2/{im_name}.jpg" im = Image.open(im_path) im = im.crop(crop_coords) - return pytesseract.image_to_string(im) + return pytesseract.image_to_string(im, config="--psm 7") df["text"] = df["frame_path"].swifter.apply(im_str)