Ask Your Question

Revision history [back]

Giving Arbitrary value in Face ID in face Verification from webcam

Hello, i am facing problem while recognizing unknown faces. Code works fine on known face but when i give unknown face it is giving true label when it false. also thereafter kmown face ID is getting changed every time

Everything working fine on my face. but problem occurs while i am testing it on faces which was not trained. below is code i am using for comparing the image:

while True: ret, im =cam.read() gray=cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) faces=faceCascade.detectMultiScale(im, 1.3,5) for(x,y,w,h) in faces: cv2.rectangle(gray,(x,y),(x+w,y+h),(255,0,0),2) sampleNum=sampleNum+1 Id, conf = recognizer.predict(gray[y:y+h,x:x+w]) if(conf<50): Statusvalue=1 print(Id) break

I saved the image in ID:1, it gives correct result before trying with unknown face but thereafter it gives arbitrary ID value say,40, 50, 10 etc.

Please assist me for getting correct ID

Giving Arbitrary value in Face ID in face Verification from webcam

Hello, i am facing problem while recognizing unknown faces. Code works fine on known face but when i give unknown face it is giving true label when it false. also thereafter kmown face ID is getting changed every time

Everything working fine on my face. but problem occurs while i am testing it on faces which was not trained. below is code i am using for comparing the image:

while True:
                ret, im =cam.read()
                gray=cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
                faces=faceCascade.detectMultiScale(im, 1.3,5)
                for(x,y,w,h) in faces:
                    cv2.rectangle(gray,(x,y),(x+w,y+h),(255,0,0),2)
                    sampleNum=sampleNum+1
                    Id, conf = recognizer.predict(gray[y:y+h,x:x+w])
                    if(conf<50):
                            Statusvalue=1
                            print(Id)
                            break

break

I saved the image in ID:1, it gives correct result before trying with unknown face but thereafter it gives arbitrary ID value say,40, 50, 10 etc.

Please assist me for getting correct ID