python_code stringlengths 0 456k |
|---|
import numpy as np
import pytest
import torch
from doctr.models.preprocessor import PreProcessor
@pytest.mark.parametrize(
"batch_size, output_size, input_tensor, expected_batches, expected_value",
[
[2, (128, 128), np.full((3, 256, 128, 3), 255, dtype=np.uint8), 1, 0.5], # numpy uint8
[2, (... |
import os
import pytest
from torch import nn
from doctr.models.utils import conv_sequence_pt, load_pretrained_params
def test_load_pretrained_params(tmpdir_factory):
model = nn.Sequential(nn.Linear(8, 8), nn.ReLU(), nn.Linear(8, 4))
# Retrieve this URL
url = "https://github.com/mindee/doctr/releases/dow... |
import numpy as np
import pytest
from torch import nn
from doctr import models
from doctr.io import Document, DocumentFile
from doctr.io.elements import KIEDocument
from doctr.models import detection, recognition
from doctr.models.detection.predictor import DetectionPredictor
from doctr.models.kie_predictor import KIE... |
import os
import tempfile
import onnxruntime
import pytest
import torch
from doctr.models import recognition
from doctr.models.recognition.crnn.pytorch import CTCPostProcessor
from doctr.models.recognition.master.pytorch import MASTERPostProcessor
from doctr.models.recognition.predictor import RecognitionPredictor
fr... |
import math
import numpy as np
import pytest
import torch
from doctr.transforms import (
ChannelShuffle,
ColorInversion,
GaussianNoise,
RandomCrop,
RandomHorizontalFlip,
RandomRotate,
RandomShadow,
Resize,
)
from doctr.transforms.functional import crop_detection, rotate_sample
def te... |
from doctr.file_utils import is_torch_available
def test_file_utils():
assert is_torch_available()
|
import numpy as np
import pytest
import torch
from doctr.io import decode_img_as_tensor, read_img_as_tensor, tensor_from_numpy
def test_read_img_as_tensor(mock_image_path):
img = read_img_as_tensor(mock_image_path)
assert isinstance(img, torch.Tensor)
assert img.dtype == torch.float32
assert img.sha... |
import pytest
import torch
from doctr.models import obj_detection
@pytest.mark.parametrize(
"arch_name, input_shape, pretrained",
[
["fasterrcnn_mobilenet_v3_large_fpn", (3, 512, 512), True],
["fasterrcnn_mobilenet_v3_large_fpn", (3, 512, 512), False],
],
)
def test_detection_models(arch_... |
import os
import tempfile
import numpy as np
import onnxruntime
import pytest
import torch
from doctr.file_utils import CLASS_NAME
from doctr.models import detection
from doctr.models.detection._utils import dilate, erode
from doctr.models.detection.predictor import DetectionPredictor
from doctr.models.utils import e... |
import os
import tempfile
import cv2
import numpy as np
import onnxruntime
import pytest
import torch
from doctr.models import classification
from doctr.models.classification.predictor import CropOrientationPredictor
from doctr.models.utils import export_model_to_onnx
def _test_classification(model, input_shape, ou... |
import os
from shutil import move
import numpy as np
import pytest
import torch
from torch.utils.data import DataLoader, RandomSampler
from doctr import datasets
from doctr.file_utils import CLASS_NAME
from doctr.transforms import Resize
def _validate_dataset(ds, input_size, batch_size=2, class_indices=False, is_po... |
import json
import os
import tempfile
import pytest
from doctr import models
from doctr.models.factory import _save_model_and_config_for_hf_hub, from_hub, push_to_hf_hub
def test_push_to_hf_hub():
model = models.classification.resnet18(pretrained=False)
with pytest.raises(ValueError):
# run_config a... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
__version__ = '0.6.1a0'
|
from . import io, datasets, models, transforms, utils
from .file_utils import is_tf_available, is_torch_available
from .version import __version__ # noqa: F401
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Adapted from https://github.com/huggingface/transformers/blob/master/src/transformers/file_utils.py
import importlib.util
import ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from pathlib import Path
from typing import Any, List, Tuple
from .datasets import AbstractDataset
__all__ =... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import glob
import os
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from PIL import Image
from scipy import i... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from typing import Any, Dict, List, Tuple, Type, Union
import numpy as np
from doctr.file_utils import CLASS... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from tqdm import... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from typing import Any, List, Tuple
from tqdm import tqdm
from .datasets import AbstractDataset
__all__ = ["MJSynth"]
... |
from doctr.file_utils import is_tf_available
from .generator import *
from .cord import *
from .detection import *
from .doc_artefacts import *
from .funsd import *
from .ic03 import *
from .ic13 import *
from .iiit5k import *
from .imgur5k import *
from .mjsynth import *
from .ocr import *
from .recognition import *
... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from typing import Any, Dict, List, Tuple
import numpy as np
from .datasets import VisionDataset
__all__ = ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from typing import Any, Dict, List, Tuple, Union
import h5py
import numpy as np
from tqdm import tqdm
from .datasets imp... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from typing import Any, Dict, List, Tuple, Union
import numpy as np
import scipy.io as sio
from tqdm import tqdm
from .d... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import glob
import json
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import cv2
import numpy... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import csv
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from tqdm import ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple
import numpy as np
from .datasets import ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from typing import Any, Dict, List, Tuple, Union
import defusedxml.ElementTree as ET
import numpy as np
from tqdm import ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import string
import unicodedata
from collections.abc import Sequence
from functools import partial
from pathlib import Path
from ty... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import math
from typing import Callable, Optional
import numpy as np
import tensorflow as tf
from doctr.utils.multithreading impor... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import string
from typing import Dict
__all__ = ["VOCABS"]
VOCABS: Dict[str, str] = {
"digits": string.digits,
"ascii_let... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import json
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from tqdm import... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import csv
import os
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
import numpy as np
from tqdm import ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from typing import Any, Dict, List, Tuple, Union
import defusedxml.ElementTree as ET
import numpy as np
from tqdm import ... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from copy import deepcopy
from typing import Any, List, Tuple
import numpy as np
import tensorflow as tf
from doctr.io i... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
from copy import deepcopy
from typing import Any, List, Tuple
import numpy as np
import torch
from doctr.io import read_... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import os
import shutil
from pathlib import Path
from typing import Any, Callable, List, Optional, Tuple, Union
import numpy as np
... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import tensorflow as tf
from .base import _CharacterGenerator, _WordGenerator
__all__ = ["CharacterGenerator", "WordGenerator"]
... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from torch.utils.data._utils.collate import default_collate
from .base import _CharacterGenerator, _WordGenerator
__all__ = ["Char... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import random
from typing import Any, Callable, List, Optional, Tuple, Union
from PIL import Image, ImageDraw
from doctr.io.image ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Dict, List, Optional, Tuple, Union
from defusedxml import defuse_stdlib
defuse_stdlib()
from xml.etree imp... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any
from weasyprint import HTML
__all__ = ["read_html"]
def read_html(url: str, **kwargs: Any) -> bytes:
... |
from .elements import *
from .html import *
from .image import *
from .pdf import *
from .reader import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from pathlib import Path
from typing import Any, List, Optional
import numpy as np
import pypdfium2 as pdfium
from doctr.utils.com... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from pathlib import Path
from typing import List, Sequence, Union
import numpy as np
from doctr.utils.common_types import Abstract... |
from doctr.file_utils import is_tf_available, is_torch_available
from .base import *
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Tuple
import numpy as np
import tensorflow as tf
from PIL import Image
if tf.__version__ >= "2.6.0":
from t... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from io import BytesIO
from typing import Tuple
import numpy as np
import torch
from PIL import Image
from torchvision.transforms.f... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from pathlib import Path
from typing import Optional, Tuple
import cv2
import numpy as np
from doctr.utils.common_types import Abs... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Dict, List, Optional, Tuple
import cv2
import numpy as np
from scipy.optimize import linear_sum_assignment
from ... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from pathlib import Path
from typing import List, Tuple, Union
__all__ = ["Point2D", "BoundingBox", "Polygon4P", "Polygon", "Bbox"]... |
from .common_types import *
from .data import *
from .geometry import *
from .metrics import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import colorsys
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple, Union
import cv2
import matplotlib.pa... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Adapted from https://github.com/pytorch/torch/blob/master/torch/nn/modules/module.py
from typing import List
__all__ = ["NestedO... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from math import ceil
from typing import List, Optional, Tuple, Union
import cv2
import numpy as np
from... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import logging
import platform
from typing import Optional
from PIL import ImageFont
__all__ = ["get_font"]
def get_font(font_fa... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Adapted from https://github.com/pytorch/vision/blob/master/torchvision/datasets/utils.py
import hashlib
import logging
import os
... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import multiprocessing as mp
import os
from multiprocessing.pool import ThreadPool
from typing import Any, Callable, Iterable, Iter... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any
from .detection.zoo import detection_predictor
from .kie_predictor import KIEPredictor
from .predictor impor... |
from . import artefacts
from .classification import *
from .detection import *
from .recognition import *
from .zoo import *
from .factory import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Dict, Optional
from doctr.utils.repr import NestedObject
__all__ = ["BaseModel"]
class BaseModel(Nested... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Dict, List, Optional, Tuple
import numpy as np
from scipy.cluster.hierarchy import fclusterdata
from doct... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from math import floor
from statistics import median_low
from typing import Any, Dict, List, Optional, Tuple, Union
import cv2
impo... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, List
from doctr.file_utils import is_tf_available
from .. import classification
from ..preprocessor import... |
from .mobilenet import *
from .resnet import *
from .vgg import *
from .magc_resnet import *
from .vit import *
from .zoo import *
|
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import math
from copy import deepcopy
from functools import partial
from typing import Any, Dict, List, Optional, Tuple
import tens... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import math
from copy import deepcopy
from functools import partial
from typing import Any, Dict, List, Optional, Tuple
import tor... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Greatly inspired by https://github.com/pytorch/vision/blob/master/torchvision/models/mobilenetv3.py
from copy import deepcopy
fro... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
# Greatly inspired by https://github.com/pytorch/vision/blob/master/torchvision/models/mobilenetv3.py
from copy import deepcopy
fro... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Tuple
import tensorflow as tf
from tensorflow.ker... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Callable, Dict, List, Optional, Tuple
from torch import nn
from torchvision.mode... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Dict, Optional, Tuple
import tensorflow as tf
from tensorflow.keras import Sequen... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
import torch
from torch import nn
from doctr.dataset... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List, Union
import numpy as np
import tensorflow as tf
from tensorflow import keras
from doctr.models.preproces... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List, Union
import numpy as np
import torch
from torch import nn
from doctr.models.preprocessor import PreProce... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Dict, List, Optional, Tuple
from tensorflow.keras import layers
from tensorflow.k... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from copy import deepcopy
from typing import Any, Dict, List, Optional
from torch import nn
from torchvision.models import vgg as t... |
from .barcode import *
from .face import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List, Tuple
import cv2
import numpy as np
__all__ = ["BarCodeDetector"]
class BarCodeDetector:
"""Implem... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List, Tuple
import cv2
import numpy as np
from doctr.utils.repr import NestedObject
__all__ = ["FaceDetector"]... |
from doctr.file_utils import is_tf_available
if is_tf_available():
from .tensorflow import *
else:
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Dict, List, Union
import numpy as np
import tensorflow as tf
from doctr.io.elements import Document
from d... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Dict, List, Union
import numpy as np
import torch
from torch import nn
from doctr.io.elements import Docum... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, Optional
from doctr.models.builder import KIEDocumentBuilder
from ..classification.predictor import CropOr... |
from doctr.file_utils import is_tf_available, is_torch_available
if is_tf_available():
from .tensorflow import *
elif is_torch_available():
from .pytorch import * # type: ignore[assignment]
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import logging
import os
from typing import Any, Callable, List, Optional, Tuple, Union
from zipfile import ZipFile
import tensorfl... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
import logging
from typing import Any, List, Optional
import torch
from torch import nn
from doctr.utils.data import download_from... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import Any, List
from doctr.file_utils import is_tf_available
from doctr.models.preprocessor import PreProcessor
from ... |
from .crnn import *
from .master import *
from .sar import *
from .vitstr import *
from .zoo import *
|
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List, Tuple
import numpy as np
from doctr.datasets import encode_sequences
from doctr.utils.repr import NestedO... |
# Copyright (C) 2021-2023, Mindee.
# This program is licensed under the Apache License 2.0.
# See LICENSE or go to <https://opensource.org/licenses/Apache-2.0> for full license details.
from typing import List
from rapidfuzz.string_metric import levenshtein
__all__ = ["merge_strings", "merge_multi_strings"]
def m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.