def parse_pt2_from_pt9(pt9, use_lip=True):
    '''
    animal_face = {"keypoints": ['right eye right', 'right eye left', 'left eye right', 'left eye left', 'nose tip', 'lip right', 'lip left', 'upper lip', 'lower lip'], "skeleton": []}


    '''
    if use_lip:
        pt9 = np.stack([
            (pt9[2]+pt9[3])/2, # left eye
            (pt9[0]+pt9[1])/2, # right eye
            pt9[4],
            # (pt9[5]+pt9[6]+pt9[7]+pt9[8])/4 # lip
            (pt9[5] + pt9[6] ) / 2 # lip
        ], axis=0)
        pt2 = np.stack([
            (pt9[0] + pt9[1]) / 2, # eye
            pt9[3] # lip
        ], axis=0)
    else:
        pt2 = np.stack([
            (pt9[2] + pt9[3]) / 2,
            (pt9[0] + pt9[1]) / 2,
        ], axis=0)

    return pt2

    animal_face = {"keypoints": ['right eye right', 'right eye left', 'left eye right', 'left eye left', 'nose tip', 'lip right', 'lip left', 'upper lip', 'lower lip'], "skeleton": []}


    
liveportrait/utils/crop.py