def load_image_from_path(image):
    """loads an image into PIL from a string path that is
    either local or a url
    Args:
        image (str): _description_
    Raises:
        ValueError: _description_
    Returns:
        ImageType: _description_
    """
    
    if os.path.isfile(image):
        img = Image.open(image)
    elif validators.url(image):
        img = Image.open(requests.get(image, stream=True).raw)
    else:
        raise ValueError(f"input str of {image} is not a local file or a valid url")

    return img
loads an image into PIL from a string path that is
    either local or a url
    Args:
        image (str): _description_
    Raises:
        ValueError: _description_
    Returns:
        ImageType: _description_
    
examples/ImageSearchLocalization/app.py