Skip to main content

pyvisim

License Version Status Python Contributions

Welcome to pyvisim!

pyvisim is a computer vision library for computing image similarities using traditional and deep learning methods.

📚 Documentation: https://mechacritter.github.io/Python-Visual-Similarity/

Table of Contents

Status

Overview

Architecture Diagram

The goal of pyvisim is to become the largest collection of image similarity metrics, varying from traditional methods like PSNR, SSIM, Fisher Vectors, and VLAD to deep learning methods like CLIP and Siamese Networks. Furthermore, advanced image similarity search and reranking algorithms are provided to allow users to refine the search results as desired. For more details, please refer to the documentation provided.

Currently, one would need to install numerous libraries just to everything mentioned above (for example, scikit-image + opencv-python for Fisher Vectors, SSIM, open-clip for CLIP Embedder, and faiss for Approximate Nearest Neighbors Search). pyvisim attempts to close this gap by implementing as many metrics as possible using only numpy, scipy (for conventional metrics), and optionally torch (for deep learning metrics) as core dependencies, plus making them more user-friendly with a simple Object-Oriented code design.

Accelerated Computation

Cython kernels and C++ libraries are used for some metrics to accelerate computation significantly compared to all reference libraries on the CPU. See, for example, benchmark results of the SSIM implementation.

Examples

Structural Similarity (see documentation here):

from pyvisim.dense.structural import SSIM

ssim = SSIM()
similarity_score = ssim.similarity_score(image1, image2)
print(f"Similarity Score: {similarity_score}")

One-Shot similarity computation using the CLIPEmbedder(see documentation here):

from pyvisim.neural_networks import ClipEmbedder

# Declare the Clip Embedder
embedder = ClipEmbedder()

# Compute the similarity score. By default, cosine similarity is used.
similarity_score = embedder.similarity_score(image1, image2)
print(f"Similarity Score: {similarity_score}")

Image retrieval (see documentation here):

from pyvisim.neural_networks import ClipEmbedder
from pyvisim.retrieval.image_store import InMemoryImageEmbeddingStore

embedder = ClipEmbedder()

image_store = InMemoryImageEmbeddingStore(
    image_paths=train_image_paths,
    embedder=embedder,
    search_index="hnsw",
    index_params={"graph_degree": 16, "build_candidates": 200},
)
image_store.build_store()  # embeds the gallery and builds the index

candidates = image_store.retrieve_top_k_similar(image, k=5)[0]  # one Candidate per match
for candidate in candidates:
    print(candidate.path, candidate.score)

The alpha query expansion and the k-reciprocal re-rankingcan additionally be used to refine the retrieval results, improving mean Average Precision (see the documentation):

from pyvisim.retrieval.reranking import KReciprocalReranker

pool = image_store.retrieve_top_k_similar(image, k=100, query_expansion=True)[0]
best = KReciprocalReranker(image_store).rerank(pool, top_k=5)

For more examples, please refer to the tutorials.

Installation

To install the slim version (without deep learning features):

pip install pyvisim

Additional features include (note: these pull in heavy dependencies like torch):

# For deep learning features and the OxfordFlowerDataset
pip install "pyvisim[nn]"

All experiments in this project was made on the Oxford Flower Dataset [7], for which I have created a custom dataset class. For more details on the dataset, please refer to the documentation.

Contributing

See the contributing guidelines.

Get in Touch

Feel free to:

License

This project is licensed under the terms of the MIT license.

Release files for pyvisim 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvisim 0.10.1
File Size Uploaded
pyvisim-0.10.1.tar.gz 705.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyvisim 0.10.1
File
pyvisim-0.10.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pyvisim-0.10.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pyvisim-0.10.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
pyvisim-0.10.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pyvisim-0.10.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pyvisim-0.10.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
pyvisim-0.10.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pyvisim-0.10.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pyvisim-0.10.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
pyvisim-0.10.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pyvisim-0.10.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pyvisim-0.10.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pyvisim-0.10.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pyvisim-0.10.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
pyvisim-0.10.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details

Total release size: 41.5 MB

Release files / pyvisim-0.10.1.tar.gz

Download URL pyvisim-0.10.1.tar.gz
Size 705.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1f5b888cbdead1e3da9d60addc4090b10d25751019b199a8ac9d276a4f052b74
BLAKE2b-256 checksum
How to use checksums
e6d049569f20284d32a586a1c221bb0f1c56ca98337721768ae3eecb0c002963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp314-cp314-win_amd64.whl

