def crop(image, bboxes, crop_size):
    """ center crop image and bboxes
        cropped shape is min(im_shape, crop_shape)

        Args:
            image (np.array): [h, w, c]
            crop_size (list of length 4): cropped size [starty, startx, h, w] must be small than image size
            bboxes: [n_bbox, 4] xyxy

        Returns:
            cropped image and bboxes
    """
    s_y, s_x, h, w = crop_size
    cropped_im = image[s_y: s_y + h, s_x: s_x + w]
    bboxes[..., [0, 2]] = bboxes[..., [0, 2]] - s_x
    bboxes[..., [1, 3]] = bboxes[..., [1, 3]] - s_y
    return cropped_im, bboxes