1 回答

TA貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個(gè)贊
現(xiàn)在我會(huì)說(shuō)實(shí)話,我不知道這是否更有效,而且它肯定更復(fù)雜,但我試了一下:
shape_left_eye = face_landmarks['left_eye']
l = [
shape_left_eye[i][j] if j != 1 else
shape_left_eye[i][j] - 5 for i in
range(4) for j in range(2)
]
shape_right_eye = face_landmarks['right_eye']
r = [
shape_right_eye[i][j] if j != 1 else
shape_right_eye[i][j] - 5 for i in
range(4) for j in range(2)
]
d.line([(l[0],l[1]),(l[2],l[3]),(l[4],l[5]),(l[6],l[7])], fill=(0, 0, 0, 175), width=6)
d.line([(r[0],r[1]),(r[2],r[3]),(r[4],r[5]),(r[6],r[7])], fill=(0, 0, 0, 175), width=6)
這有幫助嗎?更重要的是它是否有效,因?yàn)闆](méi)有您的設(shè)置我無(wú)法測(cè)試它。
添加回答
舉報(bào)