def crop_image(image, object_, crop_size=(40, 80), crop_loc=(0, 0)):
  """
  Crop the image:
    Args:
      image (numpy array) : numpy array (H,W,C)
      object (list): location of the bounding box and label (xmin, ymin, xmax, ymax, label)
      crop_size (tuple or list) : the desired crop size (W, H)
      crop_loc (tuple or list) : the desired location to crop (x, y)
    return:
      image_cropped (numpy array) : cropped image of specific demension (H,W,C)
      object_ (list) : location of the ground truth bounding boxes cropped 
  """
  # crop the image
  xmin, xmax = crop_loc[0], crop_loc[0]+crop_size[0]
  ymin, ymax = crop_loc[1], crop_loc[1]+crop_size[1]
  image_cropped =  image[ymin:ymax, xmin:xmax]
  for i in range(len(object_)):
    # crop the bounding box
    object_[i][0] = max(object_[i][0], xmin)
    object_[i][1] = max(object_[i][1], ymin)
    object_[i][2] = min(object_[i][2], xmax)
    object_[i][3] = min(object_[i][3], ymax)

  return image_cropped, object_