Download Latest Version v0.12.0 source code.zip (4.0 MB)
Email in envelope

Get an email when there's a new version of DocTR

Home / v0.11.0
Name Modified Size InfoDownloads / Week
Parent folder
viptr_tiny-1cb2515e.pt 2025-06-19 13.2 MB
vip_tiny-033ed51c.pt 2025-04-12 13.2 MB
vip_base-f6ea2ff5.pt 2025-04-12 81.4 MB
README.md 2025-01-30 7.1 kB
v0.11.0 source code.tar.gz 2025-01-30 3.6 MB
v0.11.0 source code.zip 2025-01-30 3.9 MB
Totals: 6 Items   115.2 MB 0

Note: docTR 0.11.0 requires python >= 3.10 Note: docTR 0.11.0 requires either TensorFlow >= 2.15.0 or PyTorch >= 2.0.0

What's changed

New features

  • Added torch.compile support (PyTorch backend)
  • Improved model training logging
  • Created a small labeling tool designed for docTR (early stage) --> doctr-labeler

Compile your model

Compiling your PyTorch models with torch.compile optimizes the model by converting it to a graph representation and applying backends that can improve performance. This process can make inference faster and reduce memory overhead during execution.

Further information can be found in the PyTorch documentation

:::python
import torch
from doctr.models import (
    ocr_predictor,
    vitstr_small,
    fast_base,
    mobilenet_v3_small_crop_orientation,
    mobilenet_v3_small_page_orientation,
    crop_orientation_predictor,
    page_orientation_predictor
)

# Compile the models
detection_model = torch.compile(
    fast_base(pretrained=True).eval()
)
recognition_model = torch.compile(
    vitstr_small(pretrained=True).eval()
)
crop_orientation_model = torch.compile(
    mobilenet_v3_small_crop_orientation(pretrained=True).eval()
)
page_orientation_model = torch.compile(
    mobilenet_v3_small_page_orientation(pretrained=True).eval()
)

predictor = models.ocr_predictor(
    detection_model, recognition_model, assume_straight_pages=False
)
# NOTE: Only required for non-straight pages (`assume_straight_pages=False`) and non-disabled orientation classification
# Set the orientation predictors
predictor.crop_orientation_predictor = crop_orientation_predictor(crop_orientation_model)
predictor.page_orientation_predictor = page_orientation_predictor(page_orientation_model)

compiled_out = predictor(doc)

What's Changed

New Features

Bug Fixes

Improvements

Miscellaneous

New Contributors

Full Changelog: https://github.com/mindee/doctr/compare/v0.10.0...v0.11.0

Source: README.md, updated 2025-01-30