def test_img(im, net, base_image_size, means):
  # Resize image
  im_orig = im.astype(np.float32, copy=True)
  im_orig -= means
  
  im, gr, grr = upsample_image(im_orig, base_image_size)
  im = np.transpose(im, axes = (2, 0, 1))
  im = im[np.newaxis, :, :, :]
  
  # Pass into Caffe
  net.forward(data=im.astype(np.float32, copy=False))

  # Get outputs and return them
  mil_prob= net.blobs['mil'].data.copy()
  sc = net.blobs['mil_max'].data.copy()

  # reshape appropriately
  mil_prob = mil_prob.reshape((1, mil_prob.size))
  sc = sc.reshape((1, sc.size))
  return sc, mil_prob
Calls Caffe to get output for this image
dataset/ETHPy150Open s-gupta/visual-concepts/test_model.py/test_img