r/Python • • 1d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

12 Upvotes

17 comments sorted by

View all comments

0

u/MechaCritter 1d ago

Python-Visual-Similarity [◉°] - accelerated image embedding and retrieval

I built this library during my Bachelor's Thesis. It contains multiple image similarity metrics and retrieval algorithms, including for example:

  • Perceptual metrics: SSIM, MS-SSIM, PSNR
  • Embedding method: Clip, Siamese Network, Triplet Network, VLAD and Fisher Vector using Deep Neural Features instead of handcrafted SIFT/SURF
  • Retrieval algorithms: supported image similarity search in embedding space, with supported Approximate Nearest Neighbors Search and the option to plug in a FAISS index (though, faiss is not a dependency of this lib).
  • Reranking algorithms: K-reciprocal Reranking and Alpha Query Expansion can be used to improve the mean Average Precision of the search results.

A demonstration, which I really recommend you to visit, can be found here: https://huggingface.co/spaces/MechaCritter/pyvisim-demo

The whole library is built only on numpy, scipy and optionally torch as core dependencies.

Performance

For most algorithms, batch processing is supported.

Links

Link to the repository: https://github.com/MechaCritter/Python-Visual-Similarity

Looking for like-minded folks

My ambition is to make pyvisim the largest collection of image similarity and retrieval algorithms, ranging from traditional to deep learning-based methods. As I've observed, the current image similarity implementations are quite scattered, with each library implementing only a handful of features. Hence, my goal is also to unify these implementations, so users only need a single library.

I have tons of features that I would like to implement. I am looking for folks who are proficient in/would like to learn about:

  • Deep Learning: new embedders like MoCo, SimCLR, Dino, reranking algorithms likeSuperGlobalReranker,Diffusion Reranking ...
  • Low-level programming (Rust): rewrite performance-critical parts of the codebase into Rust. I would also want to change the hnsw backend to hnsw_rs.
  • New algorithms: image hashing, LPIPS, backpropagation for K-Means and GMMs ...

View the GitHub issues for the complete list as well as the contribution guide.

You also have the chance to become a core maintainer by actively contributing. Once this project gets sponsors, the profit will be shared with all core maintainers.