Ask Your Question
0

How to re-train the classifiers for opencv_contrib text module

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

joshua101 gravatar image

The opencv_contrib has a text module that provides a sample classifier. It is found here https://github.com/opencv/opencv_cont...

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
0

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

berak gravatar image

the training code is available from lluisgomes' github repo

edit flag offensive delete link more

Comments

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 -0600 )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
make

# build datasets:
python build_csv_datasetNM1.py
python build_csv_datasetNM1.py

# finally, train classifiers:
./train_classifierNM1
./train_classifierNM2
berak gravatar imageberak ( 2017-05-20 05:58:47 -0600 )edit

UPDATE:

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

GOOD LUCK !

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

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

joshua101 gravatar imagejoshua101 ( 2017-05-20 06:36:30 -0600 )edit

Question Tools

2 followers

Stats

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

Seen: 273 times

Last updated: May 19 '17