def check_bbox_in_image(bbox, img_shape):
    """Ensure that all annotations are in the image and start at pixel 1 at a minimum
    
    Args:
        bbox (list) : list of [x_min, y_min, x_max, y_max]
        img_shape (tup) : shape of image in the form: (y, x, channels)
    
    Returns:
        bbox (list) : list of cleaned [x_min, y_min, x_max, y_max]
    """
    # check to be sure all coordinates start at at least pixel 1 (required by faster rcnn)
    for i in range(len(bbox)):
        if bbox[i] <= 1.0:
            bbox[i] = 1.0
    # check that the x_max and y_max are in the photo's dimensions
    if bbox[2] >= img_shape[1]: # x_max
        bbox[2] = img_shape[1]-1
    if bbox[3] >= img_shape[0]: # y_max
        bbox[3] = img_shape[0]-1
        
    return bbox