OCR model made of using LAS's speller and image encoder.
from model import InferenceModel
model_path = './models/LAS_number_enclstm3_declstm3_3440.pt'
inference_model = InferenceModel(model_path)
import matplotlib.pyplot as plt
import cv2
img = cv2.imread(your_img_path)
s, _ = inference_model(img, is_bgr=True, use_beam=True)
print(s)
plt.imshow(img[...,::-1])
51.55
Listen-Attend-and-Spell-Pytorch
Chan, William, et al. “Listen, attend and spell.” arXiv preprint arXiv:1508.01211 (2015).APA