MCPcopy Index your code

hub / github.com/mindee/doctr / functions

Functions871 in github.com/mindee/doctr

↓ 3 callersMethodreset
(self)
doctr/utils/metrics.py:305
↓ 3 callersMethodsummary
Computes the aggregated metrics Returns: a tuple with the recall & precision for each string comparison and the mean IoU
doctr/utils/metrics.py:405
↓ 3 callersFunctionu
(e,t,o)
docs/source/_static/js/custom.js:94
↓ 2 callersFunctionC
(e)
docs/source/_static/js/custom.js:94
↓ 2 callersFunctionF
(e,t)
docs/source/_static/js/custom.js:94
↓ 2 callersMethod__init__
(self, drop_prob: float = 0.0, scale_by_keep: bool = True)
doctr/models/modules/layers/pytorch.py:20
↓ 2 callersMethod__init__
( self, feature_extractor, vocab: str, embedding_units: int, max_lengt
doctr/models/recognition/parseq/pytorch.py:125
↓ 2 callersMethod__init__
( self, feat_extractor: IntermediateLayerGetter, bin_thresh: float = 0.1, box_
doctr/models/detection/fast/pytorch.py:117
↓ 2 callersMethod__init__
Args: in_channels: number of input channels out_dim: final embedding dimension embed_dims: list of embedd
doctr/models/classification/vip/pytorch.py:131
↓ 2 callersFunction_addindent
(s_, num_spaces)
doctr/utils/repr.py:12
↓ 2 callersFunction_check_integrity
(file_path: str | Path, hash_prefix: str)
doctr/utils/data.py:37
↓ 2 callersFunction_copy_tensor
(x: torch.Tensor)
doctr/models/utils/pytorch.py:29
↓ 2 callersMethod_general_page_orientations
( self, pages: list[np.ndarray], )
doctr/models/predictor/base.py:68
↓ 2 callersMethod_generate_string
(self, min_chars: int, max_chars: int)
doctr/datasets/generator/base.py:138
↓ 2 callersMethod_get_orientations
( self, pages: list[np.ndarray], seg_maps: list[np.ndarray] )
doctr/models/predictor/base.py:81
↓ 2 callersFunction_mock_kie_pages
(prediction_size=(1, 1), prediction_offset=(0, 0))
tests/common/test_io_elements.py:105
↓ 2 callersFunction_orientation_predictor
( arch: Any, pretrained: bool, model_type: str, disabled: bool = False, **kwargs: Any )
doctr/models/classification/zoo.py:40
↓ 2 callersMethod_pad_to_mxn_tensor
(self, kernel: torch.Tensor)
doctr/models/modules/layers/pytorch.py:180
↓ 2 callersMethod_prepare_crops
( pages: list[np.ndarray], loc_preds: list[np.ndarray], assume_straight_pages: bool =
doctr/models/predictor/base.py:132
↓ 2 callersFunction_process_file
(model, file_path: Path, out_format: str)
scripts/detect_text.py:20
↓ 2 callersMethod_process_predictions
( loc_preds: list[np.ndarray], word_preds: list[tuple[str, float]], crop_orientations:
doctr/models/predictor/base.py:171
↓ 2 callersMethod_read_from_folder
(self, path: str)
doctr/datasets/imgur5k.py:160
↓ 2 callersMethod_read_from_folder
(self, path: str)
doctr/datasets/synthtext.py:146
↓ 2 callersMethod_rectify_crops
( self, crops: list[list[np.ndarray]], loc_preds: list[np.ndarray], )
doctr/models/predictor/base.py:150
↓ 2 callersFunction_remove_padding
Remove padding from the localization predictions Args: pages: list of pages loc_preds: list of localization predictions p
doctr/models/detection/_utils/base.py:12
↓ 2 callersFunction_resnet
( arch: str, pretrained: bool, num_blocks: list[int], output_channels: list[int], stage_st
doctr/models/classification/resnet/pytorch.py:166
↓ 2 callersMethod_resolve_lines
Order boxes to group them in lines Args: boxes: bounding boxes of shape (N, 4) or (N, 4, 2) in case of rotated bbox Retu
doctr/models/builder.py:103
↓ 2 callersMethod_resolve_sub_lines
Split a line in sub_lines Args: boxes: bounding boxes of shape (N, 4) word_idcs: list of indexes for the words of the
doctr/models/builder.py:65
↓ 2 callersFunction_save_model_and_config_for_hf_hub
Save model and config to disk for pushing to huggingface hub Args: model: PyTorch model to be saved save_dir: directory to save m
doctr/models/factory/hub.py:55
↓ 2 callersMethod_straighten_pages
( self, pages: list[np.ndarray], seg_maps: list[np.ndarray], general_pages_ori
doctr/models/predictor/base.py:91
↓ 2 callersFunction_test_kiepredictor
(predictor)
tests/pytorch/test_models_zoo_pt.py:357
↓ 2 callersFunction_test_predictor
(predictor)
tests/pytorch/test_models_zoo_pt.py:340
↓ 2 callersFunction_urlretrieve
(url: str, filename: Path | str, chunk_size: int = 1024)
doctr/utils/data.py:26
↓ 2 callersFunction_vip
Internal constructor for the VIPNet models. Args: arch: architecture key pretrained: load pretrained weights? ignore
doctr/models/classification/vip/pytorch.py:301
↓ 2 callersFunction_vit
( arch: str, pretrained: bool, ignore_keys: list[str] | None = None, **kwargs: Any, )
doctr/models/classification/vit/pytorch.py:111
↓ 2 callersFunction_vitstr
( arch: str, pretrained: bool, backbone_fn: Callable[[bool], nn.Module], layer: str, ignor
doctr/models/recognition/vitstr/pytorch.py:192
↓ 2 callersMethodadd_hook
Add a hook to the predictor Args: hook: a callable that takes as input the `loc_preds` and returns the modified `loc_preds`
doctr/models/predictor/base.py:188
↓ 2 callersFunctionb
(e)
docs/source/_static/js/custom.js:94
↓ 2 callersMethodbuild_target
Encode a list of gts sequences into a np array and gives the corresponding* sequence lengths. Args: gts: list of ground-t
doctr/models/recognition/vitstr/base.py:17
↓ 2 callersFunctioncommon_test
(json_response, expected_response)
api/tests/routes/test_ocr.py:5
↓ 2 callersFunctioncommon_test
(json_response, expected_response)
api/tests/routes/test_detection.py:5
↓ 2 callersFunctioncommon_test
(json_response, expected_response)
api/tests/routes/test_kie.py:5
↓ 2 callersFunctioncompute_expanded_shape
Compute the shape of an expanded rotated image Args: img_shape: the height and width of the image angle: angle between -90 and +9
doctr/utils/geometry.py:138
↓ 2 callersMethoddecode_autoregressive
Generate predictions for the given features.
doctr/models/recognition/parseq/pytorch.py:269
↓ 2 callersFunctiondecode_sequence
Given a predefined mapping, decode the sequence of numbers to a string Args: input_seq: array to decode mapping: vocabulary (stri
doctr/datasets/utils.py:92
↓ 2 callersFunctiondetach_scores
Detach the objectness scores from box predictions Args: boxes: list of arrays with boxes of shape (N, 5) or (N, 5, 2) Returns:
doctr/utils/geometry.py:57
↓ 2 callersMethodearly_stop
(self, validation_loss: float)
references/classification/utils.py:83
↓ 2 callersFunctionevaluate
(model, device, val_loader, batch_transforms, val_metric, amp=False, log=None)
references/recognition/train.py:158
↓ 2 callersFunctionevaluate
(model, val_loader, batch_transforms, val_metric, args, amp=False, log=None)
references/detection/train.py:153
↓ 2 callersFunctionevaluate
(model, val_loader, batch_transforms, amp=False, log=None)
references/classification/train_orientation.py:165
↓ 2 callersFunctionevaluate
(model, val_loader, batch_transforms, amp=False, log=None)
references/classification/train_character.py:154
↓ 2 callersFunctionextract_crops
Created cropped images from list of bounding boxes Args: img: input image boxes: bounding boxes of shape (N, 4) where N is the nu
doctr/utils/geometry.py:393
↓ 2 callersFunctionextract_rcrops
Created cropped images from list of rotated bounding boxes Args: img: input image polys: bounding boxes of shape (N, 4, 2)
doctr/utils/geometry.py:422
↓ 2 callersFunctionf
(e,t,o)
docs/source/_static/js/custom.js:94
↓ 2 callersFunctionget_nvidia_smi
()
scripts/collect_env.py:159
↓ 2 callersMethodim2cswin
Re-arrange features into cross-shaped windows for Q/K. Args: x: A float tensor of shape (b, n, c). size: A t
doctr/models/classification/vip/layers/pytorch.py:463
↓ 2 callersFunctionkie_predictor
End-to-end KIE architecture using one model for localization, and another for text recognition. >>> import numpy as np >>> from doctr.models
doctr/models/zoo.py:175
↓ 2 callersMethodmake_source_and_target_mask
( self, source: torch.Tensor, target: torch.Tensor )
doctr/models/recognition/master/pytorch.py:103
↓ 2 callersFunctionmerge_multi_strings
Merges consecutive string sequences with overlapping characters. Args: seq_list: list of sequences to merge. Sequences need to be or
doctr/models/recognition/utils.py:69
↓ 2 callersFunctionmerge_strings
Merges 2 character sequences in the best way to maximize the alignment of their overlapping characters. Args: a: first char seq, suffix s
doctr/models/recognition/utils.py:12
↓ 2 callersFunctionplot_recorder
Display the results of the LR grid search. Adapted from https://github.com/frgfm/Holocron/blob/master/holocron/trainer/core.py Args:
references/classification/utils.py:37
↓ 2 callersFunctionplot_samples
(images, targets)
references/classification/utils.py:12
↓ 2 callersFunctionpolygon_patch
Create a matplotlib polygon patch for the element Args: geometry: bounding box of the element page_dimensions: dimensions of the
doctr/utils/visualization.py:69
↓ 2 callersMethodpolygon_to_box
Expand a polygon (points) by a factor unclip_ratio, and returns a polygon Args: points: The first parameter. Returns:
doctr/models/detection/linknet/base.py:39
↓ 2 callersMethodpolygon_to_box
Expand a polygon (points) by a factor unclip_ratio, and returns a polygon Args: points: The first parameter. Returns:
doctr/models/detection/fast/base.py:39
↓ 2 callersMethodpostprocess
Postprocess the model output Args: output: the model output to postprocess input_images: the input images us
doctr/contrib/base.py:64
↓ 2 callersMethodpreprocess
Preprocess the input image Args: img: the input image to preprocess Returns: np.ndarray: the prepro
doctr/contrib/base.py:52
↓ 2 callersFunctionrandom_shadow
Apply a random shadow effect to an image using NumPy for blurring. Args: img: Image to modify (C, H, W) as a PyTorch tensor. opac
doctr/transforms/functional/pytorch.py:116
↓ 2 callersFunctionremap_preds
Reconstruct predictions from possibly split crops. Args: preds: List of (text, confidence) tuples from each crop. crop_map:
doctr/models/recognition/predictor/_utils.py:110
↓ 2 callersMethodreset
(self)
doctr/utils/metrics.py:432
↓ 2 callersMethodreset
(self)
doctr/utils/metrics.py:547
↓ 2 callersFunctionrnd_rotate
(img: torch.Tensor, target)
references/classification/train_orientation.py:41
↓ 2 callersFunctionrotate_abs_geoms
Rotate a batch of bounding boxes or polygons by an angle around the image center. Args: geoms: (N, 4) or (N, 4, 2) array of ABSOLUTE
doctr/utils/geometry.py:159
↓ 2 callersFunctionrotate_abs_points
Rotate points counter-clockwise. Args: points: array of size (N, 2) angle: angle between -90 and +90 degrees Returns:
doctr/utils/geometry.py:121
↓ 2 callersFunctionrotate_image
Rotate an image counterclockwise by an given angle. Args: image: numpy tensor to rotate angle: rotation angle in degrees, between
doctr/utils/geometry.py:283
↓ 2 callersMethodsample_transforms
(self, x: np.ndarray)
doctr/models/preprocessor/pytorch.py:63
↓ 2 callersFunctionstring_match
Performs string comparison with multiple levels of tolerance Args: word1: a string word2: another string Returns: a
doctr/utils/metrics.py:23
↓ 2 callersMethodupdate
Updates the metric Args: gt_boxes: a set of relative bounding boxes either of shape (N, 4) or (N, 5) if they are rotated ones
doctr/utils/metrics.py:492
↓ 2 callersFunctionvisualize_page
Visualize a full page with predicted blocks, lines and words >>> import numpy as np >>> import matplotlib.pyplot as plt >>> from doctr.ut
doctr/utils/visualization.py:155
↓ 2 callersFunctionx
(e,t,o)
docs/source/_static/js/custom.js:94
↓ 1 callersMethod__init__
( self, feat_extractor: IntermediateLayerGetter, bin_thresh: float = 0.1, box_
doctr/models/detection/linknet/pytorch.py:103
↓ 1 callersMethod__init__
( self, feat_extractor: IntermediateLayerGetter, head_chans: int = 256, deform
doctr/models/detection/differentiable_binarization/pytorch.py:111
↓ 1 callersMethod__init__
( self, in_channels: int, num_classes: int, )
doctr/models/classification/vit/pytorch.py:47
↓ 1 callersMethod_build_blocks
Gather independent words in structured blocks Args: boxes: bounding boxes of all detected words of the page, of shape (N, 4) or (
doctr/models/builder.py:214
↓ 1 callersMethod_build_blocks
Gather independent words in structured blocks Args: boxes: bounding boxes of all detected words of the page, of shape (N, 4) or (
doctr/models/builder.py:454
↓ 1 callersFunction_detach
(boxes: np.ndarray)
doctr/utils/geometry.py:68
↓ 1 callersMethod_generate_crops
( pages: list[np.ndarray], loc_preds: list[np.ndarray], assume_straight_pages: bool =
doctr/models/predictor/base.py:116
↓ 1 callersMethod_get_equivalent_kernel_bias
(self)
doctr/models/modules/layers/pytorch.py:165
↓ 1 callersMethod_identity_to_conv
(self, identity: nn.BatchNorm2d | None)
doctr/models/modules/layers/pytorch.py:143
↓ 1 callersMethod_init_model
Download the model from the given url if needed Args: url: the url to use model_path: the path to the model
doctr/contrib/base.py:32
↓ 1 callersFunction_kie_predictor
( det_arch: Any, reco_arch: Any, pretrained: bool, pretrained_backbone: bool = True, assum
doctr/models/zoo.py:128
↓ 1 callersFunction_magc_resnet
( arch: str, pretrained: bool, num_blocks: list[int], output_channels: list[int], stage_st
doctr/models/classification/magc_resnet/pytorch.py:103
↓ 1 callersFunction_master
( arch: str, pretrained: bool, backbone_fn: Callable[[bool], nn.Module], layer: str, pretr
doctr/models/recognition/master/pytorch.py:283
↓ 1 callersFunction_parseq
( arch: str, pretrained: bool, backbone_fn: Callable[[bool], nn.Module], layer: str, ignor
doctr/models/recognition/parseq/pytorch.py:435
↓ 1 callersFunction_predictor
( det_arch: Any, reco_arch: Any, pretrained: bool, pretrained_backbone: bool = True, assum
doctr/models/zoo.py:16
↓ 1 callersFunction_predictor
(arch: Any, pretrained: bool, **kwargs: Any)
doctr/models/recognition/zoo.py:30
↓ 1 callersFunction_predictor
(arch: Any, pretrained: bool, assume_straight_pages: bool = True, **kwargs: Any)
doctr/models/detection/zoo.py:32
↓ 1 callersMethod_read_sample
(self, index: int)
doctr/datasets/datasets/base.py:45
↓ 1 callersMethod_resolve_blocks
Order lines to group them in blocks Args: boxes: bounding boxes of shape (N, 4) or (N, 4, 2) lines: list of lines, ea
doctr/models/builder.py:149
↓ 1 callersFunction_sar
( arch: str, pretrained: bool, backbone_fn: Callable[[bool], nn.Module], layer: str, pretr
doctr/models/recognition/sar/pytorch.py:345
← previousnext →101–200 of 871, ranked by callers