def METHOD_NAME(self, im_data, im_info):
    if (self.h - im_data.shape[1] < 0) or (self.w - im_data.shape[2] < 0):
        raise ValueError('Input image should have the resolution of {}x{} or less, '
                         'got {}x{}.'.format(self.w, self.h, im_data.shape[2], im_data.shape[1]))
    im_data = np.pad(im_data, ((0, 0),
                               (0, self.h - im_data.shape[1]),
                               (0, self.w - im_data.shape[2])),
                     mode='constant', constant_values=0).reshape(1, self.c, self.h, self.w)
    feed_dict = {self.input_tensor_name: im_data}
    if im_info is not None:
        im_info = im_info.reshape(1, *im_info.shape)
        feed_dict['im_info'] = im_info
    self.infer_request.infer(feed_dict)
    if self.segmentoly_type:
        output = {name: self.infer_request.get_tensor(name).data[:] for name in self.output_keys_segmentoly}
        valid_detections_mask = output['classes'] > 0
        classes = output['classes'][valid_detections_mask]
        boxes = output['boxes'][valid_detections_mask]
        scores = output['scores'][valid_detections_mask]
        masks = output['raw_masks'][valid_detections_mask]
    else:
        output = {name: self.infer_request.get_tensor(name).data[:] for name in self.output_keys}
        valid_detections_mask = np.sum(output['boxes'], axis=1) > 0
        classes = output['labels'][valid_detections_mask] + 1
        boxes = output['boxes'][valid_detections_mask][:, :4]
        scores = output['boxes'][valid_detections_mask][:, 4]
        masks = output['masks'][valid_detections_mask]
    return boxes, classes, scores, np.full(len(classes), 0, dtype=np.int32), masks