def crop_by_bbox(pil_image, bbox):
    """
    Crops the specified PIL image with the given bounding box
    :param pil_image: PIL image to crop
    :param bbox: bounding box object to crop by
    :return: PIL image cropped.
    """
    box = bbox.get_box()
    box[2] += box[0]
    box[3] += box[1]

    crop_result = pil_image.crop((box[0], box[1], box[2], box[3]))

    return crop_result