code: def extract(model_root, dataset):
      model = ArcFaceORT(model_path=model_root)
      model.check()
      feat_mat = np.zeros(shape=(len(dataset), 2 * model.feat_dim))
  
      def collate_fn(data):
          return torch.cat(data, dim=0)
  
      data_loader = DataLoader(
          dataset,
          batch_size=128,
          drop_last=False,
          num_workers=4,
          collate_fn=collate_fn,
      )
      num_iter = 0
      for batch in data_loader:
          batch = batch.numpy()
          batch = (batch - model.input_mean) / model.input_std
          feat = model.session.run(
              model.output_names, {model.input_name: batch}
          )[0]
          feat = np.reshape(feat, (-1, model.feat_dim * 2))
          feat_mat[
              128 * num_iter : 128 * num_iter + feat.shape[0], :
          ] = feat
          num_iter += 1
          if num_iter % 50 == 0:
              print(num_iter)
      return feat_mat
  
imports: import argparse
  import os
  import pickle
  import timeit
  import cv2
  import mxnet
  import numpy
  import pandas
  import prettytable
  import skimage.transform
  import torch
  from sklearn.metrics import roc_curve
  from sklearn.preprocessing import normalize
  from torch.utils.data import DataLoader
  from onnx_helper import ArcFaceORT
label_desc: Use image node_id 1 for calling a global function with example usage: extract(model_root, dataset) and returns: feat_mat, torch