class_docstr: Loader that extracts text from images
code: def __init__(
      self,
      path_images: Union[str, List[str]] = None,
      layout_aware=False,
      gpu_id=None,
  ):
      super().__init__(path_images)
      self._ocr_model = None
      self.layout_aware = layout_aware
      self.gpu_id = (
          gpu_id if isinstance(gpu_id, int) and gpu_id >= 0 else 0
      )
  
      self.device = "cpu"
      # ensure self.device set
      self.set_context()
  
imports: from typing import List, Union, Any, Tuple, Optional
  import requests
  import torch
  from langchain.docstore.document import Document
  from langchain.document_loaders import ImageCaptionLoader
  import numpy
  from utils import get_device, clear_torch_cache, NullContext
  from doctr.utils.common_types import AbstractFile
label_desc: Use image node_id 1 to create a new H2OOCRLoader object from inherited base classes: ImageCaptionLoader with example: obj = H2OOCRLoader(path_images, layout_aware, gpu_id)