Skip to main content

A package for computing entropy-based diversity measures on image sets

Project description

MEASURING DIVERSITY OF IMAGE SETS

Assess a set of image's diversity by computing an approximation of the Entropy of the images' mappings into a pre-trained network latents.


Installation

Install from pypi:

pip install image-diversity

Usage (console)

To compute the Truncated CLIP Entropy (TCE) of a set of images in a directory, run

python3 -m image_diversity <path/to/dir>

To compute the Truncated Inception Entropy (TIE), change the div_type option to TIE

python3 -m image_diversity <path/to/dir> --div_type TIE

Arguments

python3 -m image_diversity <path/to/dir>
--div_type <str>        Encoding network: TCE (default) or TIE
--n_eigs <int>          Number of eigenvalues for truncation (default: 20)
--device <str>          Device to use. Automatic by default
--batch_size <int>      Batch size for data loading (default: 16)

Usage (script)

Computing Truncated CLIP Entropy (TCE)

from image_diversity import ClipMetrics

clip_metrics = ClipMetrics()
tce = clip_metrics.tce("path/to/img/dir")

Computing Truncated Inception Entropy (TIE)

from image_diversity import InceptionMetrics

inception_metrics = InceptionMetrics()
tie = inception_metrics.tie("path/to/img/dir")



Inception implementation based on pytorch-fid

CLIP implementation based on CLIP

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

image_diversity-0.1.6.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

image_diversity-0.1.6-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file image_diversity-0.1.6.tar.gz.

File metadata

  • Download URL: image_diversity-0.1.6.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.14

File hashes

Hashes for image_diversity-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a1adc9e83c2e77949c5955375aa91bf309608872374002a9d5b17b61fe30b174
MD5 e605d498759a29e52a758c2fb89dfc84
BLAKE2b-256 690b5f6bf590749048a2f2ba350e99acd571bf41b9f9a399fe42769f8556c18b

See more details on using hashes here.

File details

Details for the file image_diversity-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for image_diversity-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 423d07511a71f98f01e260390b9a44619cb983d18e04eafddbdf194577160c4b
MD5 a27c48591ecaf94f5d9c460d00bde9df
BLAKE2b-256 e42f6100ab7246cdf6eb1c24f96459ba7d2a023ef2dd66fe6310fcecf205ec76

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