def read_image(path):
    """Read image from given path.

    Args:
        path (str or Path): path to an image.

    Raises:
        FileNotFoundError when missing image file

    Returns:
        np.ndarray with image.
    """
    image = cv2.imread(str(path))

    if image is None:
        raise FileNotFoundError(f"There is no '{path}'!")

    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
    return image
Read image from given path.

    Args:
        path (str or Path): path to an image.

    Raises:
        FileNotFoundError when missing image file

    Returns:
        np.ndarray with image.
    
examples/detection/dataset.py