def __get_predict_args(image, ROI, return_predictions):
    """Helper function for formatting arguments given to the predict
    function."""
    if ROI is not None:
        if type(ROI) != tuple:
            raise TypeError("invalid type ROI for image: %s" % image)

        if len(ROI) != 4:
            raise TypeError("invalid length ROI for image: %s" % image)

    return image, not return_predictions, ROI