Model zoo#
docTR implements a range of published architectures for each task of the pipeline, all with pretrained weights. This section lists them with their benchmarks, so you can pick the right trade-off between speed and accuracy.
At a glance#
Task |
Architectures |
Default |
Use it with |
|---|---|---|---|
DBNet, LinkNet, FAST |
|
|
|
CRNN, SAR, MASTER, ViTSTR, PARSeq, VIPTR |
|
|
|
LW-DETR |
|
|
|
TableCenterNet |
|
|
|
MobileNetV3 |
|
|
End-to-end benchmarks compare detection + recognition pairs, including commercial OCR services.
How to choose#
The defaults, fast_base + crnn_vgg16_bn, are accurate on most documents and run fine on a CPU.
fast_tiny or db_mobilenet_v3_large with crnn_mobilenet_v3_small or viptr_tiny for CPUs, edge devices and
high-volume pipelines.
db_resnet50 or fast_base with parseq, vitstr_base or master, ideally on a GPU.
Benchmarks on public datasets are a starting point: the best way to choose is to compare a few combinations on a sample of your documents. If none is good enough, fine-tune a model on your data.
Orientation classifiers#
Two lightweight MobileNetV3 classifiers handle rotated documents. They are loaded automatically when needed.
Architecture |
Predicts |
Factory |
|---|---|---|
|
The orientation of a page: 0°, 90°, 180°, 270° |
|
|
The orientation of a word crop: 0°, 90°, 180°, 270° |
About the benchmarks#
Datasets: unless stated otherwise, models are evaluated on both the training and test sets of FUNSD and CORD (see Datasets). FUNSD has 199 pages (30,595 word crops), which might not be representative of every use case.
Metrics are described in Task evaluation.
Speed (
sec/it) is measured on an 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz CPU, after a warm-up of 100 tensors, as the average over 1,000 samples. The batch size is given in each table.Reproduce or extend them with the
evaluate.pyandlatency.pyscripts of the references.