OpenCV Training Custom Haar Cascade with Python 3
I am trying to train a haar cascade on my face. I have everything setup including the positive, negetive, the vec file, etc. but when I run the opencv_traincascade, it gave me a terminate called after throwing an instance of 'std::bad_alloc' error. Then I added this line to my arguments -nonsym -mem 512
and it gave me this error:terminate called after throwing an instance of 'std::logic_error'
.
Here is the command I am running:
opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt\
> -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000\
> -numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024\
> -precalcIdxBufSize 1024\
> -nonsym\
> -mem 512\
Any help would be greatly appreciated!
those are all c++ cmdline tools, python does not matter here
(sidenote: if you can still use those, you must be on an outdated opencv version)
you're out of memory
far too large, most likely the reason for being "out of memory"
no, it won't work.
and this is the real "bummer" in your question
it's a detection tool not a classification one. (you cannot train this for your face)
(you clearly misunderstood something here reason for downvote)