code: def fromfile(cls, filename, max_num_proposals):
      print("Reading proposals from file ({}) ...".format(filename))
      with open(filename) as f:
          lines = f.readlines()
  
      proposal_list = [[] for _ in lines]
      index = 0
      cut_counter = 0
      for line in lines:
          # parse line
          numbers = line[line.find("|") + 11 :]
          parsed_numbers = np.fromstring(numbers, dtype=int, sep=" ")
          parsed_rects = parsed_numbers.reshape(
              (int(parsed_numbers.shape[0] / 4), 4)
          )
          num_rects = parsed_rects.shape[0]
          if num_rects > max_num_proposals:
              rects = parsed_rects[:max_num_proposals, :]
              cut_counter += 1
          else:
              pad_rects = np.zeros((max_num_proposals - num_rects, 4))
              rects = np.vstack([parsed_rects, pad_rects])
          proposal_list[index] = rects
          index += 1
  
      print(
          "Done. {} images had more than {} proposals.".format(
              cut_counter, max_num_proposals
          )
      )
      return cls(proposal_list)
  
imports: import os, sys
  import numpy
  import cv2
  from utils.rpn.bbox_transform import bbox_transform
  from utils.cython_modules.cython_bbox import bbox_overlaps
label_desc: Use image node_id 2 for calling the ProposalProvider obj's underlying member method code with example usage: obj.fromfile(cls, filename, max_num_proposals) and returns: cls