emotime icon indicating copy to clipboard operation
emotime copied to clipboard

Info about emo_detector_cli

Open mastiffs92 opened this issue 9 years ago • 23 comments

Hi , what is the image file path? I don't understand when I launch the script python for the training that passes as "image file path"? screenshot Thanks in advance for the answer!

mastiffs92 avatar Jan 21 '16 10:01 mastiffs92

Hi, The "image file path" refers to the location where the original images for training is located.

If you are using Extended Cohn-Kanade database there are four folders:

  1. The Images (extended-cohn-kanade-images.zip) - there are 593 sequences across 123 subjects which are FACS coded at the peak frame. All sequences are from the neutral face to the peak expression.
  2. The Landmarks (Landmarks.zip) - All sequences are AAM tracked with 68points landmarks for each image.
  3. The FACS coded files (FACS_labels.zip) - for each sequence (593) there is only 1 FACS file, which is the last frame (the peak frame). Each line of the file corresponds to a specific AU and then the intensity. An example is given below.
  4. The Emotion coded files (Emotion_labels.zip) - ONLY 327 of the 593 sequences have emotion sequences.

Then, 'image file path' refers to the first (1) and 'emotion folder' refers to fouth (4).

Hope this helps. Ernani Gottardo

egottardo avatar Jan 21 '16 12:01 egottardo

I thank you for the answer, you mean this folder screenshot but I will pass this path does not work screenshot1

mastiffs92 avatar Jan 21 '16 14:01 mastiffs92

When to Use python script everything works in the testing phase, only that I don't see how files .cpp are recalled. I'm very interested for educational purposes.

mastiffs92 avatar Jan 21 '16 14:01 mastiffs92

Excuse-me. I didn't observe that problem isn't in training phase (when creating new classification model). You are alread executing emo_detector_cli. In this case you should inform the path of one image. Below a figure of one test. captura de tela de 2016-01-21 15 28 13

egottardo avatar Jan 21 '16 18:01 egottardo

Thanks for the answer, now I will try again !

mastiffs92 avatar Jan 21 '16 20:01 mastiffs92

where am I wrong? screenshot2

mastiffs92 avatar Jan 22 '16 11:01 mastiffs92

It seems that the face was not locate by cbcl1 in the image. I'm also having trouble with cbcl1 in locating faces. I suggest that you test with another images or with haarcascade_frontalface_default.xml / haarcascade_frontalface_alt2.xml

egottardo avatar Jan 22 '16 12:01 egottardo

I have tested with your changes but situation isn't change. screenshot3

mastiffs92 avatar Jan 22 '16 13:01 mastiffs92

No idea? @egottardo

mastiffs92 avatar Jan 25 '16 09:01 mastiffs92

Try by adding some debug prints in facepreprocessor, to understand why it fails. Keep in mind also that you face has an hat. This can be a problem

On Mon, Jan 25, 2016 at 10:34 AM mastiffs92 [email protected] wrote:

No idea? @egottardo https://github.com/egottardo

— Reply to this email directly or view it on GitHub https://github.com/luca-m/emotime/issues/65#issuecomment-174449363.

dbellavista avatar Jan 25 '16 09:01 dbellavista

ok I will try , thanks.

mastiffs92 avatar Jan 25 '16 10:01 mastiffs92

Its strange! For me it's working fine, but i'm using the model with 1vsallext. I suggest that you try with a model trained with 1vsallext.

egottardo avatar Jan 25 '16 15:01 egottardo

OK Thanks! I will try!

mastiffs92 avatar Jan 25 '16 16:01 mastiffs92

even i am getting the same error while using 1vsallext, Any ways too solve this problem

r-sreesaran avatar Jan 27 '16 16:01 r-sreesaran

@r-sreesaran Also with models 1_vs _all_ext you have same problems?

mastiffs92 avatar Jan 27 '16 18:01 mastiffs92

@mastiffs92 the error was happening because i was using .jpg file but now after running the below command, it throws up a error

