class_docstr: IMGUR5K dataset from `"TextStyleBrush: Transfer of Text Aesthetics from a Single Example"
  <https://arxiv.org/abs/2106.08385>`_ |
  `repository <https://github.com/facebookresearch/IMGUR5K-Handwriting-Dataset>`_.
  
  .. image:: https://doctr-static.mindee.com/models?id=v0.5.0/imgur5k-grid.png&src=0
      :align: center
      :width: 630
      :height: 400
  
  >>> # NOTE: You need to download/generate the dataset from the repository.
  >>> from doctr.datasets import IMGUR5K
  >>> train_set = IMGUR5K(train=True, img_folder="/path/to/IMGUR5K-Handwriting-Dataset/images",
  >>>                     label_path="/path/to/IMGUR5K-Handwriting-Dataset/dataset_info/imgur5k_annotations.json")
  >>> img, target = train_set[0]
  >>> test_set = IMGUR5K(train=False, img_folder="/path/to/IMGUR5K-Handwriting-Dataset/images",
  >>>                    label_path="/path/to/IMGUR5K-Handwriting-Dataset/dataset_info/imgur5k_annotations.json")
  >>> img, target = test_set[0]
  
  Args:
  ----
      img_folder: folder with all the images of the dataset
      label_path: path to the annotations file of the dataset
      train: whether the subset should be the training one
      use_polygons: whether polygons should be considered as rotated bounding box (instead of straight ones)
      recognition_task: whether the dataset should be used for recognition task
      **kwargs: keyword arguments from `AbstractDataset`.
code: def _read_from_folder(self, path: str) -> None:
      for img_path in glob.glob(os.path.join(path, "*.png")):
          with open(
              os.path.join(
                  path, f"{os.path.basename(img_path)[:-4]}.txt"
              ),
              "r",
          ) as f:
              self.data.append((img_path, f.read()))
  
file_path: doctr/doctr/datasets/imgur5k.py
imports: import glob
  import json
  import os
  from pathlib import Path
  from typing import Any, Dict, List, Tuple, Union
  import cv2
  import numpy
  from PIL import Image
  from tqdm import tqdm
  from .datasets import AbstractDataset
  from .utils import convert_target_to_relative, crop_bboxes_from_image
label_desc: Use image node_id 3 for calling the IMGUR5K obj's underlying member method code with example usage: obj._read_from_folder(path) without return types