def crop_pil(im, bbox):
    """
    Crop an image given a bounding box

    :param im: PIL.Image
    :param bbox: bounding box
    :return: PIL.Image, cropped image
    """
    if bbox:
        return im.crop(bbox)
    return im