code: def __init__(
      self,
      open_images_root,
      batch_size: int,
      workers: int = 0,
      image_size: Optional[List[int]] = None,
      train_transform: Optional[Callable[[Image], Tensor]] = None,
      val_transform: Optional[Callable[[Image], Tensor]] = None,
      full_size: bool = False,
      use_async: bool = False,
      pin_memory: bool = True,
      val_batch_size: Optional[int] = None,
  ):
      super().__init__()
      self.open_images_root = Path(open_images_root)
      self.batch_size = batch_size
      self.val_batch_size = val_batch_size
      self.workers = workers
      self.full_size = full_size
      self.prepare_data_per_node = True
      self.use_async = use_async
      self.pin_memory = pin_memory
      self.logger = logging.getLogger(self.__class__.__name__)
      if train_transform is None:
          if image_size is None:
              raise ValueError(
                  "Must pass image_size if no train_transform."
              )
          self.train_transform = default_train_transform(image_size)
      else:
          self.train_transform = train_transform
      if val_transform is None:
          if image_size is None:
              raise ValueError(
                  "Must pass image_size if no val_transform."
              )
          self.val_transform = default_val_transform(image_size)
      else:
          self.val_transform = val_transform
  
file_path: NeuralCompression/projects/illm/open_images_datamodule.py
imports: import logging
  from pathlib import Path
  from typing import Callable, List, Optional
  from default_transforms import default_train_transform, default_val_transform
  from lightning.pytorch import LightningDataModule
  from PIL.Image import Image
  from torch import Tensor
  from torch.utils.data import DataLoader
  from neuralcompression.data import OpenImagesV6
label_desc: Use image node_id 1 to create a new OpenImagesDataModule object from inherited base classes: LightningDataModule with example: obj = OpenImagesDataModule(open_images_root, batch_size, workers, image_size, train_transform, val_transform, full_size, use_async, pin_memory, val_batch_size)