def chunk_image(image: Union[str, ImageType], device: str, 
                        method: Literal[ 'simple', 'overlap',  'frcnn', 'marqo-yolo', 'yolox', 'dino-v1', 'dino-v2'],
                        size=get_default_size()) -> Tuple[List[ImageType], List[float]]:
    """_summary_
    wrapper function to do the chunking and return the patches and their bounding boxes
    in the original coordinates system

    Args:
        image (Union[str, ImageType]): image to process
        device (str): device to load models onto
        method (str, optional): the method to use. Defaults to 'simple'.
        size (_type_, optional): size the image should be loaded in as. Defaults to get_default_size().

    Raises:
        TypeError: _description_
        ValueError: _description_
        ChunkerError: Raises ChunkerError, if the chunker can't work for some reason

    Returns:
        Tuple[List[ImageType], List[float]]: list of PIL images and the corresponding bounding boxes
    """

    HN = 3
    WN = 3

    if method in [None, 'none', '', "None", ' ']:
        if isinstance(image, str):
            return [image],[image]      
        elif isinstance(image, ImageType):
            return [image], [(0, 0, image.size[0], image.size[1])]
        else:
            raise TypeError(f'only pointers to an image or a PIL image are allowed. received {type(image)}')
    
    # get the parameters from the method 'url'
    method, params = _process_patch_method(method)
    logger.debug(f"found method={method} and params={params}")

    # format the paramters to pass through
    hn = int(params.get('hn', HN))
    wn = int(params.get('wn', WN))
    nms = str2bool(params.get('nms', 'True'))
    filter_bb = str2bool(params.get('filter_bb', 'True'))

    if method == 'simple':
        patch = PatchifySimple(size=size, hn=hn, wn=wn)

    elif method == 'overlap':
        patch = PatchifySimple(size=size, hn=hn, wn=wn, 
        overlap=True)
    
    elif method in ['fastercnn', 'frcnn']:
        patch = PatchifyPytorch(device=device, size=size, nms=nms, filter_bb=filter_bb)

    elif method in ['marqo-yolo', 'yolox']:
        patch = PatchifyYolox(device=device, size=size)
    
    elif method in ['dino-v1', 'dino-v2', 'dino/v1', 'dino/v2']:
        if 'v1' in method:
            patch = PatchifyViT(device=device, filter_bb=True, size=size,
                        attention_method='abs', nms=True, replace_small=True)
        else:
            patch = PatchifyViT(device=device, filter_bb=True, size=size,
                        attention_method='pos', nms=True, replace_small=True)
    else:
        raise ValueError(f"unexpected image chunking type. found {method}")
    try:
        patch.infer(image)
        patch.process()
    except PIL.UnidentifiedImageError as e:
        raise ChunkerError from e

    return patch.patches, patch.bboxes_orig
_summary_
    wrapper function to do the chunking and return the patches and their bounding boxes
    in the original coordinates system

    Args:
        image (Union[str, ImageType]): image to process
        device (str): device to load models onto
        method (str, optional): the method to use. Defaults to 'simple'.
        size (_type_, optional): size the image should be loaded in as. Defaults to get_default_size().

    Raises:
        TypeError: _description_
        ValueError: _description_
        ChunkerError: Raises ChunkerError, if the chunker can't work for some reason

    Returns:
        Tuple[List[ImageType], List[float]]: list of PIL images and the corresponding bounding boxes
    
src/marqo/s2_inference/processing/image.py