Skip to content

parseq: 'torch.Size' object has no attribute 'rank' #1354

Answered by felixT2K
temiwale88 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @temiwale88 👋🏼 ,

If you only want to predict already cropped images you can do the following:

from doctr.models import recognition_predictor
from doctr.io import DocumentFile

doc = DocumentFile.from_images(['/home/felix/Desktop/text1.png', '/home/felix/Desktop/text2.png'])
reco_predictor = recognition_predictor("parseq", pretrained=True, batch_size=128)

res = reco_predictor(doc)
print(res)

For example:


Output:
[('Text', 0.9996758699417114), ('Data', 0.9975508451461792)]

I see you have installed both backends (TF and PT - this is not recommended for any prod system only for develop and testing)
You can switch between by doing:
torch: USE_TORCH=1 python3 /path/to/your/script.py
tens…

Replies: 2 comments 4 replies

Comment options

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

You must be logged in to vote
4 replies
@temiwale88
Comment options

@temiwale88
Comment options

@felixT2K
Comment options

@temiwale88
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #1352 on October 17, 2023 08:39.