class_docstr: Base Dataset class for Image datasets.
class_docstr_tok: ["Base","Dataset","class","for","Image","datasets","."]
docstr: Reads a PIL image.
  
  Args:
      path: Path of image file.
  
  Returns:
      If there are no exceptions (e.g., because of corrupted images), PIL Image is
      returned. Otherwise, None.
code: def read_image_pil(path: str) -> Optional[Image.Image]:
      """Reads a PIL image.
  
      Args:
          path: Path of image file.
  
      Returns:
          If there are no exceptions (e.g., because of corrupted images), PIL Image is
          returned. Otherwise, None.
      """
      try:
          return Image.open(path).convert("RGB")
      except:
          # for any runtime exception while reading an image (typically arises from
          # corrupted images), we return None.
          return None
  
imports: from __future__ import annotations
  import argparse
  from abc import ABC
  from typing import Any, Dict, Optional, TypedDict
  import torch
  from PIL import Image
  from torch.utils import data
  from data.transforms import BaseTransformation
  from data.video_reader import get_video_reader
  from utils import logger
label_desc: Use image node_id 1 for calling the BaseImageDataset obj's underlying member method code with example usage: obj.read_image_pil(path) and returns: Image, None