code: def extract_feature(model, dataloaders, ctx):
      count = 0
      features = []
      for img, _ in dataloaders:
          n = img.shape[0]
          count += n
          print(count)
          ff = np.zeros((n, 2048))
          for i in range(2):
              if i == 1:
                  img = fliplr(img)
              f = (
                  model(img.as_in_context(ctx))
                  .as_in_context(mx.cpu())
                  .asnumpy()
              )
              ff = ff + f
          features.append(ff)
      features = np.concatenate(features)
      return features / np.linalg.norm(features, axis=1, keepdims=True)
  
file_path: gluon-cv/scripts/re-id/baseline/test.py
imports: from __future__ import print_function, division
  import mxnet
  import numpy
  from mxnet import gluon, nd
  from mxnet.gluon import nn
  from mxnet.gluon.data.vision import transforms
  from networks import resnet18, resnet34, resnet50
  import gluoncv
  from gluoncv.data.market1501.data_read import ImageTxtDataset
  import time, os, sys
  import scipy.io
  from os import path
label_desc: Use image node_id 4 for calling a global function with example usage: extract_feature(model, dataloaders, ctx) and returns: unknown