Closed dgtlmoon closed 4 years ago
@willard-yuan
diff --git a/index.py b/index.py
index ac3c737..04067c7 100644
--- a/index.py
+++ b/index.py
@@ -59,5 +59,5 @@ if __name__ == "__main__":
h5f = h5py.File(output, 'w')
h5f.create_dataset('dataset_1', data = feats)
# h5f.create_dataset('dataset_2', data = names)
- h5f.create_dataset('dataset_2', data = np.string_(names))
+ h5f.create_dataset('dataset_2', data = names)
h5f.close()
diff --git a/query_online.py b/query_online.py
index 50f79f1..9804012 100644
--- a/query_online.py
+++ b/query_online.py
@@ -22,6 +22,7 @@ args = vars(ap.parse_args())
# read in indexed images' feature vectors and corresponding image names
h5f = h5py.File(args["index"],'r')
+print (h5f['dataset_2'])
# feats = h5f['dataset_1'][:]
feats = h5f['dataset_1'][:]
print(feats)
@@ -59,7 +60,7 @@ print("top %d images in order are: " %maxres, imlist)
# show top #maxres retrieved result one by one
for i,im in enumerate(imlist):
- image = mpimg.imread(args["result"]+"/"+str(im, 'utf-8'))
+ image = mpimg.imread(args["result"]+"/"+str(im))
plt.title("search output %d" %(i+1))
plt.imshow(image)
plt.show()
sort of helps.. but missing results/foobar.jpeg
etc are missing
@dgtlmoon To fix the bug, please try to comment line 62 in index.py, and use line 61 instead.
The problem is caused by h5py library for different version of Python. Thanks for report the bug.
Indexing worked fine
but...