rom1504 / image_embeddings

Using efficientnet to provide embeddings for retrieval
https://rom1504.github.io/image_embeddings/
MIT License
151 stars 32 forks source link

image extension .jpeg hardcoded #17

Open zubairahmed-ai opened 3 years ago

zubairahmed-ai commented 3 years ago

Hi

You have hardcoded extension .jpeg which makes it harder to try other images

<ipython-input-42-a444c2d0177a> in <module>
      1 p=1
      2 print(id_to_name[p])
----> 3 image_embeddings.knn.display_picture(path_images, id_to_name[p])
      4 results = image_embeddings.knn.search(index, id_to_name, embeddings[p])
      5 image_embeddings.knn.display_results(path_images, results)

~/miniconda3/envs/tracker/lib/python3.8/site-packages/image_embeddings/knn/knn.py in display_picture(image_path, image_name)
     54 
     55 def display_picture(image_path, image_name):
---> 56     display(Image(filename=f"{image_path}/{image_name}.jpeg"))
     57 
     58 
rom1504 commented 3 years ago

The current code only supports jpeg yes. It could be possible to add support to other formats but it's not only the extension that needs to be changed, a conversion step should be added

On Fri, Oct 16, 2020, 12:07 Zubair Ahmed notifications@github.com wrote:

Hi

You have hardcoded extension .jpeg which makes it harder to try other images

in 1 p=1 2 print(id_to_name[p]) ----> 3 image_embeddings.knn.display_picture(path_images, id_to_name[p]) 4 results = image_embeddings.knn.search(index, id_to_name, embeddings[p]) 5 image_embeddings.knn.display_results(path_images, results) ~/miniconda3/envs/tracker/lib/python3.8/site-packages/image_embeddings/knn/knn.py in display_picture(image_path, image_name) 54 55 def display_picture(image_path, image_name): ---> 56 display(Image(filename=f"{image_path}/{image_name}.jpeg")) 57 58 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or unsubscribe .
zubairahmed-ai commented 3 years ago

Thanks for replying, already changed the extension to jpg and using the new module after change

zubairahmed-ai commented 3 years ago

Must also include a function to loop through all available images and display, the ordering on the file system isn't the same as index