You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, @jesolem
I'm truly thankful for PCV sources.
Recently, I found that there might be a problem of indexing in Imagesearch.py
I just want to confirm whether the original code is right.
if we look into querying function, we can notice query() -------> candidate_from_histogram() -------> candidates_from_word().
defcandidates_from_word(self,imword):
im_ids=self.con.execute( "select distinct imid from imwords where wordid=%d"%imword).fetchall()
Meanwhile, I think the value indexed to imword table is not word-id, but word-frequency.
defadd_to_index(self, imname, descr):
...
imwords=self.voc.project(descr)
nbr_words=imwords.shape[0]
# link each word to imageforiinrange(nbr_words):
word=imwords[ i ]
# wordid is the word number itselfself.con.execute("insert into imwords(imid,wordid,vocname) values (?,?,?)", (imid,word,self.voc.name))
So, it seems that word-id and word-frequency are compared. Isn't it wrong?
I think the add_to_index() should be fixed as comparison between word-id and word-id like below.
defadd_to_index(self, imname, descr):
...
imwords1=self.voc.project(descr)
imwords2=imwords1.nonzero()[0]
nbr_words=imwords2.shape[0]
# link each word to imageforiinrange(nbr_words):
word=imwords2[ i ]
# wordid is the word number itselfself.con.execute("insert into imwords(imid,wordid,vocname) values (?,?,?)", (imid,word,self.voc.name))
# store word histogram for image# use pickle to encode NumPy arrays as stringsself.con.execute("insert into imhistograms(imid,histogram,vocname) values (?,?,?)", (imid,pickle.dumps(imwords1),self.voc.name))
The text was updated successfully, but these errors were encountered:
Hello, @jesolem
I'm truly thankful for PCV sources.
Recently, I found that there might be a problem of indexing in Imagesearch.py
I just want to confirm whether the original code is right.
if we look into querying function, we can notice query() -------> candidate_from_histogram() -------> candidates_from_word().
Meanwhile, I think the value indexed to imword table is not word-id, but word-frequency.
So, it seems that word-id and word-frequency are compared. Isn't it wrong?
I think the add_to_index() should be fixed as comparison between word-id and word-id like below.
The text was updated successfully, but these errors were encountered: