doctr.contrib

This module contains all the available contribution modules for docTR.

Supported contribution modules

Here are all the available contribution modules:

class doctr.contrib.ArtefactDetector(arch: str = 'yolov8_artefact', batch_size: int = 2, model_path: str | None = None, labels: List[str] | None = None, input_shape: Tuple[int, int, int] | None = None, conf_threshold: float = 0.5, iou_threshold: float = 0.5, **kwargs: Any)[source]

A class to detect artefacts in images

>>> from doctr.io import DocumentFile
>>> from doctr.contrib.artefacts import ArtefactDetector
>>> doc = DocumentFile.from_images(["path/to/image.jpg"])
>>> detector = ArtefactDetector()
>>> results = detector(doc)
Parameters:
  • arch – the architecture to use

  • batch_size – the batch size to use

  • model_path – the path to the model to use

  • labels – the labels to use

  • input_shape – the input shape to use

  • mask_labels – the mask labels to use

  • conf_threshold – the confidence threshold to use

  • iou_threshold – the intersection over union threshold to use

  • **kwargs – additional arguments to be passed to download_from_url