emotime
emotime copied to clipboard
Info about emo_detector_cli
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"?
Thanks in advance for the answer!
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:
- 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.
- The Landmarks (Landmarks.zip) - All sequences are AAM tracked with 68points landmarks for each image.
- 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.
- 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
I thank you for the answer,
you mean this folder
but I will pass this path does not work
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.
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.
Thanks for the answer, now I will try again !
where am I wrong?
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
I have tested with your changes but situation isn't change.
No idea? @egottardo
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.
ok I will try , thanks.
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.
OK Thanks! I will try!
even i am getting the same error while using 1vsallext, Any ways too solve this problem
@r-sreesaran Also with models 1_vs _all_ext you have same problems?
@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
I use the format of image file path '.png' and also i am using the compiled version of binaries for linux.
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)
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 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.
@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
try scaling the google image(s) to the resolution CK+ images have :))
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.