rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

cairo #36

Closed Lvctao closed 8 years ago

Lvctao commented 8 years ago
  1. I am a fresher to Python. Why I encountered the problem "import cairo # pycairo ImportError: No module named 'cairo'" . Although I have installed cairo(https://www.cairographics.org/download/), I can not fix it yet! I run that on Mac OS X EI Capitan 10.11.4 .
  2. Do you have a more detailed guide than quick start and I really need it. If you have, please send it to my email(lvct807@126.com). Really thanks!
rhsimplex commented 8 years ago

Can you describe the install process you used? The latest version of image-match uses python 3...are you sure you're using the right interpreter?

Does pip install cairosvg work?

Lvctao commented 8 years ago

This is the example in quick start, a TypeError "TypeError: unorderable types: dict() > dict()" occured when I run it. Have you ever encountered this problem?

from image_match.elasticsearch_driver import SignatureES es = Elasticsearch() ses = SignatureES(es) ses.add_image('https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg/687px-Mona_Lisa,_by_Leonardo_da_Vinci,_from_C2RMF_retouched.jpg') ses.add_image('https://pixabay.com/static/uploads/photo/2012/11/28/08/56/mona-lisa-67506_960_720.jpg') ses.add_image('https://upload.wikimedia.org/wikipedia/commons/e/e0/Caravaggio_-_Cena_in_Emmaus.jpg') ses.add_image('https://c2.staticflickr.com/8/7158/6814444991_08d82de57e_z.jpg') list = ses.search_image('https://pixabay.com/static/uploads/photo/2012/11/28/08/56/mona-lisa-67506_960_720.jpg') print(list)

When it was excuted, "TypeError: unorderable types: dict() > dict()" occurred. The detailed problem is as follows. runfile('/Users/lvchangtao/local-image-match/storeSearching.py', wdir='/Users/lvchangtao/local-image-match') /Users/lvchangtao/anaconda3/lib/python3.5/site-packages/image_match/goldberg.py:402: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future lower_y_lim:upper_y_lim]) # no smoothing here as in the paper Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/lvchangtao/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 714, in runfile execfile(filename, namespace) File "/Users/lvchangtao/anaconda3/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 89, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "/Users/lvchangtao/local-image-match/storeSearching.py", line 20, in <module> list = ses.search_image('https://pixabay.com/static/uploads/photo/2012/11/28/08/56/mona-lisa-67506_960_720.jpg') File "/Users/lvchangtao/anaconda3/lib/python3.5/site-packages/image_match/signature_database_base.py", line 270, in search_image r = sorted(np.unique(result).tolist(), key=itemgetter('dist')) File "/Users/lvchangtao/anaconda3/lib/python3.5/site-packages/numpy/lib/arraysetops.py", line 198, in unique ar.sort() TypeError: unorderable types: dict() > dict()

rhsimplex commented 8 years ago

addressed in #38