magwyz / pastec

Image recognition open source index and search engine
http://pastec.io
GNU Lesser General Public License v3.0
620 stars 175 forks source link

Loading the same index on different platforms #65

Open ecdeveloper opened 6 years ago

ecdeveloper commented 6 years ago

I indexed 300k images on a Linux box, then exported it to a file, and loaded that same index on a Mac machine.

Now, I'm running a search request looking up one of the images I indexed. When I requesting from Linux box, I get 2 matches with following scores - [606,100]. However, when I run that same request on my Mac machine - I get 1 match - [196.0]. Any idea why is that the case? I use the exact same visualWordsORB.dat in both environments.

abournier commented 6 years ago

I can't help with this possible issue, but I'm very interested by the code used/installed to run pastec on a Mac. What libraries are not the same from the Ubuntu tutorial ? Did you use Homebrew to install them ? Maybe I can run tests too on my Mac to see if there is a difference in search results.

magwyz commented 6 years ago

It may be because the accelerated structure to search in the list of visual words is randomized. On your Mac and on your Linux box, the random number generator is not the same, which could lead to different results. This needs to be more investigated. However, the first question would be if you used the same version of OpenCV on Linux and MacOS.

ecdeveloper commented 6 years ago

@abournier I cloned pastec repo on my Mac, and then installed all the deps. I basically used this article - https://electricarchaeology.ca/2016/05/17/getting-pastec-installed-on-mac/

@magwyz I'll get the OpenCV versions on both platforms and will post here later today.

ecdeveloper commented 6 years ago

Ok, Mac - opencv@3.4.1. Linux - opencv@3.2.0. Do you think few minor versions difference may impact the results so bad?

Also, I wonder, if the problem is the version - if I install the same version on mac - do I need to reindex all images? Or should I be good just loading the index into the memory and should be good to go?

abournier commented 6 years ago

Thanks for the link ecdeveloper ! I will try this soon.