docTR(Document Text Recognition)——一个由 深度学习 驱动的、无缝、高性能且易于使用的 OCR 相关任务库。持续开发和维护
docTR(Document Text Recognition)——一个由 深度学习 驱动的、无缝、高性能且易于使用的 OCR 相关任务库。持续开发和维护
由 PyTorch 驱动,让光学字符识别变得无缝且人人可用
docTR 最初由 Mindee 创建。目前由 t2k GmbH 积极开发和维护。 你可以从这个仓库中获得:
docTR 中的端到端 OCR 采用两阶段方法实现:文本检测(定位单词),然后是文本识别(识别单词中的所有字符)。 因此,你可以从可用实现列表中选择用于文本检测的架构,以及用于文本识别的架构。
from doctr.models import ocr_predictor
model = ocr_predictor(det_arch="db_resnet50", reco_arch="crnn_vgg16_bn", pretrained=True)文档可以从 PDF 或图像中解析:
from doctr.io import DocumentFile
# PDF
pdf_doc = DocumentFile.from_pdf("path/to/your/doc.pdf")
# 图片
single_img_doc = DocumentFile.from_images("path/to/your/img.jpg")
# 网页(需要安装 `weasyprint`)
webpage_doc = DocumentFile.from_url("https://www.yoursite.com")
# 多页图像
multi_img_doc = DocumentFile.from_images(["path/to/page1.jpg", "path/to/
[](LICENSE) [](https://github.com/mindee/doctr/pkgs/container/doctr) [](https://codecov.io/gh/mindee/doctr) [](https://www.codefactor.io/repository/github/mindee/doctr) [](https://app.codacy.com/gh/mindee/doctr?utm_source=github.com&utm_medium=referral&utm_content=mindee/doctr&utm_campaign=Badge_Grade) [](https://mindee.github.io/doctr) [](https://pypi.org/project/python-doctr/) [](https://huggingface.co/spaces/mindee/doctr) [](https://colab.research.google.com/github/mindee/notebooks/blob/main/doctr/quicktour.ipynb) [](https://gurubase.io/g/doctr)暂无开放 Issues,或尚未同步最近议题。