
    jD                     b    d dl mZ ddlmZmZ ddgZ G d de          Z G d de          ZdS )	    )default_collate   )_CharacterGenerator_WordGeneratorCharacterGeneratorWordGeneratorc                   $     e Zd ZdZd fdZ xZS )r   a  Implements a character image generation dataset

    >>> from doctr.datasets import CharacterGenerator
    >>> ds = CharacterGenerator(vocab='abdef', num_samples=100)
    >>> img, target = ds[0]

    Args:
        vocab: vocabulary to take the character from
        num_samples: number of samples that will be generated iterating over the dataset
        cache_samples: whether generated images should be cached firsthand
        font_family: font to use to generate the text images
        img_transforms: composable transformations that will be applied to each image
        sample_transforms: composable transformations that will be applied to both the image and the target
    returnNc                 f     t                      j        |i | t          | dt                     d S )N
collate_fn)super__init__setattrr   )selfargskwargs	__class__s      c/var/www/html/Carbon-Document/venv/lib/python3.11/site-packages/doctr/datasets/generator/pytorch.pyr   zCharacterGenerator.__init__   s7    $)&)))lO44444    )r
   N)__name__
__module____qualname____doc__r   __classcell__)r   s   @r   r   r      sG         5 5 5 5 5 5 5 5 5 5r   c                       e Zd ZdZdS )r   a/  Implements a character image generation dataset

    >>> from doctr.datasets import WordGenerator
    >>> ds = WordGenerator(vocab='abdef', min_chars=1, max_chars=32, num_samples=100)
    >>> img, target = ds[0]

    Args:
        vocab: vocabulary to take the character from
        min_chars: minimum number of characters in a word
        max_chars: maximum number of characters in a word
        num_samples: number of samples that will be generated iterating over the dataset
        cache_samples: whether generated images should be cached firsthand
        font_family: font to use to generate the text images
        img_transforms: composable transformations that will be applied to each image
        sample_transforms: composable transformations that will be applied to both the image and the target
    N)r   r   r   r    r   r   r   r   "   s         " 	Dr   N)torch.utils.data._utils.collater   baser   r   __all__r   r   r   r   r   <module>r       s    < ; ; ; ; ; 5 5 5 5 5 5 5 5
15 5 5 5 5, 5 5 5*	 	 	 	 	N 	 	 	 	 	r   