Ask Your Question
0

Train from haarcascade frontface

asked 2020-06-26 11:08:43 -0600

willmendil gravatar image

Hi, this must be a question that is often asked, but I cannot find an answer nor intructions on how to.

Is it possible to train a cascade model from the already train haarcascade frontface default? My goal is for the script to recognise specific people (i.e. me). I know there is a recongniser built in opencv, but it is quite slow on a raspberry pi compared to a cascade xml.

I am tryingto train a model from scratch, but with mixed results.

thanks

(ps: I'll also post this question on stackoverflow)

edit retag flag offensive close merge delete

Comments

I know there is a recongniser built in opencv, but it is quite slow on a raspberry pi

you must be doing something wrong

berak gravatar imageberak ( 2020-06-26 11:26:44 -0600 )edit

Really? what fps should I be expected? I got barely a couple.. I followed this post https://towardsdatascience.com/real-t...

willmendil gravatar imagewillmendil ( 2020-06-26 12:12:38 -0600 )edit
1

how large are your crops ? most time will be spent in feature extraction

if those are significantly larger than say100x100 -- resize to some thing smaller

I got barely a couple..

yea, but you also got those weird sleep() and (blocking) GPIO calls in there, once you detect something, so no fair measuring possible

berak gravatar imageberak ( 2020-06-26 12:22:29 -0600 )edit

humm, interesting, much better frame rate, now I just need to deal with the latency.

willmendil gravatar imagewillmendil ( 2020-06-26 12:33:43 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2020-06-26 11:18:28 -0600

berak gravatar image

updated 2020-06-26 11:46:50 -0600

no, you cannot do that.

while you can stop and restart your own training, and it will restart at the last stage computed before, you will need the whole original data (the "vec" file, remember ?) and all the previous (temporary) stage cascades

you don't have this data, so -- no way.

I am tryingto train a model from scratch, but with mixed results.

yea, you need tons of positives for this, might need 5k+ to get better than the prebuilt cascades

My goal is for the script to recognise specific people

no, that won't work, either,

you need face recognition (who is it?) and this does face detection (face or not, and where ?)

(you probably try to train a cascade per person, just forget it, it's proven not to work)

edit flag offensive delete link more

Comments

that's what I don't understand in the lexicon, what do you mean be "prebuilt cascades"

willmendil gravatar imagewillmendil ( 2020-06-26 11:30:43 -0600 )edit
1

prebuilt cascades

like the haarcascade_frontalface.xml that comes with opencv

berak gravatar imageberak ( 2020-06-26 11:43:39 -0600 )edit

"(you probably try to train a cascade per person, just forget it, it's proven not to work)" Yep that was exactly what I had in mind. Thanks for the heads-up. Any references? ok I see what you mean by prebuilt. Thanks very much, that was very insightful

willmendil gravatar imagewillmendil ( 2020-06-26 12:09:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-06-26 11:08:43 -0600

Seen: 670 times

Last updated: Jun 26 '20