Ask Your Question

How to re-train the classifiers for opencv_contrib text module

asked 2017-05-19 15:12:28 -0500

joshua101 gravatar image

The opencv_contrib has a text module that provides a sample classifier. It is found here

I am trying to find a way for me to re-train the classifier for my particular purposes. How can I generate the two XML files and provide them to the functions cv2.text.loadClassifierNM1 and cv2.text.loadClassifierNM2 ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-05-19 23:25:48 -0500

berak gravatar image

the training code is available from lluisgomes' github repo

edit flag offensive delete link more


Thank you. I believe I came across that, however, it provides no instructions and the README is not that much of a help either. Thats why I was looking for some help on how to get started with it

joshua101 gravatar imagejoshua101 ( 2017-05-20 05:37:55 -0500 )edit

it should work somehow like this:

cd erfilter_train-master
# this should generate a makefile:
cmake .

# this should build 4 progs, extract_featuresNM1,extract_featuresNM2, train_featuresNM1, train_featuresNM2

# build datasets:

# finally, train classifiers:
berak gravatar imageberak ( 2017-05-20 05:58:47 -0500 )edit


i tried my own dogfood, and encountered a problem, (opencv ml code changed), see, i guess, you will need to get my pr branch there (or apply fixes manually.


berak gravatar imageberak ( 2017-05-20 06:27:07 -0500 )edit

Thanks, I see the PR. I'll try it out. Thanks!

joshua101 gravatar imagejoshua101 ( 2017-05-20 06:36:30 -0500 )edit
Login/Signup to Answer

Question Tools



Asked: 2017-05-19 15:12:28 -0500

Seen: 165 times

Last updated: May 19 '17