Traceback (most recent call last):
File "search.py", line 90, in <module>
features, index = index_images(index_folder, features_path, file_mapping, loaded_model)
File "search.py", line 54, in index_images
_, _, paths = load_paired_img_wrd(folder, [], use_word_vectors=False)
File "/home/alpha/Documents/ai-ml-dl/external/semantic-search/utils.py", line 9, in load_paired_img_wrd
class_names = [fold for fold in os.listdir(folder) if ".DS" not in fold]
TypeError: coercing to Unicode: need string or buffer, NoneType found
Fix: negate the indexing flag
## indexing = image is None ## comment this
indexing = image is not None ## new
Error 2: after fixing the Error 1:
Found 400000 word vectors.
Traceback (most recent call last):
File "search.py", line 112, in <module>
results = vector_search.search_index_by_value(word_vectors[input_word], image_index, file_mapping)
File "/home/alpha/Documents/ai-ml-dl/external/semantic-search/vector_search/vector_search.py", line 150, in search_index_by_value
return [[a, item_mapping[a], distances[1][i]] for i, a in enumerate(distances[0])]
IndexError: string index out of range
(After, custom model trained for hybrid approach)
indexing
flagfile_mapping
tofile_index
Now it works:
animal
animal
search:+1 for the very nice implementation and explanation on CBIR. Please fix the above in the main code.