akshaybahadur21 / Facial-Recognition-using-Facenet

A simple implementation of facial recognition using facenets for humans 🧔 🔍
MIT License
280 stars 143 forks source link

need your help here!!!! #5

Open arorasahil1234 opened 6 years ago

arorasahil1234 commented 6 years ago

C:\Users\Facial-Recognition-using-Facenet-master>python rec-feat.py C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using TensorFlow backend. 2018-06-13 13:17:08.655028: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 C:\Users\AppData\Local\Continuum\anaconda3\lib\site-packages\keras\engine\saving.py:270: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually. warnings.warn('No training configuration found in save file: ' Total Params: 3743280 Traceback (most recent call last): File "rec-feat.py", line 112, in recognize() File "rec-feat.py", line 103, in recognize extract_face_info(img, img_rgb, database,ear) File "rec-feat.py", line 59, in extract_face_info name, min_dist = recognize_face(image, database) File "rec-feat.py", line 44, in recognize_face if int(identity) <=4: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

arorasahil1234 commented 6 years ago

now this error any inputs/suggestions??

Total Params: 3743280 OpenCV(3.4.1) Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in cv::resize, file C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\imgproc\src\resize.cpp, line 4044 Traceback (most recent call last): File "rec-feat.py", line 112, in recognize() File "rec-feat.py", line 82, in recognize database = initialize() File "rec-feat.py", line 77, in initialize database[identity] = fr_utils.img_path_to_encoding(file, FRmodel) File "C:\Users\sahil.d.arora\Desktop\beacon\face recog live python\Facial-Recognition-using-Facenet-master\fr_utils.py", line 194, in img_path_to_encoding return img_to_encoding(img1, model) File "C:\Users\sahil.d.arora\Desktop\beacon\face recog live python\Facial-Recognition-using-Facenet-master\fr_utils.py", line 198, in img_to_encoding image = cv2.resize(image, (96, 96)) cv2.error: OpenCV(3.4.1) C:\bld\opencv_1520732670222\work\opencv-3.4.1\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize

Pratiko3 commented 6 years ago

OpenCV(3.4.1) D:\Build\OpenCV\opencv-3.4.1\modules\imgproc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize help me

SulleyOne commented 6 years ago

Any luck on the resizing problem anyone?

arorasahil1234 commented 6 years ago

No Buddy , the recognizing part is not working :(

JishinK commented 6 years ago

function cv::resize problem arises here because of the path. I got stuck here because I forgot to add the trailing slash.

TRAIN_DIR = '../input/train/' I had forgotten to add the last forward slash and got this error.

gazambuja commented 6 years ago

Just change the line 29 from:

def recognize_face(face_descriptor, database):
    encoding = img_to_encoding(face_descriptor, FRmodel)
    min_dist = 100
    identity = None

to:

def recognize_face(face_descriptor, database):
    encoding = img_to_encoding(face_descriptor, FRmodel)
    min_dist = 100
    identity = 0
SaravananJaichandar commented 5 years ago

Traceback (most recent call last): File "rec-feat.py", line 112, in recognize() File "rec-feat.py", line 82, in recognize database = initialize() File "rec-feat.py", line 77, in initialize database[identity] = fr_utils.img_path_to_encoding(file, FRmodel) File "/Users/saravananjaichandar/Downloads/Facial-Recognition-using-Facenet-master/fr_utils.py", line 194, in img_path_to_encoding return img_to_encoding(img1, model) File "/Users/saravananjaichandar/Downloads/Facial-Recognition-using-Facenet-master/fr_utils.py", line 198, in img_to_encoding image = cv2.resize(image, (96, 96)) cv2.error: OpenCV(4.1.0) /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/resize.cpp:3718: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

Did anyone solved this issue ? Please help ! @arorasahil1234 @Pratiko3 @SulleyOne @JishinK

parasjain-12 commented 5 years ago

Try saving the picture in images folder by number not by name