I would like to report another bug issue after I found the first issue in the face
module.
Error message
.../opencv_contrib-3.4.6/modules/face/src/facemarkLBF.cpp:337: error: (-5:Bad argument) The parameter cascade_face and model_filename should be set! in function 'training'
System information (version)
- OpenCV => 3.4.6
- Operating System / Platform => Ubuntu Desktop 18.04 64bit
- Compiler => g++
Detailed description
It also happened when I used my own face dectector to train a face landmark model through FacemarkLBF
. This code, params.cascade_face.empty()
in the following snippet excerpted from the function FacemarkLBFImpl::training
in the file facemarkLBF.cpp
, wants to guard cascade model file used for face detection.
// line 335-337
if (params.cascade_face.empty() || (params.model_filename.empty() && params.save_model))
{
CV_Error(Error::StsBadArg, "The parameter cascade_face and model_filename should be set!");
}
That's unnecessary because it is already in the training stage, so checking the dependency used for face detection stage which is already done is no use anymore for current implementation and unfortunately causes a bug for face detection methods that don't have an individual model file to set. Some methods embed the model file in their source codes. At last, it's safe to remove this check, params.cascade_face.empty()
.
Please someone confirms if I am right..