def l2_distance(pts1, pts2):
    """
    Args:
        pts1, pts2: float, (n_frames, n_points, 2)
    Return:
        float: total l2 distance of these frames
    """
    distance = 0
    for i in range(pts1.shape[0]):
        for j in range(pts1.shape[1]):
            distance += ((pts1[i][j][0] - pts2[i][j][0])*(pts1[i][j][0] - pts2[i][j][0]) + \
            (pts1[i][j][1] - pts2[i][j][1])*(pts1[i][j][1] - pts2[i][j][1]))
    return distance