Skip to main content

Python Wrapper for the LEAR image descriptor implementation

author:

<olivier.grisel@ensta.org>

Library to compute GIST global image descriptors to be used to compare pictures based on their content (to be used global scene recognition and categorization).

The GIST image descriptor theoritical definition can be found on A. Torralba’s page: http://people.csail.mit.edu/torralba/code/spatialenvelope/

The source code of the C implementation is included in the lear_gist subfolder. See http://lear.inrialpes.fr/software for the original project information.

pyleargist is licensed under the GPL, the same license as the original C project.

Install

Install libfftw3 with development headers (http://www.fftw.org), python dev headers, gcc, the Python Imaging Library (PIL) and numpy.

Build locally for testing:

% python setup.py buid_ext -i
% export PYTHONPATH=`pwd`/src

Build and install system wide:

% python setup.py build
% sudo python setup.py install

Usage

Here is a sample session in a python shell once the library is installed:

>>> from PIL import Image
>>> import leargist

>>> im = Image.open('lear_gist/ar.ppm')
>>> descriptors = leargist.color_gist(im)

>>> descriptors.shape
(960,)

>>> descriptors.dtype
dtype('float32')

>>> descriptors[:4]
array([ 0.05786307,  0.19255637,  0.09331483,  0.06622448], dtype=float32)

The GIST descriptors (fixed size, 960 by default) can then be used as an euclidian space to cluster images based on their content.

This dimension can then be reduced to a 32 or 64 bits semantic hash by using Locality Sensitive Hashing, Spectral Hashing or Stacked Denoising Autoencoders.

A sample implementation of picture semantic hashing with SDAs is showcased in the libsgd library: http://code.oliviergrisel.name/libsgd

Changes

  • 1.1.0: 2010/03/25 - fix segmentation fault bug, thx to S. Campion

  • 1.0.1: 2009/10/10 - added missing missing MANIFEST

  • 1.0.0: 2009/10/10 - initial release

Metadata

Release files for pyleargist 2.0.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 pyleargist 2.0.5
File Size Uploaded Provenance
pyleargist-2.0.5.tar.gz 26.4 kB Without provenance Details

Release files / pyleargist-2.0.5.tar.gz

Download URL pyleargist-2.0.5.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
212d932d756799071bb31daa6c03457e65238d461fa15598d6f849be0adac8ec
BLAKE2b-256 checksum
How to use checksums
f74a2eef58a73c48aec6aca09254ef0f39148fd39b8dc7ec96d6b39d513b03eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyleargist 2.0.5

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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