class_docstr: Implements an abstract preprocessor object which performs casting, resizing, batching and normalization.
  
  Args:
  ----
      output_size: expected size of each page in format (H, W)
      batch_size: the size of page batches
      mean: mean value of the training distribution by channel
      std: standard deviation of the training distribution by channel
class_docstr_tok: ["Implements","an","abstract","preprocessor","object","which","performs","casting",",","resizing",",","batching","and","normalization",".","Args",":","--","--","output_size",":","expected","size","of","each","page","in","format","(","H",",","W",")","batch_size",":","the","size","of","page","batches","mean",":","mean","value","of","the","training","distribution","by","channel","std",":","standard","deviation","of","the","training","distribution","by","channel"]
code: def __init__(
      self,
      output_size: Tuple[int, int],
      batch_size: int,
      mean: Tuple[float, float, float] = (0.5, 0.5, 0.5),
      std: Tuple[float, float, float] = (1.0, 1.0, 1.0),
      fp16: bool = False,
      **kwargs: Any,
  ) -> None:
      super().__init__()
      self.batch_size = batch_size
      self.resize: T.Resize = Resize(output_size, **kwargs)
      # Perform the division by 255 at the same time
      self.normalize = T.Normalize(mean, std)
  
file_path: doctr/doctr/models/preprocessor/pytorch.py
imports: import math
  from typing import Any, List, Tuple, Union
  import numpy
  import torch
  from torch import nn
  from torchvision.transforms import functional
  from torchvision.transforms import transforms
  from doctr.transforms import Resize
  from doctr.utils.multithreading import multithread_exec
label_desc: Use image node_id 1 to create a new PreProcessor object from inherited base classes: nn with example: obj = PreProcessor(output_size, batch_size, mean, std, fp16)