anisayari/easy_facial_recognition

Error: object of type 'PosixPath' has no len()

Opened this issue · 1 comments

Hello world!

When I try to run e_f_r.py onto my MBP 10.13 using Conda env /tensorflow activate/Python3.5/ so ...

I got some troubles like following bellow :

FIRST ISSUE :
python3 easy_facial_recognition.py --i known_faces
[INFO] Starting System...
[INFO] Importing pretrained model..
[INFO] Importing pretrained model..
[INFO] Importing faces...
Traceback (most recent call last):
File "easy_facial_recognition.py", line 93, in
known_face_names = [os.path.splitext(ntpath.basename(file_))[0] for file_ in files]
...
...
...
/Users/sofiane/opt/lib/python3.5/ntpath.py", line 139, in splitdrive
if len(p) >= 2:
TypeError: object of type 'PosixPath' has no len()
////////////////////////////////////////////////////////////////////////////
I changed some value into my /lib/python3.5/ntpath.py", line 139
if len(p) >= 2: ------ to ----> change : if f: alim = f[-1]
I got :
python3 easy_facial_recognition.py --input known_faces
ImportError: numpy.core.multiarray failed to import
...
...
from .cv2 import *
ImportError: numpy.core.multiarray failed to import

So If someone can explain me more about this issue it will be great!
(*Ive also rewrite the good line 139)

after fews adjustments im still here now :

[INFO] Starting System...
[INFO] Importing pretrained model..
[INFO] Importing pretrained model..
[INFO] Importing faces...
Traceback (most recent call last):
File "easy_facial_recognition.py", line 92, in
raise ValueError('No faces detect in the directory: {}'.format(face_to_encode_path))
ValueError: No faces detect in the directory: /known_faces