1
0
mirror of https://gitlab.com/MisterBiggs/grad.git synced 2025-06-16 06:46:39 +00:00

cut down processing time

This commit is contained in:
Anson Biggs 2020-05-23 19:08:52 +00:00
parent 3dc24c10a6
commit 4378aa80c7

View File

@ -17,7 +17,7 @@ l = 530
crop_coords = (l, t, r, b) crop_coords = (l, t, r, b)
frames_path = "../frames" frames_path = "../frames"
f_paths = glob.glob(frames_path + "/*jpg") f_paths = glob.glob(frames_path + "/*0.jpg")
print("Frames loaded:", len(f_paths)) print("Frames loaded:", len(f_paths))
# Make dataframe with frame number as index and frame_path as a column # 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 = f"C:/Coding/grad/frames2/{im_name}.jpg"
im = Image.open(im_path) im = Image.open(im_path)
im = im.crop(crop_coords) 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) df["text"] = df["frame_path"].swifter.apply(im_str)