def METHOD_NAME(scores, classes, boxes, raw_cls_masks,
                im_h, im_w, im_scale_y=None, im_scale_x=None, im_scale=None,
                full_image_masks=True, encode_masks=False,
                confidence_threshold=0.0, segmentoly_type=False):
    no_detections = (np.empty((0, ), dtype=np.float32), np.empty((0, ), dtype=np.float32),
                     np.empty((0, 4), dtype=np.float32), [])
    if scores is None:
        return no_detections
    scale = im_scale
    if scale is None:
        assert (im_scale_x is not None) and (im_scale_y is not None)
        scale = [im_scale_x, im_scale_y, im_scale_x, im_scale_y]
    confidence_filter = scores > confidence_threshold
    scores = scores[confidence_filter]
    classes = classes[confidence_filter]
    boxes = boxes[confidence_filter]
    if raw_cls_masks is not None:
        raw_cls_masks = [segm for segm, is_valid in zip(raw_cls_masks, confidence_filter) if is_valid]
    if len(scores) == 0:
        return no_detections
    boxes = boxes / scale
    classes = classes.astype(np.uint32)
    if raw_cls_masks is not None:
        masks = []
        for box, cls, raw_mask in zip(boxes, classes, raw_cls_masks):
            raw_cls_mask = raw_mask[cls, ...] if segmentoly_type else raw_mask
            mask = segm_postprocess(box, raw_cls_mask, im_h, im_w, full_image_masks, encode_masks)
            masks.append(mask)
    else:
        masks = None
    return scores, classes, boxes, masks