Repository navigation
[v0.5.0] - 2026-06-19
Pre-release
Pre-release
Added
-
New
pyvisim.retrievalpackage for fast similarity search. Wrap an
ImageEncodingMapin an index (ImageIndexIVFFlatorImageIndexIVFPQ,
bothl2orinner_product), then hand it to anImageRetriever:from pyvisim.retrieval import ImageIndexIVFFlat, ImageRetriever index = ImageIndexIVFFlat(encoding_map, quantizer="inner_product", nlist=100) retriever = ImageRetriever(index) results = retriever.retrieve_top_k_similar(query_images, k=5)
-
New
pyvisim.functionalmodule holdingretrieve_top_k_similarand the
Candidate(path, score)result type.
Changed
retrieve_top_k_similarnow ranks a whole batch of query images in one shot
and returns one rankedlist[Candidate]per query (in input order), so a
single call can search many images at once. Pass anindex=to run the search
through FAISS instead of brute-force cosine.
Breaking
⚠️ retrieve_top_k_similarmoved out ofpyvisim.evalinto
pyvisim.functional. Update your imports:
from pyvisim.functional import retrieve_top_k_similar.⚠️ Its return type changed fromlist[tuple[str, float]]to
list[list[Candidate]](one list per query image). Readcandidate.pathand
candidate.scoreinstead of unpacking a tuple.⚠️ The getters for thepcaandclustering_modelattributes of all encoders
are removed (the attributes are now read-only). This is in order to discourage
users from mutating the clustering internals, which could break the
algorithm completely. Also, once trained, there's not really a reason to
have to mutate those models at all because any different model would be
basically wrong for the trained encoder.⚠️ TheImageEncodingMapdoes not take theEncoderas an argument anymore.