Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/mindee/doctr
/ types & classes
Types & classes
153 in github.com/mindee/doctr
⨍
Functions
871
◇
Types & classes
153
↳
Endpoints
52
↓ 32 callers
Class
Resize
Resize the input image to the given size >>> import torch >>> from doctr.transforms import Resize >>> transfo = Resize((64, 64), preserve
doctr/transforms/modules/pytorch.py:29
↓ 8 callers
Class
PreProcessor
Implements an abstract preprocessor object which performs casting, resizing, batching and normalization. Args: output_size: expected size
doctr/models/preprocessor/pytorch.py:21
↓ 6 callers
Class
PositionwiseFeedForward
Position-wise Feed-Forward Network
doctr/models/modules/transformer/pytorch.py:58
↓ 5 callers
Class
MultiHeadAttention
Multi-Head Attention
doctr/models/modules/transformer/pytorch.py:73
↓ 4 callers
Class
KIEPredictor
Implements an object able to localize and identify text elements in a set of documents Args: det_predictor: detection module reco
doctr/models/kie_predictor/pytorch.py:23
↓ 4 callers
Class
LocalizationConfusion
r"""Implements common confusion metrics and mean IoU for localization evaluation. The aggregated metrics are computed as follows: .. math::
doctr/utils/metrics.py:219
↓ 4 callers
Class
OCRPredictor
Implements an object able to localize and identify text elements in a set of documents Args: det_predictor: detection module reco
doctr/models/predictor/pytorch.py:23
↓ 4 callers
Class
TextMatch
r"""Implements text match metric (word-level accuracy) for recognition task. The raw aggregated metric is computed as follows: .. math::
doctr/utils/metrics.py:44
↓ 3 callers
Class
DBPostProcessor
Implements a post processor for DBNet adapted from the implementation of `xuannianz <https://github.com/xuannianz/DifferentiableBinarization>`_.
doctr/models/detection/differentiable_binarization/base.py:19
↓ 3 callers
Class
DetectionPredictor
Implements an object able to localize text elements in a document Args: pre_processor: transform inputs for easier batched model inferenc
doctr/models/detection/predictor/pytorch.py:19
↓ 3 callers
Class
DropPath
DropPath (Drop Connect) layer. This is a stochastic version of the identity layer.
doctr/models/modules/layers/pytorch.py:14
↓ 3 callers
Class
FASTConvLayer
Convolutional layer used in the TextNet and FAST architectures
doctr/models/modules/layers/pytorch.py:62
↓ 3 callers
Class
FASTPostProcessor
Implements a post processor for FAST model. Args: bin_thresh: threshold used to binzarized p_map at inference time box_thresh: mi
doctr/models/detection/fast/base.py:21
↓ 3 callers
Class
LinkNetPostProcessor
Implements a post processor for LinkNet model. Args: bin_thresh: threshold used to binzarized p_map at inference time box_thresh:
doctr/models/detection/linknet/base.py:21
↓ 3 callers
Class
RecognitionDataset
Dataset implementation for text recognition tasks >>> from doctr.datasets import RecognitionDataset >>> train_set = RecognitionDataset(img_fo
doctr/datasets/recognition.py:16
↓ 3 callers
Class
RecognitionPredictor
Implements an object able to identify character sequences in images Args: pre_processor: transform inputs for easier batched model infere
doctr/models/recognition/predictor/pytorch.py:21
↓ 3 callers
Class
VIPBlock
Unified block for Local, Global, and Mixed feature mixing in VIP architecture.
doctr/models/classification/vip/pytorch.py:57
↓ 2 callers
Class
CharacterGenerator
Implements a character image generation dataset >>> from doctr.datasets import CharacterGenerator >>> ds = CharacterGenerator(vocab='abdef',
doctr/datasets/generator/pytorch.py:13
↓ 2 callers
Class
CrossShapedWindowAttention
Local mixing module, performing attention within cross-shaped windows. This captures local patterns by splitting the feature map into two cr
doctr/models/classification/vip/layers/pytorch.py:545
↓ 2 callers
Class
DetectionDataset
Implements a text detection dataset >>> from doctr.datasets import DetectionDataset >>> train_set = DetectionDataset(img_folder="/path/to/ima
doctr/datasets/detection.py:20
↓ 2 callers
Class
EarlyStopper
references/classification/utils.py:76
↓ 2 callers
Class
OCRMetric
r"""Implements an end-to-end OCR metric. The aggregated metrics are computed as follows: .. math:: \forall (B, L) \in \mathcal{B}^N
doctr/utils/metrics.py:312
↓ 2 callers
Class
OrientationDataset
Implements a basic image dataset where targets are filled with zeros. >>> from doctr.datasets import OrientationDataset >>> train_set = Orien
doctr/datasets/orientation.py:16
↓ 2 callers
Class
OrientationPredictor
Implements an object able to detect the reading direction of a text box or a page. 4 possible orientations: 0, 90, 180, 270 (-90) degrees counter
doctr/models/classification/predictor/pytorch.py:17
↓ 2 callers
Class
PositionalEncoding
Compute positional encoding
doctr/models/modules/transformer/pytorch.py:18
↓ 2 callers
Class
Prediction
Implements a prediction element
doctr/io/elements.py:187
↓ 2 callers
Class
RandomRotate
Randomly rotate a tensor image and its boxes .. image:: https://doctr-static.mindee.com/models?id=v0.4.0/rotation_illustration.png&src=0
doctr/transforms/modules/base.py:150
↓ 2 callers
Class
ResNet
Implements a ResNet-31 architecture from `"Show, Attend and Read:A Simple and Strong Baseline for Irregular Text Recognition" <https://arxiv.org/p
doctr/models/classification/resnet/pytorch.py:84
↓ 2 callers
Class
Word
Implements a word element Args: value: the text string of the word confidence: the confidence associated with the text prediction
doctr/io/elements.py:66
↓ 2 callers
Class
WordGenerator
Implements a character image generation dataset >>> from doctr.datasets import WordGenerator >>> ds = WordGenerator(vocab='abdef', min_chars=
doctr/datasets/generator/pytorch.py:34
↓ 2 callers
Class
_BasePredictor
Base class for all predictors Args: batch_size: the batch size to use url: the url to use to download a model if needed
doctr/contrib/base.py:14
↓ 2 callers
Class
_DummyCallback
tests/pytorch/test_models_zoo_pt.py:23
↓ 1 callers
Class
AdaptiveAvgPool2d
Custom AdaptiveAvgPool2d implementation which is ONNX and `torch.compile` compatible.
doctr/models/modules/layers/pytorch.py:36
↓ 1 callers
Class
Attention
Standard multi-head attention module. This module applies self-attention across the input sequence using 'num_heads' heads. Args:
doctr/models/classification/vip/layers/pytorch.py:88
↓ 1 callers
Class
AttentionModule
doctr/models/recognition/sar/pytorch.py:47
↓ 1 callers
Class
Block
Implements a block element as a collection of lines and artefacts Args: lines: list of line elements artefacts: list of artefacts
doctr/io/elements.py:198
↓ 1 callers
Class
CRNN
Implements a CRNN architecture as described in `"An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application t
doctr/models/recognition/crnn/pytorch.py:98
↓ 1 callers
Class
CTCPostProcessor
Postprocess raw prediction of the model (logits) to a list of words using CTC decoding Args: vocab: string containing the ordered sequenc
doctr/models/recognition/crnn/pytorch.py:48
↓ 1 callers
Class
ChannelShuffle
Randomly shuffle channel order of a given image
doctr/transforms/modules/pytorch.py:189
↓ 1 callers
Class
CharEmbedding
Implements the character embedding module Args: vocab_size: size of the vocabulary d_model: dimension of the model
doctr/models/recognition/parseq/pytorch.py:38
↓ 1 callers
Class
ClassifierHead
Classifier head for Vision Transformer Args: in_channels: number of input channels num_classes: number of output classes
doctr/models/classification/vit/pytorch.py:39
↓ 1 callers
Class
ClassifierHead
Classification head which averages the features and applies a linear layer.
doctr/models/classification/vip/pytorch.py:46
↓ 1 callers
Class
ColorInversion
Applies the following tranformation to a tensor (image or batch of images): convert to grayscale, colorize (shift 0-values randomly), and then inv
doctr/transforms/modules/base.py:71
↓ 1 callers
Class
DBNet
DBNet as described in `"Real-time Scene Text Detection with Differentiable Binarization" <https://arxiv.org/pdf/1911.08947.pdf>`_. Args:
doctr/models/detection/differentiable_binarization/pytorch.py:95
↓ 1 callers
Class
Decoder
Transformer Decoder
doctr/models/modules/transformer/pytorch.py:145
↓ 1 callers
Class
DetectionIn
api/app/schemas.py:39
↓ 1 callers
Class
DetectionOut
api/app/schemas.py:55
↓ 1 callers
Class
Document
Implements a document element as a collection of pages Args: pages: list of page elements
doctr/io/elements.py:601
↓ 1 callers
Class
DocumentBuilder
Implements a document builder Args: resolve_lines: whether words should be automatically grouped into lines resolve_blocks: wheth
doctr/models/builder.py:19
↓ 1 callers
Class
EarlyStopper
references/recognition/utils.py:76
↓ 1 callers
Class
EarlyStopper
references/detection/utils.py:86
↓ 1 callers
Class
EncoderBlock
Transformer Encoder Block
doctr/models/modules/transformer/pytorch.py:104
↓ 1 callers
Class
FAST
FAST as described in `"FAST: Faster Arbitrarily-Shaped Text Detector with Minimalist Kernel Representation" <https://arxiv.org/pdf/2111.02394.pdf>
doctr/models/detection/fast/pytorch.py:101
↓ 1 callers
Class
FastHead
Head of the FAST architecture Args: in_channels: number of input channels num_classes: number of output classes out_chann
doctr/models/detection/fast/pytorch.py:76
↓ 1 callers
Class
FastNeck
Neck of the FAST architecture, composed of a series of 3x3 convolutions and upsampling layers. Args: in_channels: number of input channel
doctr/models/detection/fast/pytorch.py:47
↓ 1 callers
Class
FeaturePyramidNetwork
doctr/models/detection/differentiable_binarization/pytorch.py:48
↓ 1 callers
Class
GaussianBlur
Apply Gaussian Blur to the input tensor >>> import torch >>> from doctr.transforms import GaussianBlur >>> transfo = GaussianBlur(sigma=(
doctr/transforms/modules/pytorch.py:156
↓ 1 callers
Class
GaussianNoise
Adds Gaussian Noise to the input tensor >>> import torch >>> from doctr.transforms import GaussianNoise >>> transfo = GaussianNoise(0., 1
doctr/transforms/modules/pytorch.py:126
↓ 1 callers
Class
KIEDocument
Implements a document element as a collection of pages Args: pages: list of page elements
doctr/io/elements.py:655
↓ 1 callers
Class
KIEDocumentBuilder
Implements a KIE document builder Args: resolve_lines: whether words should be automatically grouped into lines resolve_blocks: w
doctr/models/builder.py:360
↓ 1 callers
Class
KIEElement
api/app/schemas.py:165
↓ 1 callers
Class
KIEIn
api/app/schemas.py:11
↓ 1 callers
Class
KIEOut
api/app/schemas.py:181
↓ 1 callers
Class
KIEPage
Implements a KIE page element as a collection of predictions Args: predictions: Dictionary with list of block elements for each detection
doctr/io/elements.py:427
↓ 1 callers
Class
LePEAttention
Local Enhancement Positional Encoding (LePE) Attention. This is used for computing attention in cross-shaped windows (part of CrossShapedWin
doctr/models/classification/vip/layers/pytorch.py:365
↓ 1 callers
Class
Line
Implements a line element as a collection of words Args: words: list of word elements geometry: bounding box of the word in forma
doctr/io/elements.py:141
↓ 1 callers
Class
LinkNet
LinkNet as described in `"LinkNet: Exploiting Encoder Representations for Efficient Semantic Segmentation" <https://arxiv.org/pdf/1707.03718.pdf>`
doctr/models/detection/linknet/pytorch.py:88
↓ 1 callers
Class
LinkNetFPN
doctr/models/detection/linknet/pytorch.py:46
↓ 1 callers
Class
MASTER
Implements MASTER as described in paper: <https://arxiv.org/pdf/1910.02562.pdf>`_. Implementation based on the official Pytorch implementation: <h
doctr/models/recognition/master/pytorch.py:36
↓ 1 callers
Class
MASTERPostProcessor
Post processor for MASTER architectures
doctr/models/recognition/master/pytorch.py:260
↓ 1 callers
Class
MultiHeadSelfAttention
Multi-head Self Attention block with an MLP for feed-forward processing. This block normalizes the input, applies attention mixing, adds a r
doctr/models/classification/vip/layers/pytorch.py:145
↓ 1 callers
Class
OCRBlock
api/app/schemas.py:85
↓ 1 callers
Class
OCRIn
api/app/schemas.py:28
↓ 1 callers
Class
OCRLine
api/app/schemas.py:68
↓ 1 callers
Class
OCROut
api/app/schemas.py:134
↓ 1 callers
Class
OCRPage
api/app/schemas.py:107
↓ 1 callers
Class
OCRWord
api/app/schemas.py:60
↓ 1 callers
Class
OSRABlock
Global token mixing block using Overlapped Spatial Reduction Attention (OSRA). Captures global dependencies by aggregating context from a wi
doctr/models/classification/vip/layers/pytorch.py:283
↓ 1 callers
Class
OverlappedSpatialReductionAttention
Overlapped Spatial Reduction Attention (OSRA). This attention mechanism downsamples the input according to 'sr_ratio' (spatial reduction rat
doctr/models/classification/vip/layers/pytorch.py:198
↓ 1 callers
Class
PARSeq
Implements a PARSeq architecture as described in `"Scene Text Recognition with Permuted Autoregressive Sequence Models" <https://arxiv.org/pdf/220
doctr/models/recognition/parseq/pytorch.py:106
↓ 1 callers
Class
PARSeqDecoder
Implements decoder module of the PARSeq model Args: d_model: dimension of the model num_heads: number of attention heads
doctr/models/recognition/parseq/pytorch.py:55
↓ 1 callers
Class
PARSeqPostProcessor
Post processor for PARSeq architecture Args: vocab: string containing the ordered sequence of supported characters
doctr/models/recognition/parseq/pytorch.py:407
↓ 1 callers
Class
Page
Implements a page element as a collection of blocks Args: page: image encoded as a numpy array in uint8 blocks: list of block ele
doctr/io/elements.py:251
↓ 1 callers
Class
PatchEmbed
Patch embedding layer for Vision Permutable Extractor. This layer reduces the spatial resolution of the input tensor by a factor of 4 in tot
doctr/models/classification/vip/layers/pytorch.py:49
↓ 1 callers
Class
PatchEmbedding
Compute 2D patch embeddings with cls token and positional encoding
doctr/models/modules/vision_transformer/pytorch.py:14
↓ 1 callers
Class
PatchMerging
Patch Merging Layer. Reduces the spatial dimension by half along the height. If the input has shape (b, h, w, c), the output shape becom
doctr/models/classification/vip/layers/pytorch.py:332
↓ 1 callers
Class
PermuteLayer
Custom layer to permute dimensions in a Sequential model.
doctr/models/classification/vip/layers/pytorch.py:27
↓ 1 callers
Class
RandomCrop
Randomly crop a tensor image and its boxes Args: scale: tuple of floats, relative (min_area, max_area) of the crop ratio: tuple o
doctr/transforms/modules/base.py:176
↓ 1 callers
Class
RandomHorizontalFlip
Randomly flip the input image horizontally
doctr/transforms/modules/pytorch.py:201
↓ 1 callers
Class
RandomResize
Randomly resize the input image and align corresponding targets >>> import torch >>> from doctr.transforms import RandomResize >>> transf
doctr/transforms/modules/pytorch.py:258
↓ 1 callers
Class
RandomShadow
Adds random shade to the input image >>> import torch >>> from doctr.transforms import RandomShadow >>> transfo = RandomShadow((0., 1.))
doctr/transforms/modules/pytorch.py:217
↓ 1 callers
Class
RecognitionIn
api/app/schemas.py:34
↓ 1 callers
Class
RecognitionOut
api/app/schemas.py:49
↓ 1 callers
Class
SAR
Implements a SAR architecture as described in `"Show, Attend and Read:A Simple and Strong Baseline for Irregular Text Recognition" <https://arxiv.
doctr/models/recognition/sar/pytorch.py:164
↓ 1 callers
Class
SARDecoder
Implements decoder module of the SAR model Args: rnn_units: number of hidden units in recurrent cells max_length: maximum length
doctr/models/recognition/sar/pytorch.py:80
↓ 1 callers
Class
SAREncoder
doctr/models/recognition/sar/pytorch.py:34
↓ 1 callers
Class
SARPostProcessor
Post processor for SAR architectures Args: vocab: string containing the ordered sequence of supported characters
doctr/models/recognition/sar/pytorch.py:318
↓ 1 callers
Class
SqueezeLayer
Custom layer to squeeze out a dimension in a Sequential model.
doctr/models/classification/vip/layers/pytorch.py:38
↓ 1 callers
Class
TextNet
Implements TextNet architecture from `"FAST: Faster Arbitrarily-Shaped Text Detector with Minimalist Kernel Representation" <https://arxiv.org/abs
doctr/models/classification/textnet/pytorch.py:44
↓ 1 callers
Class
VIPNet
VIP (Vision Permutable) encoder architecture, adapted for text recognition.
doctr/models/classification/vip/pytorch.py:126
next →
1–100 of 153, ranked by callers