def test_aligner():
print('test aligner:')
# load model
detector = Detector('SeetaFaceEngine/model/seeta_fd_frontal_v1.0.bin')
detector.set_min_face_size(30)
aligner = Aligner('SeetaFaceEngine/model/seeta_fa_v1.1.bin')
image_color = cv2.imread('data/chloecalmon.png', cv2.IMREAD_COLOR)
image_gray = cv2.cvtColor(image_color, cv2.COLOR_BGR2GRAY)
faces = detector.detect(image_gray)
for face in faces:
landmarks = aligner.align(image_gray, face)
for point in landmarks:
cv2.circle(image_color, point, 1, (0,255,0), 2)
cv2.imshow('test aligner', image_color)
cv2.waitKey(0)
aligner.release()
detector.release()
评论列表
文章目录