Ask Your Question

how to store bag of words vocabulary efficiently?

asked 2014-12-01 03:09:34 -0600

noobproof gravatar image

Hello All,

I am training my system against Partially Annotated Databases The Caltech Database given here

I am using "bag of words" algorithm for vocabulary building and detection. My YML file is huge. So everytime I pass an image for detection the ~65MB yml file is loaded and then the object is detected. How can I do it more efficiently ?? Or is there some other way to store the vocabulary ??

I am badly stuck at it please help!!

Thanks in advance. Aditi K

edit retag flag offensive close merge delete


your link does not work for me...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-12-01 05:59:29 -0600 )edit
noobproof gravatar imagenoobproof ( 2014-12-01 23:37:18 -0600 )edit

this one works. Anyway, I knew what was it about, I have also used it

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-12-02 02:08:03 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-01 06:20:06 -0600

thdrksdfthmn gravatar image

I would proceed like this:

  • When starting the application, do an initialization where you are loading the needed files (like the vocabulary and classifier files). This should be done only once at the beginning. Then, for every image you want to process, you'll have the data you'll need. For example, this can be done in the constructor of the class (or in a global variable, if you are not using OOP, which is not so good).
  • I think using .xml will be smaller than the .yaml/.yml. I have done some tests (in the same idea: saving vocabulary of BOW) and in my cases it was always smaller.
edit flag offensive delete link more

Question Tools


Asked: 2014-12-01 03:09:34 -0600

Seen: 412 times

Last updated: Dec 01 '14