code: def _image_transform(self, path):
      img = Image.open(path)
      im = np.array(img).astype(np.float32)
  
      if im.shape[-1] > 3:
          im = np.array(img.convert("RGB")).astype(np.float32)
  
      # IndexError: too many indices for array, grayscale images
      if len(im.shape) < 3:
          im = np.repeat(im[:, :, np.newaxis], 3, axis=2)
  
      im = im[:, :, ::-1]
      im -= np.array([102.9801, 115.9465, 122.7717])
      im_shape = im.shape
      im_height = im_shape[0]
      im_width = im_shape[1]
      im_size_min = np.min(im_shape[0:2])
      im_size_max = np.max(im_shape[0:2])
  
      # Scale based on minimum size
      im_scale = self.MIN_SIZE / im_size_min
  
      # Prevent the biggest axis from being more than max_size
      # If bigger, scale it down
      if np.round(im_scale * im_size_max) > self.MAX_SIZE:
          im_scale = self.MAX_SIZE / im_size_max
  
      im = cv2.resize(
          im,
          None,
          None,
          fx=im_scale,
          fy=im_scale,
          interpolation=cv2.INTER_LINEAR,
      )
      img = torch.from_numpy(im).permute(2, 0, 1)
  
      im_info = {"width": im_width, "height": im_height}
  
      return img, im_scale, im_info
  
imports: import argparse
  import os
  import cv2
  import numpy
  import torch
  from maskrcnn_benchmark.config import cfg
  from maskrcnn_benchmark.layers import nms
  from maskrcnn_benchmark.modeling.detector import build_detection_model
  from maskrcnn_benchmark.structures.image_list import to_image_list
  from maskrcnn_benchmark.utils.model_serialization import load_state_dict
  from mmf.utils.download import download
  from PIL import Image
  from tools.scripts.features.extraction_utils import chunks, get_image_files
label_desc: Use image node_id 5 for calling the FeatureExtractor obj's underlying member method code with example usage: obj._image_transform(path) and returns: img,  im_scale,  im_info