./emo_detector_cli svm ../resources/haarcascade_frontalface_default.xml ../resources/haarcascade_eye.xml 52 52 1 5 8 ../compiled/dataset_svm_354_cbcl1_1vsall/classifiers/* Insert the image file path: /root/github/emotime/datasets/classifiers/svm/S032_002_01351426.png

OpenCV Error: Bad argument (The SVM should be trained first) in CvSVM::predict, file /root/essentials/opencv/opencv-2.4.9/modules/ml/src/svm.cpp, line 2131 terminate called after throwing an instance of 'cv::Exception' what(): /root/essentials/opencv/opencv-2.4.9/modules/ml/src/svm.cpp:2131: error: (-5) The SVM should be trained first in function CvSVM::predict

Note i am using the compiled version of binaries for linux

r-sreesaran avatar Jan 27 '16 23:01 r-sreesaran

I use the format of image file path '.png' and also i am using the compiled version of binaries for linux.

mastiffs92 avatar Jan 28 '16 08:01 mastiffs92

I am sorry but I am getting the following error. If you can kindly guide me out of it, that would be so awesome. What am I doing wrong? This is happening with both the master and the experimental version. I have also tried changing the parameters. I am using CK extended database files as the input image.

dell@gandalf:~/Desktop/emotime/emotime-1.2-experimental/assets$ ./emo_detector_cli svm ../resources/haarcascade_frontalface_default.xml ../resources/haarcascade_eye.xml 53 53 1 5 8 ../../svm_1vsallext_1_5_8_95c2eb0b58/*.xml
Insert the image file path: 
/home/dell/Downloads/cohn-kanade-images/S045/001/S045_001_00000001.png
Processing '/home/dell/Downloads/cohn-kanade-images/S045/001/S045_001_00000001.png'
OpenCV Error: Sizes of input arguments do not match (The sample size is different from what has been used for training) in cvPreparePredictData, file /home/dell/OpenCV/modules/ml/src/inner_functions.cpp, line 1114
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/dell/OpenCV/modules/ml/src/inner_functions.cpp:1114: error: (-209) The sample size is different from what has been used for training in function cvPreparePredictData

Aborted (core dumped)

sailsolar avatar Feb 28 '16 16:02 sailsolar

In my tests, this error occured when the parameters WIDTH HEIGHT NWIDTHS NLAMBDAS NTHETAS (in your case 53 53 1 5 8) are different from the trainning phase.

egottardo avatar Feb 29 '16 17:02 egottardo

@egottardo Yes you are right. I got it working after choosing the exact same parameter values for which the classifiers were trained on. Thank you for your support.

sailsolar avatar Mar 01 '16 13:03 sailsolar

@egottardo @husnain-ahmad I tried with the same parameters as in the configuration file used to train the system. Following is the command I used :

./emo_detector_cli svm ../resources/haarcascade_frontalface_default.xml ../resources/haarcascade_eye.xml 32 32 1 5 6 /home/rajat/Downloads/emotime-master/dataset/classifiers/svm/*.xml

Insert the image file path: 
/home/rajat/Desktop/My_Project/google_004.jpg

But here is the error I am getting :

Processing '/home/rajat/Desktop/My_Project/google_004.jpg'
OpenCV Error: Assertion failed (dsize.area() || (inv_scale_x > 0 && inv_scale_y > 0)) in resize, file /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/imgwarp.cpp, line 1825
terminate called after throwing an instance of 'cv::Exception'
  what():  /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/imgwarp.cpp:1825: error: (-215) dsize.area() || (inv_scale_x > 0 && inv_scale_y > 0) in function resize

Aborted

It is working fine though with the CK+ database images in the png formats. Please help

rajat70595 avatar Mar 29 '17 08:03 rajat70595

try scaling the google image(s) to the resolution CK+ images have :))

colceagus avatar Mar 29 '17 09:03 colceagus

I found the same problem with some small images. Since I did not have time to investigate the problem i temporarily manually increased the images.

egottardo avatar Mar 29 '17 12:03 egottardo