code: def __init__(
      self,
      batch_size,
      data_shape,
      path_imgrec=None,
      shuffle=False,
      aug_list=None,
      mean=None,
      rand_mirror=False,
      cutoff=0,
      color_jittering=0,
      images_filter=0,
      data_name="data",
      label_name="softmax_label",
      **kwargs,
  ):
      super(FaceImageIter, self).__init__()
      assert path_imgrec
      if path_imgrec:
          logging.info("loading recordio %s...", path_imgrec)
          path_imgidx = path_imgrec[0:-4] + ".idx"
          self.imgrec = recordio.MXIndexedRecordIO(
              path_imgidx, path_imgrec, "r"
          )  # pylint: disable=redefined-variable-type
          s = self.imgrec.read_idx(0)
          header, _ = recordio.unpack(s)
          if header.flag > 0:
              print("header0 label", header.label)
              self.header0 = (
                  int(header.label[0]),
                  int(header.label[1]),
              )
              # assert(header.flag==1)
              self.imgidx = list(range(1, int(header.label[0])))
              # self.imgidx = []
              # self.id2range = {}
              # self.seq_identity = range(int(header.label[0]), int(header.label[1]))
              # for identity in self.seq_identity:
              #  s = self.imgrec.read_idx(identity)
              #  header, _ = recordio.unpack(s)
              #  a,b = int(header.label[0]), int(header.label[1])
              #  count = b-a
              #  if count<images_filter:
              #    continue
              #  self.id2range[identity] = (a,b)
              #  self.imgidx += range(a, b)
              # print('id2range', len(self.id2range))
          else:
              self.imgidx = list(self.imgrec.keys)
          if shuffle:
              self.seq = self.imgidx
              self.oseq = self.imgidx
              print(len(self.seq))
          else:
              self.seq = None
  
      self.mean = mean
      self.nd_mean = None
      if self.mean:
          self.mean = np.array(self.mean, dtype=np.float32).reshape(
              1, 1, 3
          )
          self.nd_mean = mx.nd.array(self.mean).reshape((1, 1, 3))
  
      self.check_data_shape(data_shape)
      self.provide_data = [(data_name, (batch_size,) + data_shape)]
      self.batch_size = batch_size
      self.data_shape = data_shape
      self.shuffle = shuffle
      self.image_size = "%d,%d" % (data_shape[1], data_shape[2])
      self.rand_mirror = rand_mirror
      print("rand_mirror", rand_mirror)
      self.cutoff = cutoff
      self.color_jittering = color_jittering
      self.CJA = mx.image.ColorJitterAug(0.125, 0.125, 0.125)
      self.provide_label = [(label_name, (batch_size,))]
      c, h, w = self.data_shape
      self.batch_data = np.zeros(
          (batch_size, c, h, w), dtype=np.float32
      )
      self.batch_label = np.zeros(
          self.provide_label[0][1], dtype=np.float32
      )
      # print(self.provide_label[0][1])
      self.cur = 0
      self.nbatch = 0
      self.is_init = False
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import random
  import logging
  import sys
  import numbers
  import math
  import sklearn
  import datetime
  import numpy
  import cv2
  from config import config
  import mxnet
  from mxnet import ndarray
  from mxnet import io
  from mxnet import recordio
label_desc: Use image node_id 1 to create a new FaceImageIter object from inherited base classes: io with example: obj = FaceImageIter(batch_size, data_shape, path_imgrec, shuffle, aug_list, mean, rand_mirror, cutoff, color_jittering, images_filter, data_name, label_name)