class_docstr: A optimzied ImageFolder using libjpeg_turbo to load jpg images.
class_docstr_tok: ["A","optimzied","ImageFolder","using","libjpeg_turbo","to","load","jpg","images","."]
docstr: Create a ImageFolder.
  
  :param root: A string represting the root directory path.
  :param transform: A function/transform that takes in an ndarray image
      and returns a transformed version. E.g, ``transforms.RandomCrop``
  :param target_transform: A function/transform that takes in the
      target and transforms it.
docstr_tok: ["Create","a","ImageFolder",".",":","param","root",":","A","string","represting","the","root","directory","path",".",":","param","transform",":","A","function\/transform","that","takes","in","an","ndarray","image","and","returns","a","transformed","version",".","E.g",",","``","transforms.RandomCrop","``",":","param","target_transform",":","A","function\/transform","that","takes","in","the","target","and","transforms","it","."]
code: def __init__(
      self,
      root: str,
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
  ):
      """
      Create a ImageFolder.
  
      :param root: A string represting the root directory path.
      :param transform: A function/transform that takes in an ndarray image
          and returns a transformed version. E.g, ``transforms.RandomCrop``
      :param target_transform: A function/transform that takes in the
          target and transforms it.
      """
      super(ImageFolder, self).__init__(
          root, transform, target_transform
      )
      try:
          # it will fail if `libturbojpeg.so.0.2.0` doesn't exist
          # or load it on windows
          self.jpeg = TurboJPEG(lib_path=local_libturbo_path)
      except Exception as _e:
          warning(f"failed to load {local_libturbo_path}")
          self.jpeg = None
  
file_path: BigDL/python/nano/src/bigdl/nano/pytorch/vision/datasets/datasets.py
imports: from typing import Union, Callable, Optional
  from turbojpeg import TurboJPEG, TJPF_GRAY
  import torchvision
  import cv2
  import os
  import numpy
  import torch
  from logging import warning
  from os.path import split, join, realpath
label_desc: Use image node_id 1 to create a new ImageFolder object from inherited base classes: torchvision.datasets with example: obj = ImageFolder(root, transform, target_transform)