code: def extract_features(self):
      image_dir = self.args.image_dir
      if os.path.isfile(image_dir):
          features, infos = self.get_detectron_features([image_dir])
          self._save_feature(image_dir, features[0], infos[0])
      else:
          files = get_image_files(
              self.args.image_dir,
              exclude_list=self.args.exclude_list,
              start_index=self.args.start_index,
              end_index=self.args.end_index,
              output_folder=self.args.output_folder,
          )
  
          finished = 0
          total = len(files)
  
          for chunk, begin_idx in chunks(files, self.args.batch_size):
              features, infos = self.get_detectron_features(chunk)
              for idx, file_name in enumerate(chunk):
                  self._save_feature(
                      file_name, features[idx], infos[idx]
                  )
              finished += len(chunk)
  
              if finished % 200 == 0:
                  print(f"Processed {finished}/{total}")
  
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 9 for calling the FeatureExtractor obj's underlying member method code with example usage: obj.extract_features() without return types