code: def inference(cls, architecture_name, architecture, path, image_path):
      if cls.sanity_check(architecture_name):
          import caffe
          import numpy as np
  
          net = caffe.Net(architecture[0], architecture[1], caffe.TEST)
  
          func = TestKit.preprocess_func["caffe"][architecture_name]
          img = func(image_path)
          img = np.transpose(img, (2, 0, 1))
          img = np.expand_dims(img, 0)
          net.blobs["data"].data[...] = img
          predict = np.squeeze(net.forward()[net._output_list[-1]][0])
          predict = np.squeeze(predict)
          return predict
  
      else:
          return None
  
file_path: MMdnn/mmdnn/conversion/examples/caffe/extractor.py
imports: from __future__ import absolute_import
  import os
  from mmdnn.conversion.examples.imagenet_test import TestKit
  from mmdnn.conversion.examples.extractor import base_extractor
  from mmdnn.conversion.common.utils import download_file
label_desc: Use image node_id 2 for calling the caffe_extractor obj's underlying member method code with example usage: obj.inference(cls, architecture_name, architecture, path, image_path) and returns: predict, None