def central_crop(img, crop_size):
  """Makes central crop of a given size.

  Args:
    img: image
    crop_size: tuple of integers representing the crop height and width

  Returns:
    cropped image
  """
  in_rows, in_cols = img.shape[-3:-1]
  crop_rows, crop_cols = crop_size
  d_rows = (in_rows - crop_rows) // 2
  d_cols = (in_cols - crop_cols) // 2
  img_crop = img[..., d_rows:d_rows + crop_rows, d_cols:d_cols + crop_cols, :]
  return img_crop
Makes central crop of a given size.

  Args:
    img: image
    crop_size: tuple of integers representing the crop height and width

  Returns:
    cropped image
  
videogvt/train_lib/metrics_lib.py