how can train file for face recognition

asked 2018-06-04 23:52:44 -0600

kishan patel gravatar image

Hello, Actually, when i try to train data from video file, sometimes it can train properly and can recognize face properly. But some times by using same video file and same code, could not train data properly. Here i can see the facedata.xml file which contain some garbage/unexpected value.So,it affect when recognize the face. I could not find proper reason behind this.Please guide me to get proper way.

Regards, Kishan Patel.

edit retag flag offensive close merge delete


Please improve your question. Your steps must be presented completely and succinctly, so that your results may be simply and easily repeated by a person trying to understand and answer your question. You'll need a URL pointing to example input data, a precise description of the erroneous output, a discussion of the expected output, and you need to include (in text form) any code.

opalmirror gravatar imageopalmirror ( 2018-06-05 13:54:07 -0600 )edit

Okay, let I share a link from which I have used the source code.

From above link source code can get by downloading "" file. I this code image file can get by webcam, which I had changed and get video file.

Now, from this video, I have trained the face and then generate the "facedata.xml" file. The Issue is that sometimes data has trained properly and sometimes not. It can be understood by checking "facedata.xml" file.

I am sharing both "facedata.xml" file which contains proper data and another which contain some unexpected data like as "nan" instead of a float value.

kishan patel gravatar imagekishan patel ( 2018-06-06 00:59:37 -0600 )edit

link text

Before use this file, first rename it by use extension ".xml".


kishan patel gravatar imagekishan patel ( 2018-06-06 01:10:01 -0600 )edit

Some feedback:

  • I should clarify myself, that you would edit your question and append the new information to it.
  • The facedata.xml link you provided does not contain actual file data, it points (as a file:// link) to a file on your hard disk, rather than one others can see on the internet.
  • It seems to me your question is not so much about OpenCV itself (for example, a test program that is part of the OpenCV project), and is more about an application that links with OpenCV... in which case you will probably get more and better help from the people who provided the face recognition application source code, than from this forum, which has the narrow scope of the OpenCV core code and related tests (not even much about the opencv_contrib project).
opalmirror gravatar imageopalmirror ( 2018-06-06 14:14:02 -0600 )edit

while shervin has done some amazing pioneer work there, that code is entirely outdated today, and problems with that may no more be relevant.

berak gravatar imageberak ( 2018-06-07 00:45:28 -0600 )edit

Hello Berak. So, which code should i follow. Is there any reference code which could i implement?

Regards, Kishan Patel.

kishan patel gravatar imagekishan patel ( 2018-06-08 06:33:16 -0600 )edit

@kishan, how comes you did not see this or this ?

berak gravatar imageberak ( 2018-06-08 06:40:15 -0600 )edit

Okay, Actually i have using one EVM board and there is opencv 3.1 has been installed. So, how can i do face recognition with this version. Because, i had tried to install some library but i could not.

Regards, Kishan Patel.

kishan patel gravatar imagekishan patel ( 2018-06-08 08:14:51 -0600 )edit

update your opencv , and try the dnn

berak gravatar imageberak ( 2018-06-08 08:20:58 -0600 )edit