code: def add(self, label, imgs):
      # img should be BGR
      assert label >= 0
      assert label > self.last_label
      assert len(imgs) > 0
      idflag = [self.widx, -1]
      for img in imgs:
          idx = self.widx
          self.widx += 1
          header = mx.recordio.IRHeader(0, label, idx, 0)
          if isinstance(img, np.ndarray):
              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)
      idflag[1] = self.widx
      self.identities.append(idflag)
      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)
      self.last_label = 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 RecBuilder obj's underlying member method code with example usage: obj.add(label, imgs) without return types