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

[!WARNING] This project is still in early development, so the API might change anytime (with deprecation, but the change will come soon afterwards). Feel free to use it in development environments, but I would recommend against using it in production.

The first stable release will have the version tag v1.0.0 and will come approximately by the end of August 2026.

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. Then, one can use these for image retrieval and clustering.

Currently, one would need to install numerous libraries just to get all the metrics mentioned (for example, scikit-image + opencv-python for Fisher Vectors and SSIM, open-clip for CLIP Embedder). pyvisim attempts to close this gap by implementing as many metrics as possible using only numpy, scipy (for conventional metrics), and torch (for deep learning metrics), 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.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.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},
)

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.image_store 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 pyvisim Examples Repository.

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

If you have any questions or just want to say hi, feel free to:

License

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

Release files for pyvisim 0.9.5

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.9.5
File Size Uploaded
pyvisim-0.9.5.tar.gz 704.6 kB Details

Built distributions (wheels)

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

Total release size: 41.4 MB

Release files / pyvisim-0.9.5.tar.gz

Download URL pyvisim-0.9.5.tar.gz
Size 704.6 kB
Tags Source
SHA-256 checksum
How to use checksums
011a47f51e45653b88c8f7dcf77682c91a425d84fde0c1fa2b995cdc6af47aaf
BLAKE2b-256 checksum
How to use checksums
73ef17df0e49d1c25abd5b7be46529882604b67382ac1404d86dd9083b9ad9ab
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-cp314-cp314-win_amd64.whl
Size 1.5 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
c655eac0e7b4467a24e2629a866836168f35b99363b5de8ae6afab02689c32a7
BLAKE2b-256 checksum
How to use checksums
c84e8de8f8bce613016c2d02f94dde33bc8594505a7b3ece7c77a1f7e67a5409
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
9229a30c282c02cb6722c45cd5e73c1e588e49f134636edec4cca1e0ac3e58e1
BLAKE2b-256 checksum
How to use checksums
3517b1760b3c5118463224696baaa2b3eb0a9db12d0129781c9b95a77bdd11e0
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
7336ac834d9f6aeeae4862dfeb9947104841778a99b428e2471b24c9ab502355
BLAKE2b-256 checksum
How to use checksums
e9dc79d8bb095fe32065cb2c39f55943356646ce0f8f6d5f958022bc54077861
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-cp313-cp313-win_amd64.whl
Size 1.5 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
42e970adacf07c71118f1ea776f311fc33bf70c624532cba5e6ab15345c3c6b1
BLAKE2b-256 checksum
How to use checksums
6d96be0de09ab67b9933416749663e3ad523def1e86e0e77bc5cdb2de539679e
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
89b364b024fa3b2156cf3a496e50601a5a5317480cf334cd57bde4db090aa76a
BLAKE2b-256 checksum
How to use checksums
81b018227a68a07632a5299d48dd0d295d23566e46220da6e4472f150d6d74fe
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
a412c892cfa0e1c04473f14b21b89bd6bd9c7d98bbef179f1870597bd7bea319
BLAKE2b-256 checksum
How to use checksums
c4245c87ca830d6cf7401d71e1f0a4b3b94f01e90337e53463c9f064309a2c67
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-cp312-cp312-win_amd64.whl
Size 1.5 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0342022d99349555e9a119aada1856e9ed09678788490c8c68aad0de3ab098c5
BLAKE2b-256 checksum
How to use checksums
263d9dd6ecf62993dfe1b547954266708d32d44b84562118de03cd822a21c8a3
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
aa23ea8be95f19175c1e38968966ca4a804b63c6ac9a9c1664f387a4fefd1d74
BLAKE2b-256 checksum
How to use checksums
1e8193e24b54f3fb56ccf32fbeabcd562917275c75fea7f509efb8496ac2b313
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
28c791fccd0de181742d9666e74a11b4b04ca149a348e28b00a5e67bb851795d
BLAKE2b-256 checksum
How to use checksums
dc8155f2b2e3d5f2d2fa273cc2ba56ee6b035dddefdc2dafa0ab3207bf352656
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-cp311-cp311-win_amd64.whl
Size 1.5 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
e68e1579c6b46f4130359fe3d737a21f0415f65928ae79395e26d5eb091d8407
BLAKE2b-256 checksum
How to use checksums
534c8a32541109d94966dce202eed063e6afa3ffa4e762066dd420ba88fa74a4
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
7674ce95e5c73c885d25d440f2469b4638bbbda8807abbd94d68dc9f74b4a2c2
BLAKE2b-256 checksum
How to use checksums
eecfcf80fe16c8232649b088221f295f1681687fa146c62eca503e5c92c8acf9
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
a8d7c93882fe1b85c2477dd22c10973601fbf10f1d8a3b2a037a07a29f1b05a8
BLAKE2b-256 checksum
How to use checksums
b008a2a6d67fdef0c9466e375ad3592bd59238aefadc6bf7eded56f6e55245ef
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-cp310-cp310-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
93c0aec3ec56e5ffd77539eb7fa2080617bc362c5763e3905aa6c1f1d28e4fa8
BLAKE2b-256 checksum
How to use checksums
18e57149b6fc5c04c1be1cb90bcb4738825f0e8b68f1f57399feb6e81f056d8d
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
063d1193a42c3637415891d986eee04ed3fd083192ee81b69f2e46de13153515
BLAKE2b-256 checksum
How to use checksums
ea274754fab69849efb11a8aed3f40990f59fe0e6988b674433e2e27ccd1757b
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 14, 2026.

Transparency log

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

Download URL pyvisim-0.9.5-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
f991e4afc2fafce95ce60c20131798ac120d27df0dc304eda22501ec202ced78
BLAKE2b-256 checksum
How to use checksums
6958c571218b0548a7dd36fbb4f071dac26a8f57543be35145d2dde8564a6c2d
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 14, 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