Download URL pyvisim-0.10.1-cp314-cp314-win_amd64.whl
Size 1.5 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
011f2a5c829e72317cf682efa760178e2cb2567050575597d4e3c49021494c52
BLAKE2b-256 checksum
How to use checksums
bcbd5d47fe7701331d7c4c5b9c74a9fcfa6d644f9b692b666e2b341ae6ff5134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvisim-0.10.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.5 MB
Tags CPython 3.14 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
05eca117676c552ae4cbf7890108efbc3cd627cd7ef68b67fa994501305bb6e3
BLAKE2b-256 checksum
How to use checksums
9967479af9d58268552d1bfd9ae47eeb262601d5aca805a80f2e985e32d27f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL pyvisim-0.10.1-cp314-cp314-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a536b7ffd8c53979584a0dcda78e6928dd2e302d55bb68ee512d0f803484bf3b
BLAKE2b-256 checksum
How to use checksums
3d1b90ad676e257cb430142e09d96f668c6f894428fafb509e73bb952e64afb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp313-cp313-win_amd64.whl

Download URL pyvisim-0.10.1-cp313-cp313-win_amd64.whl
Size 1.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
c30084868e6e7bd34f52c49bf4343d2c74e5bff21b8214a09328ed73ef7cf65c
BLAKE2b-256 checksum
How to use checksums
fd6e79b6354983ede4e1dc4d9b70928e26a8d32087d8b5e3f58c8d4df44e23ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvisim-0.10.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.5 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7eea8954bb88c87db6c79c53e6f69c351232cb5edddde6f2464c922a2f2e00bc
BLAKE2b-256 checksum
How to use checksums
581ff8c17f09af70fd7099b8e10568bdff75bab1e1798eb589392e3492c033b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL pyvisim-0.10.1-cp313-cp313-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c9d8174ac3bd965548cd612e56aaf1aebf01833c1c08852c30df6b91f3518b61
BLAKE2b-256 checksum
How to use checksums
afc660ce1e429f5276a11c29d921ff149f463654cfe099d6798f0310d32da6c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp312-cp312-win_amd64.whl

Download URL pyvisim-0.10.1-cp312-cp312-win_amd64.whl
Size 1.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
001ffbe1dfe691c4a7ab82dcf99d225eb430ef3499f9e4d03e923663fa2b17fa
BLAKE2b-256 checksum
How to use checksums
560f1ea1859e4e3655a677bad6d5faf93859641c9f142eb4eec81397a7f595f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvisim-0.10.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.5 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b45af98dfad1b28ef8562d1dccaf26d0d82bc8218d0cce39d7967c05af061b78
BLAKE2b-256 checksum
How to use checksums
6117a4386d25223ba2058ac4f6d3e923f89afdf5dc46488f1be85dbc41ce52d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL pyvisim-0.10.1-cp312-cp312-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ab4bb6590c531fc4993acbe4e9f5d1bb4469865c3f8e3b8d061ba134aacfaba0
BLAKE2b-256 checksum
How to use checksums
8279fe4ca899509fc3a446460137bc6fcaba55026165b9121683fa1fdcf3c41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp311-cp311-win_amd64.whl

Download URL pyvisim-0.10.1-cp311-cp311-win_amd64.whl
Size 1.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
5ef6e2313560b4ee2d3cddb7831b5d9c1837764ece420d979391dc5155ac445d
BLAKE2b-256 checksum
How to use checksums
43d719e07ae57302f8a658fcab4a19998d75568388f5eca100785200c84f67b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvisim-0.10.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.4 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2488a001af3b27886e5585d7b9a583bc8c22143f0737c917f25b4ed069d0885b
BLAKE2b-256 checksum
How to use checksums
8de78c4289a6364cce729f10406440754c4329b8ca5648130a65058dde80aa56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL pyvisim-0.10.1-cp311-cp311-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0d98c9eb43f03bf31fdd8ce49e465ad2989223e33efb4c007d0093346c480f35
BLAKE2b-256 checksum
How to use checksums
bd3c3d3c9d7f86daf120c395724e61ca09b9c735f53b021616a7dd88d024cbe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp310-cp310-win_amd64.whl

Download URL pyvisim-0.10.1-cp310-cp310-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
ddeacd1c1d7ee3a4446eb232e53a8c9abceac44e5bd9e3e0d8bee067eec82cf6
BLAKE2b-256 checksum
How to use checksums
7c59dd14da7903619ba0aabfde397f1ae4e32c98214bd2fdccccd4dce1a9bd2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvisim-0.10.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.3 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
45b1a329993aa051061bfc044d8c5a8481c30446c9180c349cbded90a74c5957
BLAKE2b-256 checksum
How to use checksums
83d09acf5777eec854f4b820244548558c8911ef8f340380170fb6d78c18b416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / pyvisim-0.10.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL pyvisim-0.10.1-cp310-cp310-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
80143c5b36a33abb759a16cba42be7a8d0e00af55dd7423edbdf8501751e767b
BLAKE2b-256 checksum
How to use checksums
95a0c50070bd94260527b3da8672a212895606dc46c3b092238950e3cdabe496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page