Skip to content

call predict function #175

Answered by arxyzan
kghezelbash asked this question in Q&A
Discussion options

You must be logged in to vote

@kghezelbash, If you want to pass in a numpy array image, you have to pass it inside a list:

from hezar.models import Model
# OCR with CRNN
model = Model.load("hezarai/crnn-fa-printed-96-long")
image = cv2.imread("/content/drive/MyDrive/id_data_ocr_section/06872c53fb2cbb613f0652e6f798995c9b73e62ffea593edb681860109571f81.jpeg")
texts = model.predict([image[780:870, 550:850]])
print(texts)

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by arxyzan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants