ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.21k stars 13.48k forks source link

face_encodings make the code slow #705

Open guozhaojian opened 5 years ago

guozhaojian commented 5 years ago

Description

when detection face in the use camera face_encodings will make the cv2.imshow() show the frame slow. and how can i make the code quick. i test to use the model='cnn', it is also slow

i test to cut some line to know what make it slow, and cause by face_encodings

guozhaojian commented 5 years ago

i want to use threading.Thread() to make a asynchronous task while True:

4-10 times cycle run one times face_encodings

threading.Thread(target=face_recognition.face_encodings, args=[frame_small, locations]).start()

but not work as my expected mind, current cycle will wait the thread finish, and i am not use .join()

donaldxu commented 5 years ago

if you want to use model='cnn', you need a gpu!