Open CryptoExchangeFR opened 6 years ago
I solved this by renaming my sample photos in /image as 1.jpg , 2.jpg ,...
Thank you for your answer. This problem seem solved but I have another one.
The script is running well until this error :
Using TensorFlow backend. 2018-06-09 10:19:50.205095: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 distance for 8 is 0.05880815 distance for 9 is 0.058217797 distance for 4 is 0.06353997 distance for 5 is 0.059023313 distance for 7 is 0.056130935 distance for 6 is 0.056679048 distance for 2 is 0.060995225 distance for 3 is 0.06437977 distance for 1 is 0.05674781 distance for 0 is 0.057453062 distance for 8 is 0.06155078 distance for 9 is 0.06023829 distance for 4 is 0.065031365 distance for 5 is 0.06051247 distance for 7 is 0.058396123 distance for 6 is 0.057917174 distance for 2 is 0.06269057 distance for 3 is 0.06579694 distance for 1 is 0.05870841 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) TypeError: 'NoneType' object is not iterable
Do you know how to fix this ?
Thanks again :)
This has more got to do again with the project has images in the image folder. 1-4 are type A and 5-8 are type B (class or person). But for my use case I would look at identifying individual user per set up I changed the code a little bit in recognize_face: the for loop in my case is like:
for (name, db_enc) in database.items():
#print(name)
# Compute L2 distance between the target "encoding" and the current "emb" from the database.
dist = np.linalg.norm(db_enc - encoding)
print('distance for' + str(name) + ' is ' + str(dist))
# If this distance is less than the min_dist, then set min_dist to dist, and identity to name
if min_dist < dist:
min_dist = dist
name = 'User_Name'
and the return looks like:
if dist < 0.1:
min_dist = dist
return name, dist
else:
return str('Unknown'), dist
You can adapt as per your need .
Traceback (most recent call last):
File "rec-feat.py", line 112, in
Assertion error resize function ! Can anyone help regarding this ? @sarkarsaikat @CryptoExchangeFR @akshaybahadur21
Check the value of 'image', most likely it has not been able to read the image.
if i want set two people name sean and leo What program do you want to write? if dist < 0.1: min_dist=dist return name,dist else: return str('Unknown'),dist
I run create_face.py to get picture of myself. I copy the picture directly in the images folder I created. (Do I need to keep the subfolder with the ID ?) Then I run rec-feat.py with python3 command.
'PierreX' represent the photo and their associated number.
Do you know how to solve it ?