Repository Analysis

mindee/doctr

docTR (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.

15.4 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of mindee/doctr, a Python project with 6,182 GitHub stars. SynthScan v2.0 examined 46,750 lines of code across 298 source files, recording 500 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 15.4 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

15.4
Adjusted Score
15.4
Raw Score
100%
Time Factor
2026-07-09
Last Push
6.2K
Stars
Python
Language
46.8K
Lines of Code
298
Files
500
Pattern Hits
2026-07-14
Scan Date
0.16
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 48MEDIUM 14LOW 438

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 500 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Cross-File Repetition46 hits · 230 pts
SeverityFileLineSnippetContext
HIGHreferences/classification/train_orientation.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/classification/train_character.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/layout/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/table/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/recognition/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/detection/train.py0gridsearch the optimal learning rate for the training. adapted from https://github.com/frgfm/holocron/blob/master/holocrSTRING
HIGHreferences/classification/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/layout/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/detection/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHreferences/recognition/utils.py0display the results of the lr grid search. adapted from https://github.com/frgfm/holocron/blob/master/holocron/trainer/cSTRING
HIGHdoctr/models/classification/mobilenet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/vip/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/starnet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/vit_det/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/resnet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/vit/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/textnet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/classification/vgg/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/layout/lw_detr/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/table_structure/tablecenternet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/crnn/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/vitstr/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/viptr/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/master/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/sar/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/parseq/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGH…odels/detection/differentiable_binarization/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/detection/linknet/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/detection/fast/pytorch.py0load pretrained parameters onto the model args: path_or_url: the path or url to the model parameters (checkpoint) **kwarSTRING
HIGHdoctr/models/recognition/core.py0encode a list of gts sequences into a np array and gives the corresponding* sequence lengths. args: gts: list of ground-STRING
HIGHdoctr/models/recognition/vitstr/base.py0encode a list of gts sequences into a np array and gives the corresponding* sequence lengths. args: gts: list of ground-STRING
HIGHdoctr/models/recognition/master/base.py0encode a list of gts sequences into a np array and gives the corresponding* sequence lengths. args: gts: list of ground-STRING
HIGHdoctr/models/recognition/parseq/base.py0encode a list of gts sequences into a np array and gives the corresponding* sequence lengths. args: gts: list of ground-STRING
HIGHdoctr/models/recognition/core.py0abstract class to postprocess the raw output of the model args: vocab: string containing the ordered sequence of supportSTRING
HIGHdoctr/models/recognition/vitstr/base.py0abstract class to postprocess the raw output of the model args: vocab: string containing the ordered sequence of supportSTRING
HIGHdoctr/models/recognition/master/base.py0abstract class to postprocess the raw output of the model args: vocab: string containing the ordered sequence of supportSTRING
HIGHdoctr/models/recognition/parseq/base.py0abstract class to postprocess the raw output of the model args: vocab: string containing the ordered sequence of supportSTRING
HIGHdoctr/models/recognition/vitstr/pytorch.py0compute categorical cross-entropy loss for the model. sequences are masked after the eos character. args: gt: the encodeSTRING
HIGHdoctr/models/recognition/sar/pytorch.py0compute categorical cross-entropy loss for the model. sequences are masked after the eos character. args: gt: the encodeSTRING
HIGHdoctr/models/recognition/master/pytorch.py0compute categorical cross-entropy loss for the model. sequences are masked after the eos character. args: gt: the encodeSTRING
HIGH…r/models/detection/differentiable_binarization/base.py0expand a polygon (points) by a factor unclip_ratio, and returns a polygon args: points: the first parameter. returns: a STRING
HIGHdoctr/models/detection/linknet/base.py0expand a polygon (points) by a factor unclip_ratio, and returns a polygon args: points: the first parameter. returns: a STRING
HIGHdoctr/models/detection/fast/base.py0expand a polygon (points) by a factor unclip_ratio, and returns a polygon args: points: the first parameter. returns: a STRING
HIGH…r/models/detection/differentiable_binarization/base.py0compute boxes from a bitmap/pred_map: find connected components then filter boxes args: pred: pred map from differentiabSTRING
HIGHdoctr/models/detection/linknet/base.py0compute boxes from a bitmap/pred_map: find connected components then filter boxes args: pred: pred map from differentiabSTRING
HIGHdoctr/models/detection/fast/base.py0compute boxes from a bitmap/pred_map: find connected components then filter boxes args: pred: pred map from differentiabSTRING
Unused Imports128 hits · 126 pts
SeverityFileLineSnippetContext
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py1CODE
LOWdoctr/__init__.py2CODE
LOWdoctr/datasets/__init__.py1CODE
LOWdoctr/datasets/__init__.py2CODE
LOWdoctr/datasets/__init__.py3CODE
LOWdoctr/datasets/__init__.py4CODE
LOWdoctr/datasets/__init__.py5CODE
LOWdoctr/datasets/__init__.py6CODE
LOWdoctr/datasets/__init__.py7CODE
LOWdoctr/datasets/__init__.py8CODE
LOWdoctr/datasets/__init__.py9CODE
LOWdoctr/datasets/__init__.py10CODE
LOWdoctr/datasets/__init__.py11CODE
LOWdoctr/datasets/__init__.py12CODE
LOWdoctr/datasets/__init__.py13CODE
LOWdoctr/datasets/__init__.py14CODE
LOWdoctr/datasets/__init__.py15CODE
LOWdoctr/datasets/__init__.py16CODE
LOWdoctr/datasets/__init__.py17CODE
LOWdoctr/datasets/__init__.py18CODE
LOWdoctr/datasets/__init__.py19CODE
LOWdoctr/datasets/__init__.py20CODE
LOWdoctr/datasets/__init__.py21CODE
LOWdoctr/datasets/__init__.py22CODE
LOWdoctr/datasets/__init__.py23CODE
LOWdoctr/datasets/__init__.py24CODE
LOWdoctr/datasets/datasets/__init__.py1CODE
LOWdoctr/datasets/generator/__init__.py1CODE
LOWdoctr/io/__init__.py1CODE
LOWdoctr/io/__init__.py2CODE
LOWdoctr/io/__init__.py3CODE
LOWdoctr/io/__init__.py4CODE
LOWdoctr/io/__init__.py5CODE
LOWdoctr/io/image/__init__.py1CODE
LOWdoctr/io/image/__init__.py2CODE
LOWdoctr/utils/__init__.py1CODE
LOWdoctr/utils/__init__.py2CODE
LOWdoctr/utils/__init__.py3CODE
LOWdoctr/utils/__init__.py4CODE
LOWdoctr/models/__init__.py1CODE
LOWdoctr/models/__init__.py2CODE
LOWdoctr/models/__init__.py3CODE
LOWdoctr/models/__init__.py4CODE
LOWdoctr/models/__init__.py5CODE
LOWdoctr/models/__init__.py6CODE
LOWdoctr/models/__init__.py7CODE
LOWdoctr/models/classification/__init__.py1CODE
LOWdoctr/models/classification/__init__.py2CODE
LOWdoctr/models/classification/__init__.py3CODE
LOWdoctr/models/classification/__init__.py4CODE
LOWdoctr/models/classification/__init__.py5CODE
LOWdoctr/models/classification/__init__.py6CODE
LOWdoctr/models/classification/__init__.py7CODE
LOWdoctr/models/classification/__init__.py8CODE
LOWdoctr/models/classification/__init__.py9CODE
68 more matches not shown…
Hyper-Verbose Identifiers118 hits · 124 pts
SeverityFileLineSnippetContext
LOWreferences/detection/train.py39def convert_to_multiclass_targets(targets: list) -> list[dict[str, np.ndarray]]:CODE
LOWtests/conftest.py87def mock_artefact_image_stream():CODE
LOWtests/common/test_utils_fonts.py26def test_get_font_respects_size():CODE
LOWtests/common/test_utils_fonts.py33def test_get_font_explicit_family():CODE
LOWtests/common/test_utils_fonts.py46def test_get_font_resolution_is_cached():CODE
LOWtests/common/test_models_builder.py192def test_documentbuilder_layout():CODE
LOWtests/common/test_models_builder.py267def test_documentbuilder_tables():CODE
LOWtests/common/test_models_builder.py364def test_kiedocumentbuilder_layout():CODE
LOWtests/common/test_models_builder.py480def test_documentbuilder_tables_straight_geometry():CODE
LOWtests/common/test_models_builder.py527def test_documentbuilder_argument_length_validation():CODE
LOWtests/common/test_models_builder.py559def test_sort_boxes_degenerate_heights():CODE
LOWtests/common/test_models_builder.py567def test_documentbuilder_tables_empty_cells():CODE
LOWtests/common/test_utils_geometry.py81def test_resolve_enclosing_bbox():CODE
LOWtests/common/test_utils_geometry.py87def test_resolve_enclosing_rbbox():CODE
LOWtests/common/test_utils_geometry.py186def test_remove_image_padding():CODE
LOWtests/common/test_utils_geometry.py226def test_convert_to_relative_coords(abs_geoms, img_size, rel_geoms):CODE
LOWtests/common/test_datasets_utils.py24def test_translate_unknown_vocab():CODE
LOWtests/common/test_datasets_utils.py46def test_encode_string_unknown_char():CODE
LOWtests/common/test_datasets_utils.py51def test_encode_string_duplicate_vocab_chars():CODE
LOWtests/common/test_datasets_utils.py108def test_convert_target_to_relative(target, mock_image_stream):CODE
LOWtests/common/test_datasets_utils.py125def test_crop_bboxes_from_image(geoms, mock_image_path):CODE
LOWtests/common/test_models_reading_order.py34def test_detect_text_direction(texts, language, expected):CODE
LOWtests/common/test_models_reading_order.py38def test_normalize_layout_label():CODE
LOWtests/common/test_models_reading_order.py68def test_sort_reading_order_basic():CODE
LOWtests/common/test_models_reading_order.py80def test_sort_reading_order_columns():CODE
LOWtests/common/test_models_reading_order.py94def test_sort_reading_order_input_formats():CODE
LOWtests/common/test_models_reading_order.py107def test_sort_reading_order_vertical():CODE
LOWtests/common/test_models_reading_order.py117def test_sort_reading_order_labels():CODE
LOWtests/common/test_models_reading_order.py146def test_sort_reading_order_degenerate_geometries():CODE
LOWtests/common/test_models_reading_order.py153def test_resolve_reading_segments():CODE
LOWtests/common/test_models_reading_order.py170def test_assign_layout_labels():CODE
LOWtests/common/test_models_reading_order.py183def test_reading_order_predictor():CODE
LOWtests/common/test_models_reading_order.py200def test_sort_reading_order_fragmented_columns():CODE
LOWtests/common/test_models_detection.py65def test_linknet_postprocessor():CODE
LOWtests/common/test_utils_data.py21def test_download_from_url_customizing_cache_dir(mkdir_mock, urlretrieve_mock):CODE
LOWtests/common/test_utils_data.py29def test_download_from_url_error_creating_directory(logging_mock, mkdir_mock):CODE
LOWtests/common/test_utils_data.py41def test_download_from_url_error_creating_directory_with_env_var(logging_mock, mkdir_mock):CODE
LOWtests/common/test_io.py103def test_read_img_as_numpy_exif_orientation(tmpdir_factory):CODE
LOWtests/common/test_models_layout.py7def test_lwdetr_postprocessor():CODE
LOWtests/common/test_models_table_structure.py23def test_tablecenternet_postprocessor(assume_straight_pages):CODE
LOWtests/common/test_models_table_structure.py59def test_tablecenternet_build_target(use_polygons):CODE
LOWtests/common/test_models_table_structure.py128def test_tablecenternet_build_target_box_polygon_equivalence():CODE
LOWtests/common/test_models_table_structure.py146def test_tablecenternet_build_target_rejects_invalid_cell_shape(cells):CODE
LOWtests/common/test_utils_metrics.py109def test_localization_confusion(gts, preds, iou_thresh, recall, precision, mean_iou):CODE
LOWtests/common/test_utils_metrics.py150def test_r_localization_confusion(gts, preds, iou_thresh, recall, precision, mean_iou):CODE
LOWtests/common/test_utils_metrics.py161def test_localization_confusion_empty_gt(use_polygons):CODE
LOWtests/common/test_utils_metrics.py329def test_detection_metric_empty_gt():CODE
LOWtests/common/test_utils_metrics.py405def test_object_detection_metric_basic(gt_boxes, gt_labels, pred_boxes, pred_labels, pred_scores, expected_keys):CODE
LOWtests/common/test_utils_metrics.py434def test_object_detection_metric_cases():CODE
LOWtests/common/test_models.py31def test_estimate_orientation(mock_image, mock_bitmap, mock_tilted_payslip):CODE
LOWtests/common/test_models_detection_utils.py74def test_remove_padding_does_not_mutate_input():CODE
LOWtests/common/test_models_recognition_predictor.py105def test_invalid_split_overlap_ratio(split_overlap_ratio):CODE
LOWtests/common/test_utils_reconstitution.py42def test_synthesize_page_colors():CODE
LOWtests/common/test_utils_reconstitution.py56def test_synthesize_page_font_size_bounds():CODE
LOWtests/common/test_utils_reconstitution.py62def test_synthesize_page_unicode():CODE
LOWtests/common/test_utils_reconstitution.py86def test_synthesize_kie_page_rotated_prediction(caplog):CODE
LOWtests/common/test_utils_reconstitution.py106def test_synthesize_page_words_do_not_overlap():CODE
LOWtests/common/test_utils_reconstitution.py134def test_synthesize_page_rotated_line():CODE
LOWtests/common/test_cli.py23def test_parse_args_boolean_optional_flags():CODE
LOWtests/common/test_cli.py35def test_parse_args_requires_input_path():CODE
58 more matches not shown…
Modern Structural Boilerplate106 hits · 106 pts
SeverityFileLineSnippetContext
LOWdoctr/file_utils.py9__all__ = ["requires_package", "CLASS_NAME"]CODE
LOWdoctr/datasets/recognition.py13__all__ = ["RecognitionDataset"]CODE
LOWdoctr/datasets/synthtext.py18__all__ = ["SynthText"]CODE
LOWdoctr/datasets/detection.py17__all__ = ["DetectionDataset"]CODE
LOWdoctr/datasets/coco_text.py17__all__ = ["COCOTEXT"]CODE
LOWdoctr/datasets/orientation.py13__all__ = ["OrientationDataset"]CODE
LOWdoctr/datasets/table_structure.py19__all__ = ["TableStructureDataset"]CODE
LOWdoctr/datasets/layout.py15__all__ = ["LayoutDataset"]CODE
LOWdoctr/datasets/cord.py17__all__ = ["CORD"]CODE
LOWdoctr/datasets/mjsynth.py13__all__ = ["MJSynth"]CODE
LOWdoctr/datasets/wildreceipt.py17__all__ = ["WILDRECEIPT"]CODE
LOWdoctr/datasets/doc_artefacts.py14__all__ = ["DocArtefacts"]CODE
LOWdoctr/datasets/svhn.py16__all__ = ["SVHN"]CODE
LOWdoctr/datasets/iiit5k.py17__all__ = ["IIIT5K"]CODE
LOWdoctr/datasets/imgur5k.py20__all__ = ["IMGUR5K"]CODE
LOWdoctr/datasets/ic13.py17__all__ = ["IC13"]CODE
LOWdoctr/datasets/ocr.py15__all__ = ["OCRDataset"]CODE
LOWdoctr/datasets/ic03.py16__all__ = ["IC03"]CODE
LOWdoctr/datasets/utils.py22__all__ = [CODE
LOWdoctr/datasets/vocabs.py9__all__ = ["VOCABS"]CODE
LOWdoctr/datasets/funsd.py17__all__ = ["FUNSD"]CODE
LOWdoctr/datasets/sroie.py17__all__ = ["SROIE"]CODE
LOWdoctr/datasets/iiithws.py14__all__ = ["IIITHWS"]CODE
LOWdoctr/datasets/svt.py16__all__ = ["SVT"]CODE
LOWdoctr/datasets/datasets/pytorch.py18__all__ = ["AbstractDataset", "VisionDataset"]CODE
LOWdoctr/datasets/datasets/base.py15__all__ = ["_AbstractDataset", "_VisionDataset"]CODE
LOWdoctr/datasets/generator/pytorch.py8__all__ = ["CharacterGenerator", "WordGenerator"]CODE
LOWdoctr/io/elements.py25__all__ = [CODE
LOWdoctr/io/html.py8__all__ = ["read_html"]CODE
LOWdoctr/io/pdf.py13__all__ = ["read_pdf"]CODE
LOWdoctr/io/reader.py18__all__ = ["DocumentFile"]CODE
LOWdoctr/io/image/pytorch.py15__all__ = ["tensor_from_pil", "read_img_as_tensor", "decode_img_as_tensor", "tensor_from_numpy", "get_img_shape"]CODE
LOWdoctr/io/image/base.py13__all__ = ["read_img_as_numpy"]CODE
LOWdoctr/utils/metrics.py12__all__ = [CODE
LOWdoctr/utils/common_types.py12__all__ = ["Point2D", "BoundingBox", "Polygon4P", "Polygon", "Bbox", "Sample"]CODE
LOWdoctr/utils/visualization.py17__all__ = ["visualize_page", "visualize_kie_page", "draw_boxes"]CODE
LOWdoctr/utils/repr.py9__all__ = ["NestedObject"]CODE
LOWdoctr/utils/geometry.py13__all__ = [CODE
LOWdoctr/utils/reconstitution.py16__all__ = ["synthesize_page", "synthesize_kie_page"]CODE
LOWdoctr/utils/fonts.py12__all__ = ["get_font"]CODE
LOWdoctr/utils/data.py18__all__ = ["download_from_url"]CODE
LOWdoctr/utils/multithreading.py15__all__ = ["multithread_exec"]CODE
LOWdoctr/models/zoo.py15__all__ = ["ocr_predictor", "kie_predictor"]CODE
LOWdoctr/models/core.py11__all__ = ["BaseModel"]CODE
LOWdoctr/models/builder.py29__all__ = ["DocumentBuilder"]CODE
LOWdoctr/models/_utils.py17__all__ = [CODE
LOWdoctr/models/classification/zoo.py14__all__ = ["crop_orientation_predictor", "page_orientation_predictor"]CODE
LOWdoctr/models/classification/magc_resnet/pytorch.py19__all__ = ["magc_resnet31"]CODE
LOWdoctr/models/classification/mobilenet/pytorch.py19__all__ = [CODE
LOWdoctr/models/classification/vip/pytorch.py26__all__ = ["VIPNet", "vip_tiny", "vip_base"]CODE
LOWdoctr/models/classification/vip/layers/pytorch.py13__all__ = [CODE
LOWdoctr/models/classification/starnet/pytorch.py21__all__ = ["StarNet", "starnet_s3"]CODE
LOWdoctr/models/classification/vit_det/pytorch.py20__all__ = ["VisionDetectionTransformer", "vit_det_s", "vit_det_m"]CODE
LOWdoctr/models/classification/vit_det/layers/pytorch.py12__all__ = ["PatchEmbed", "MLP", "AttentionWithCAE", "WindowedCAETransformerBlock"]CODE
LOWdoctr/models/classification/resnet/pytorch.py23__all__ = ["ResNet", "resnet18", "resnet31", "resnet34", "resnet50", "resnet34_wide", "resnet_stage"]CODE
LOWdoctr/models/classification/vit/pytorch.py18__all__ = ["VisionTransformer", "vit_s", "vit_b"]CODE
LOWdoctr/models/classification/predictor/pytorch.py14__all__ = ["OrientationPredictor"]CODE
LOWdoctr/models/classification/textnet/pytorch.py17__all__ = ["TextNet", "textnet_tiny", "textnet_small", "textnet_base"]CODE
LOWdoctr/models/classification/vgg/pytorch.py18__all__ = ["VGG", "vgg16_bn_r"]CODE
LOWdoctr/models/kie_predictor/pytorch.py21__all__ = ["KIEPredictor"]CODE
46 more matches not shown…
Deep Nesting53 hits · 53 pts
SeverityFileLineSnippetContext
LOWdemo/app.py20CODE
LOWreferences/layout/utils.py40CODE
LOWreferences/recognition/train.py193CODE
LOWreferences/recognition/evaluate.py27CODE
LOWreferences/detection/utils.py12CODE
LOWreferences/detection/train.py174CODE
LOWreferences/detection/train.py213CODE
LOWtests/common/test_models_detection_utils.py29CODE
LOWtests/common/test_headers.py7CODE
LOWtests/common/test_io_elements.py564CODE
LOWtests/common/test_io_elements.py607CODE
LOWdoctr/datasets/synthtext.py51CODE
LOWdoctr/datasets/coco_text.py47CODE
LOWdoctr/datasets/cord.py52CODE
LOWdoctr/datasets/wildreceipt.py50CODE
LOWdoctr/datasets/svhn.py51CODE
LOWdoctr/datasets/iiit5k.py45CODE
LOWdoctr/datasets/imgur5k.py54CODE
LOWdoctr/datasets/ic13.py46CODE
LOWdoctr/datasets/ic03.py50CODE
LOWdoctr/datasets/funsd.py44CODE
LOWdoctr/datasets/sroie.py51CODE
LOWdoctr/datasets/svt.py42CODE
LOWdoctr/utils/metrics.py731CODE
LOWdoctr/utils/visualization.py155CODE
LOWdoctr/utils/visualization.py308CODE
LOWdoctr/utils/repr.py32CODE
LOWdoctr/utils/data.py26CODE
LOWdoctr/models/builder.py340CODE
LOWdoctr/models/builder.py649CODE
LOWdoctr/models/_utils.py42CODE
LOWdoctr/models/classification/vit_det/pytorch.py231CODE
LOWdoctr/models/layout/lw_detr/pytorch.py273CODE
LOWdoctr/models/layout/lw_detr/base.py89CODE
LOWdoctr/models/layout/lw_detr/base.py216CODE
LOWdoctr/models/reading_order/base.py79CODE
LOWdoctr/models/reading_order/base.py169CODE
LOWdoctr/models/table_structure/tablecenternet/base.py295CODE
LOWdoctr/models/table_structure/tablecenternet/base.py112CODE
LOWdoctr/models/recognition/sar/pytorch.py113CODE
LOWdoctr/models/recognition/parseq/pytorch.py125CODE
LOWdoctr/models/recognition/parseq/pytorch.py323CODE
LOWdoctr/models/detection/_utils/base.py12CODE
LOW…r/models/detection/differentiable_binarization/base.py270CODE
LOWdoctr/models/detection/linknet/base.py159CODE
LOWdoctr/models/detection/fast/base.py156CODE
LOWdoctr/models/factory/hub.py190CODE
LOWdoctr/contrib/artefacts.py68CODE
LOWdoctr/transforms/modules/pytorch.py97CODE
LOWscripts/evaluate_kie.py23CODE
LOWscripts/collect_env.py167CODE
LOWscripts/evaluate.py23CODE
LOWapi/tests/routes/test_ocr.py5CODE
Self-Referential Comments12 hits · 28 pts
SeverityFileLineSnippetContext
MEDIUMtests/pytorch/test_models_zoo_pt.py26# Create a dummy callbackCOMMENT
MEDIUMdoctr/io/elements.py553 # Create the XML root elementCOMMENT
MEDIUMdoctr/io/elements.py555 # Create the header / SubElements of the root elementCOMMENT
MEDIUMdoctr/io/elements.py569 # Create the bodyCOMMENT
MEDIUMdoctr/io/elements.py741 # Create the XML root elementCOMMENT
MEDIUMdoctr/io/elements.py743 # Create the header / SubElements of the root elementCOMMENT
MEDIUMdoctr/io/elements.py757 # Create the bodyCOMMENT
MEDIUMdoctr/models/builder.py136 # Define a mean y-center for the lineCOMMENT
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py116 """This module implements the self-attention mechanism used in LW-DETR.STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py196 """This module implements MultiScaleDeformableAttention from Deformable DETR.STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py357 """This module implements a single decoder layer of LW-DETR,STRING
MEDIUMdoctr/models/layout/lw_detr/layers/pytorch.py484 """This module implements the decoder of LW-DETR,STRING
AI Structural Patterns20 hits · 20 pts
SeverityFileLineSnippetContext
LOWdoctr/models/zoo.py18CODE
LOWdoctr/models/zoo.py100CODE
LOWdoctr/models/zoo.py184CODE
LOWdoctr/models/zoo.py250CODE
LOWdoctr/models/classification/starnet/pytorch.py95CODE
LOWdoctr/models/classification/vit_det/pytorch.py164CODE
LOWdoctr/models/kie_predictor/pytorch.py195CODE
LOWdoctr/models/layout/lw_detr/pytorch.py273CODE
LOWdoctr/models/layout/lw_detr/layers/pytorch.py371CODE
LOWdoctr/models/layout/lw_detr/layers/pytorch.py499CODE
LOWdoctr/models/table_structure/tablecenternet/pytorch.py157CODE
LOWdoctr/models/recognition/master/pytorch.py54CODE
LOWdoctr/models/recognition/sar/pytorch.py180CODE
LOWdoctr/models/recognition/parseq/pytorch.py125CODE
LOWdoctr/models/predictor/pytorch.py48CODE
LOWdoctr/models/predictor/pytorch.py194CODE
LOW…odels/detection/differentiable_binarization/pytorch.py111CODE
LOWdoctr/models/detection/linknet/pytorch.py85CODE
LOWdoctr/models/detection/fast/pytorch.py117CODE
LOWdoctr/transforms/functional/pytorch.py41CODE
Decorative Section Separators2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtests/pytorch/test_transforms_pt.py666# ----------------------------------------------------------------------------COMMENT
MEDIUMtests/pytorch/test_transforms_pt.py668# ----------------------------------------------------------------------------COMMENT
Slop Phrases4 hits · 6 pts
SeverityFileLineSnippetContext
LOWdoctr/models/recognition/vitstr/pytorch.py153 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/vitstr/pytorch.py153 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/master/pytorch.py144 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
LOWdoctr/models/recognition/master/pytorch.py144 # Compute loss: don't forget to shift gt! Otherwise the model learns to output the gt[t-1]!COMMENT
Cross-Language Confusion1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdocs/source/conf.py133 function gtag(){{dataLayer.push(arguments);}}CODE
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippetContext
HIGHdoctr/utils/multithreading.py19Execute a given function in parallel for each element of a given sequence >>> from doctr.utils.multithreading imporSTRING
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWdoctr/utils/reconstitution.py107 except Exception: # pragma: no coverCODE
LOWdoctr/models/table_structure/tablecenternet/base.py270 except Exception:CODE
LOWdoctr/cli/main.py48 except Exception as e:CODE
LOWdoctr/cli/main.py64 except Exception as e:CODE
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtests/conftest.py321 # third = np.array([[51], [46], [112], [110], [103]], dtype=np.int16) # 3.pngCOMMENT
LOWtests/pytorch/test_models_layout.py181COMMENT
LOWdocs/source/conf.py1# Copyright (C) 2021-2026, Mindee.COMMENT
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdoctr/utils/geometry.py561 # Add the crop to the list of cropsCOMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdoctr/models/factory/hub.py124### Example usage:COMMENT