pochih / CBIR

🏞 A content-based image retrieval (CBIR) system
614 stars 210 forks source link

where do i put the query image? #6

Open chopperop opened 6 years ago

chopperop commented 6 years ago

where do i put the query image?

minukumari commented 5 years ago

@pochih Where should I put the query image

MOAboAli commented 5 years ago

I have same problem, where do i put query images?

KarthikDutt commented 4 years ago

@minukumari @mohamedaboali1990 - You can load the file containing the features extracted for each image. The file will be created in the cache directory of your root folder. This file contains a list of dictionaries, one dictionary per image of your dataset. It is of the form {'img':'xxx', 'cls','123','hist': ''} where img is the name of the image, cls is the class and hist holds the histogram generated for that image. You can choose one of the element of this list as your query image and then call the function infer which is inside evaluate.py to calculate the similarity distance of the query image and the other images and return the most similar results.

Code mentioned below could be helpful: from evaluate import infer samples = cPickle.load(open('D:\Work\CBIR\CBIR-master\cache\histogram_cache-region-n_bin12-n_slice3', "rb", True)) query=samples[13627] ap,res=infer(query,samples,db=None, sample_db_fn=None, depth=10, d_type='d1') depth is the number of similar images you want to retrieve and d_type is the type of simialrity metric you want to use.

You might want to modify the function infer inside evaluate to return also the matched image name along with class and distance which it is presently retrieving.

@pochih - Thanks for this implementation! Great work!

Praveenk8051 commented 3 years ago

@KarthikDutt What is 136627 ? What @minukumari @MOAboAli meant was How can we evaluate a new Image ?

MOAboAli commented 3 years ago

@Praveenk8051 ,I don't understand the question ?

Praveenk8051 commented 3 years ago

@MOAboAli I was repeating the question you asked to @KarthikDutt

MOAboAli commented 3 years ago

I didn't use this application , SORRY I DON'T KNOW