code: def add(self, label, img, is_image=True):
      # img should be BGR
      # if self.sis:
      #    assert label>=self.last_label
      idx = self.widx
      self.widx += 1
      header = mx.recordio.IRHeader(0, label, idx, 0)
      if is_image:
          s = mx.recordio.pack_img(
              header, img, quality=95, img_fmt=".jpg"
          )
      else:
          s = mx.recordio.pack(header, img)
      self.writer.write_idx(idx, s)
      if self.label_stat[0] < 0:
          self.label_stat = [label, label]
      else:
          self.label_stat[0] = min(self.label_stat[0], label)
          self.label_stat[1] = max(self.label_stat[1], label)
  
file_path: insightface/recognition/subcenter_arcface/common/rec_builder.py
imports: import os
  import sys
  import mxnet
  from mxnet import ndarray
  import random
  import argparse
  import cv2
  import time
  import sklearn
  import numpy
label_desc: Use image node_id 2 for calling the SeqRecBuilder obj's underlying member method code with example usage: obj.add(label, img, is_image) without return types