sainimohit23 / FaceNet-Real-Time-face-recognition

66 stars 42 forks source link

Testing fail #7

Closed ani16 closed 4 years ago

ani16 commented 4 years ago

Hi Mohit.

Used updated repo and it work. But my problem is when I trained the Model, checkpoint directory is created and weights are saved. But when I test the Model with command- “python webcamFaceRecoMulti.py”. It shows error-

Using TensorFlow backend. Trained model found Loading custom trained model… 2019–08–13 11:02:30.007665: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA /root/env/lib/python3.6/site-packages/keras/engine/saving.py:292: 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: ‘ (1, 3, 96, 96) (1, 3, 96, 96) (1, 3, 96, 96) (1, 3, 96, 96) (1, 3, 96, 96) (1, 3, 96, 96) VIDEOIO ERROR: V4L: can’t open camera by index 0 Traceback (most recent call last): File “webcamFaceRecoMulti.py”, line 103, in frame = imutils.resize(frame, width = 800) File “/root/env/lib/python3.6/site-packages/imutils/convenience.py”, line 69, in resize (h, w) = image.shape[:2] AttributeError: ‘NoneType’ object has no attribute ‘shape’

Screenshot is attached.

balajib363 commented 4 years ago

@ani16 check for images know! I am working using the same script and I am not facing any issue.

balajib363 commented 4 years ago

@sainimohit23 when running webcamFaceRecoMulti.py it's not drawing the results appropriately. can you please share an update on that same?

sainimohit23 commented 4 years ago

@BalajiB197 Program uses "Haar Cascade" algorithm to detect face coordinates. Check this line of code: " https://github.com/sainimohit23/FaceNet-Real-Time-face-recognition/blob/bf1357d040511e8aba8d306596fa97f7e5bab0c9/webcamFaceRecoMulti.py#L96 ". If you know any better algorithm then try to use it with this code.

sainimohit23 commented 4 years ago

@ani16 It seems like it has something to do with openCV in this line of code: https://github.com/sainimohit23/FaceNet-Real-Time-face-recognition/blob/bf1357d040511e8aba8d306596fa97f7e5bab0c9/webcamFaceRecoMulti.py#L95

Here 0 means we want to access webcam. But, in your case somehow program is not retrieving any image frame from webcam. That's why it is returning None.

ani16 commented 4 years ago

@Mohit , Balaji

Thanks for reply.

Sorry I dont have webcam right now. Is there any facility to run with offline videos(saved on system) or offline images.. what changes I need to make in codes.

Moreover I am trying with given images in Repo like Henry and Ben. Once It get tested successfully, I will train with my own dataset and test it.

balajib363 commented 4 years ago

@ani16 you can pass any video file path as input to your program. just replace 0 with 'video path' or 'RTSP link'

ani16 commented 4 years ago

Thanks for reply. This change(video path) is required at one place only.?

On Wed, 14 Aug 2019, 11:53 Balaji, notifications@github.com wrote:

@ani16 https://github.com/ani16 you can pass any video file path as input to your program. just replace 0 with 'video path' or 'RTSP link'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sainimohit23/FaceNet-Real-Time-face-recognition/issues/7?email_source=notifications&email_token=AFLNCW4TKMEPVH5WGYMAEKTQEOQGJA5CNFSM4ILHHI52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4H2AKY#issuecomment-521117739, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLNCWZ66AGHQIC5XJIRZMDQEOQGJANCNFSM4ILHHI5Q .

ani16 commented 4 years ago

One thing More, I trained Repo with given set of images, Henry and Ben. checkpoint directory is created. I want to test with that very images of Henry and Ben. Should I need to add image path instead of video path. At this place- '' just replace 0 with 'video path' or 'RTSP link' " ?

ani16 commented 4 years ago

Hey it works with video path. But it fails to detect and classify images. why this is so. I used pretrained model of FaceNet and performed detection on video of Ben (taking his images from cropped folder and created a short video) to test the model. But it fails and throws error -

henry : 0.67537445 3 (1, 3, 96, 96) ben : 0.82383454 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.66721743 3 (1, 3, 96, 96) ben : 0.8079582 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.69378686 3 (1, 3, 96, 96) ben : 0.84412855 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.6789233 3 (1, 3, 96, 96) ben : 0.8292798 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.69600886 3 (1, 3, 96, 96) ben : 0.84772164 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.6944892 3 (1, 3, 96, 96) ben : 0.85749876 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.6949351 3 (1, 3, 96, 96) ben : 0.8556409 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.70652777 3 (1, 3, 96, 96) ben : 0.84497267 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.7110802 3 (1, 3, 96, 96) ben : 0.8468099 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.7001207 3 (1, 3, 96, 96) ben : 0.8070818 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.72043705 3 (1, 3, 96, 96) ben : 0.78296345 3 (450, 800, 3) (1, 3, 96, 96) henry : 0.6969753 3 (1, 3, 96, 96) ben : 0.7893841 3 Traceback (most recent call last): File "webcamFaceRecoMulti.py", line 103, in frame = imutils.resize(frame, width = 800) File "/root/env/lib/python3.6/site-packages/imutils/convenience.py", line 69, in resize (h, w) = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'

please guide me.

ani16 commented 4 years ago

Hi

I tried with video, I gives poor result. Not recognising persons properly and infact I changed epochs to 50,it still stops at 6-10 epochs while training . Why is it so

On Mon, 19 Aug 2019, 15:42 sainimohit23, notifications@github.com wrote:

Closed #7 https://github.com/sainimohit23/FaceNet-Real-Time-face-recognition/issues/7 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sainimohit23/FaceNet-Real-Time-face-recognition/issues/7?email_source=notifications&email_token=AFLNCW5PDODG6XYWLYXB3VTQFJWYZA5CNFSM4ILHHI52YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOTDXJ2YA#event-2565774688, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLNCW2H7P7VA4TQD3NGRC3QFJWYZANCNFSM4ILHHI5Q .