mirror of
https://gitlab.com/MisterBiggs/grad.git
synced 2025-06-15 22:36:39 +00:00
cut down processing time
This commit is contained in:
parent
3dc24c10a6
commit
4378aa80c7
4
grad.py
4
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user