image-match icon indicating copy to clipboard operation
image-match copied to clipboard

can't search

Open rezaAdie opened this issue 9 years ago • 11 comments

hi, i have question. I try to search image but i got nothing in result. This is my code. es = Elasticsearch("192.168.20.35:9200") ses = SignatureES(es) list = ses.search_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') print(list)

And i got [] as the result.

rezaAdie avatar Dec 09 '16 08:12 rezaAdie

I can't reproduce it, but I'm still using elasticsearch 2.x:

import elasticsearch
from image_match.elasticsearch_driver import SignatureES
es = elasticsearch.Elasticsearch()
es.indices.create('tester')
ses = SignatureES(es, index='tester')
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')
list = ses.search_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')
print(list)

outputs:

[{'dist': 0.0, 'id': 'AVji11MghIbF9_pSG8pq', 'path': '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', 'metadata': None, 'score': 2.435569}]

Can you double-check?

rhsimplex avatar Dec 09 '16 09:12 rhsimplex

hi, if i search using image that stored in my db use

list = ses.search_image('/data01/image_collections/caleg/Wakil_Calon_-JEMMY_ASIKU(2).jpg') print(list) i can get it like this [{'id': 'AVjfKYajkwc-LUweSHty', 'dist': 0.0, 'score': 65.11921, 'metadata': None, 'path': '/data01/image_collections/caleg/Wakil_Calon_-_JEMMY_ASIKU_(2).jpg'}]

but when i search using list = ses.search_image('http://i.imgur.com/CVYBCCy.jpg') print(list)

i get no value like '[]'

rezaAdie avatar Dec 09 '16 09:12 rezaAdie

I can't help without something I can reproduce myself. Hard to say when it's stuff that's in your db already.

Can you reproduce it in a self-contained script with a fresh index on images from the web?

rhsimplex avatar Dec 09 '16 09:12 rhsimplex

hi rhsimplex. can you produce it using this image in this link

https://www.dropbox.com/s/svrv12gggiaqdf3/aamir_khan.rar?dl=0 and try to search using ses.search_image('http://static.koimoi.com/wp-content/new-galleries/2014/06/Aamir-Khan-Wallpaper-7.jpg')

that was some image that i use in my elastic using elastic 2.2.1

rezaAdie avatar Dec 09 '16 09:12 rezaAdie

Ok, so if I add all the the images in the archive and then search against this URL, there are no matches but you expect one (or many)?

I'll try to get to it early next week at the latest. Let me know if you figure anything else out about what's going on.

rhsimplex avatar Dec 09 '16 10:12 rhsimplex

Yes for now i just get no value. What i expected is i can get value like

[ {'dist': 0.15454905655638429, 'id': u'AVM37oZq0osmmAxpPvx7', 'metadata': None, 'path': u'https://pixabay.com/static/uploads/photo/2012/11/28/08/56/mona-lisa-67506_960_720.jpg', 'score': 1.6818419}, {'dist': 0.24980626832071956, 'id': u'AVM37nMg0osmmAxpPvx6', 'metadata': None, 'path': u'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', 'score': 0.16198477}, {'dist': 0.43387141782958921, 'id': u'AVM37p530osmmAxpPvx9', 'metadata': None, 'path': u'https://c2.staticflickr.com/8/7158/6814444991_08d82de57e_z.jpg', 'score': 0.031996995} ] but from image that i add into elastic. If i can figure it, i'll gonna post it right away.

rezaAdie avatar Dec 09 '16 10:12 rezaAdie

Ok thanks, I'll check it out

rhsimplex avatar Dec 09 '16 10:12 rhsimplex

Hey @rezaAdie any insight? I'm on vacation for the holidays, no ETA from my end

rhsimplex avatar Dec 18 '16 14:12 rhsimplex

Hey @rhsimplex i'm still stuck, i try to lower elastic version but it's still same, but when i try monalisa image that from your tutorial... when i search it, i can found it. But still no value from my own image.

rezaAdie avatar Dec 19 '16 04:12 rezaAdie

When i add image, am i need to do it using URL??? because i add image from my directory path likethis :

"path": "/data01/image_collections/caleg/Wakil_Calon_-JEMMY_ASIKU(2).jpg",

rezaAdie avatar Dec 19 '16 08:12 rezaAdie

ses = SignatureES(es, distance_cutoff=0.3) You can try this.

wuqueshan avatar Aug 02 '19 10:08 wuqueshan