Skip to content

A python wrapper for Lear's GIST implementation working with numpy

License

Notifications You must be signed in to change notification settings

wanermiranda/lear-gist-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lear-gist-python

Python library to extract A. Torralba's GIST descriptor.

This is just a wrapper for Lear's GIST implementation written in C. It supports both Python 2 and Python 3 and was tested under Python 2.7.10 and Python 3.4.3 on Linux.

How to build and install

Pre-requirements

FFTW is required to build lear_gist.

Build and install

Download lear_gist

sh download-lear.sh

Build and install

python setup.py build_ext
python setup.py install

If fftw3f is installed in non-standard path (for example, $HOME/local), use -I and -L options:

$ python setup.py build_ext -I $HOME/local/include -L $HOME/local/lib

Usage

import gist
import numpy as np

img = ... # numpy array containing an image
descriptor = gist.extract(img)

Scene classification sample

This sample uses 8 Scene Categories Dataset.

cd sample
sh download-8scene.sh
# Extract GIST features from images in "spatial_envelope_256x256_static_8outdoorcategories" directory and save them into "features" directory
python feature_extraction.py spatial_envelope_256x256_static_8outdoorcategories features
# Train and test a multi-class linear classifier by features in "features" directory
python scene_classification.py features

About

A python wrapper for Lear's GIST implementation working with numpy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 53.0%
  • C 43.4%
  • Shell 3.6%