Skip to content

Bad latency on CPU #876

Answered by felixdittrich92
tilman67 asked this question in Q&A
Mar 29, 2022 · 3 comments · 6 replies
Discussion options

You must be logged in to vote

8Hi @tilman67 👋

Can you try the following combination if it's work better for you ?
predictor = ocr_predictor(det_arch='db_mobilenet_v3_large', reco_arch='crnn_mobilenet_v3_small', pretrained=True, assume_straight_pages=True)

my cpu: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
first page: 0.84 sec
sec page: 0.81 sec

Otherwise you can also try the following suggestions from #814
Let me know if there are further questions 🤗

EDIT: tested with PyTorch / batch inference will also speed up the whole process (pass a list of images to .from_images([...]) / you can also play a bit with passing different batch sizes to the predictor maybe det_bs=4, rec_bs=256

EDIT2:

with following it takes ~2.8s…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@tilman67
Comment options

@tilman67
Comment options

Comment options

You must be logged in to vote
2 replies
@tilman67
Comment options

@frgfm
Comment options

Answer selected by tilman67
Comment options

You must be logged in to vote
2 replies
@assistechsol
Comment options

@felixdittrich92
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
module: models Related to doctr.models
4 participants