code: def __init__(
      self, frames, is_cropped, crop_size, root, batch_size, world_size
  ):
      self.root = root
      self.frames = frames
      self.is_cropped = is_cropped
      self.crop_size = crop_size
  
      self.files = glob(os.path.join(self.root, "*/*.png"))
  
      if len(self.files) < 1:
          print(("[Error] No image files in %s" % (self.root)))
          raise LookupError
  
      self.files = sorted(self.files)
  
      self.total_frames = 0
      # Find start_indices for different folders
      self.start_index = [0]
      prev_folder = self.files[0].split("/")[-2]
      for i, f in enumerate(self.files):
          folder = f.split("/")[-2]
          if i > 0 and folder != prev_folder:
              self.start_index.append(i)
              prev_folder = folder
              self.total_frames -= self.frames + 1
          else:
              self.total_frames += 1
      self.total_frames -= self.frames + 1
      self.start_index.append(i)
  
      if self.is_cropped:
          self.image_shape = self.crop_size
      else:
          self.image_shape = list(io.imread(self.files[0]).shape[:2])
  
      # Frames are enforced to be mod64 in each dimension
      # as required by FlowNetSD convolutions
      self.frame_size = self.image_shape
      self.frame_size[0] = int(
          math.floor(self.image_shape[0] / 64.0) * 64
      )
      self.frame_size[1] = int(
          math.floor(self.image_shape[1] / 64.0) * 64
      )
  
      self.frame_buffer = np.zeros(
          (3, self.frames, self.frame_size[0], self.frame_size[1]),
          dtype=np.float32,
      )
  
file_path: DALI/docs/examples/use_cases/video_superres/dataloading/datasets.py
imports: import copy
  import sys, time, argparse, os, subprocess, shutil
  import math, numbers, random, bisect
  from random import Random
  from skimage import io, transform
  from os import listdir
  from os.path import join
  from glob import glob
  import numpy
  import torch
  import torch.utils.data
label_desc: Use image node_id 1 to create a new imageDataset object  with example: obj = imageDataset(frames, is_cropped, crop_size, root, batch_size, world_size)