Advertisement
dark5x

python 2.7 / cv2 face recognition connected to sqlite3

Feb 17th, 2020
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. i have this code
  2.  
  3. profile=getProfile(Id)
  4.        
  5.         if(profile!=None):
  6.            
  7.             cv2.cv.PutText(cv2.cv.fromarray(img),"Name:"+str(profile[1]),(x,y+h+30),font,color);
  8.             cv2.cv.PutText(cv2.cv.fromarray(img),"Age:"+str(profile[2]),(x,y+h+60),font,color);
  9.             cv2.cv.PutText(cv2.cv.fromarray(img),"Gender:"+str(profile[3]),(x,y+h+90),font,color);
  10.             cv2.cv.PutText(cv2.cv.fromarray(img),"Role:"+str(profile[4]),(x,y+h+120),font,color);
  11.             #-----------------------------
  12.             time_log();
  13.         else:
  14.             cv2.cv.PutText(img,"Unknown",(x,y+h+30),font,color);
  15. it's for face recognition  with sqlite3 and cv2
  16.  
  17.  
  18. it work good but if there is person/face that doesn't exists in DB it gone put a last person info on him how can i fix this ?
  19.  
  20.  
  21. else:
  22.             cv2.cv.PutText(img,"Unknown",(x,y+h+30),font,color);
  23. this part doesn't work correctly how can i fix that?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement