import pickle


def load_keypoints_boxes(vid_path, i):
  """
  Given a video path, with .pkl file included, load the keypoints & boxes
  """
  keypoints = pickle.load(open(vid_path + "keypoints_vid"+str(i)+".pkl", "rb"))
  keypoints[:, 0, :] = keypoints[:, 0, :]*1.40625 + 280
  keypoints[:, 1, :] = keypoints[:, 1, :]*1.40625
  boxes = pickle.load(open(vid_path + "boxes_vid" + str(i) + ".pkl", "rb"))
  boxes = boxes.reshape(-1, 4)
  boxes[:, 0] = boxes[:, 0]*1.40625 + 280
  boxes[:, 1] = boxes[:, 1]*1.40625
  boxes[:, 2] = boxes[:, 2]*1.40625
  boxes[:, 3] = boxes[:, 3]*1.40625
  return keypoints, boxes