Skip to main content

CNN/ViT image embedding mosaic — extract features, reduce to 2D, render a visual atlas

Project description

iconoscope

iconoscope is a python package for exploring image collections using visual similarity based on image embeddings extracted from models like CLIP and DINOv2/3. Embeddings can be used to generate a mosaic where visually similar images appear near each other, or for interactive exploration in a preliminary HTML viewer.

The name iconoscope comes from the Greek words for image (εἰκών) and to see (σκοπεῖν). The iconoscope was the first practical video camera tube used in early television cameras.

This package was inspired by Andrej Karpathy's CNN embedding visualizer. Version 0.1 started as a python port of Karpathy's cnnembed Matlab code created with Claude Code.

Install

pip install iconoscope
pip install "iconoscope[umap]"   # include UMAP reducer

Or with uv:

uv add iconoscope
uv add "iconoscope[umap]"

CLIP backend

The CLIP embedding backend is not available on PyPI and must be installed separately:

pip install git+https://github.com/openai/CLIP.git

Usage

Two-stage pipeline: embed first (slow, GPU-accelerated), then mosaic (fast, iterate freely).

1. Embed

Extract features from a directory of images and save to an HDF5 file:

iconoscope embed ./images/ mycollection.h5

2. Mosaic

Reduce embeddings to 2D and render a mosaic image:

iconoscope mosaic mycollection.h5

Output defaults to mycollection.jpg. Coordinates are cached in the HDF5 file so subsequent runs skip the slow dimensionality reduction step.

3. Viewer

Generate an interactive HTML viewer:

iconoscope viewer mycollection.h5

Writes mycollection.html. Requires a pre-built Svelte app (cd viewer && npm install && npm run build).

Other commands

iconoscope info mycollection.h5          # inspect what's stored in an embeddings file
iconoscope cluster mycollection.h5 -k 12 # k-means clustering on embeddings

Embeddings file

The .h5 file is the hand-off between pipeline stages. It holds:

  • features — L2-normalized float32 embeddings [N, D]
  • paths — image paths [N]
  • coords — cached 2D coordinates [N, 2] (written after the first mosaic run)
  • cluster assignments (written by cluster)

Run iconoscope info to inspect the contents of any embeddings file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iconoscope-0.1.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iconoscope-0.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file iconoscope-0.1.1.tar.gz.

File metadata

  • Download URL: iconoscope-0.1.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for iconoscope-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dddde52a68c93edcf1fcef03b79eb9a8e0cb9edc0a2e6b668364f55eb9867cb6
MD5 9a002b7d569024bebb8a10f1ed3c47ce
BLAKE2b-256 a4017e6fc06c6516536b639c7761ce288f1865c55d525094e84bdb049e72d320

See more details on using hashes here.

File details

Details for the file iconoscope-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iconoscope-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for iconoscope-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16a6ba477c9b561d43ab7ce0404c9945cb8c52b4d3850110dbae74f1ac69eedf
MD5 4e4883fa65ff9860e7943f4b422e0779
BLAKE2b-256 74fad5bbd2949826b03086ba3ea80774e5528c768ec9a61133317d33881589cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page